Re: Is "Citation Style" menu tweakable?

2017-06-21 Thread David Pesetsky
Thanks for your continued help!  I have solved the problem, with the help of 
(the presuppositions of) your questions and this: 
https://tex.stackexchange.com/questions/56525/natbib-setcitestyle-causes-undefined-control-sequence-error?rq=1.

Early in my exploring of Lyx a few weeks ago, I took advantage of the 
information offered by Maria Gouskova, who is in my field, at 
https://www.gouskova.com/resources/.  That includes a link to her texmf 
directory with field-specific stuff in it, with an invitation to copy that into 
one's own texmf directory, which I did.  That turns out to have included an 
out-of-date version of natbib.sty, which was the cause of my error messsages.  
Removing it solved the problem.

Thanks again,
David

On Jun 20, 2017, at 11:23 PM, Richard Heck 
> wrote:

On 06/20/2017 06:25 PM, David Pesetsky wrote:
Thank you for your detailed reply (and hello)!  Your suggestion to add "comma" 
to [...]Class Options>Custom works very well, thank you!

But no matter what I put after \setcitestyle (or where I locate the command in 
the document -- preamble, body), I get an error message from Lyx — for example:

\setcitestyle
{notesep={: }}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

It's not worth chasing down this problem to the ends of the earth, but if you 
have any troubleshooting suggestions, I'd be happy to try them.

Very odd. The \setcitestyle command is defined by natbib.sty, and you said you 
were using natbib, yes?  (It did not exist before version 8 of natbib, but that 
was about a decade ago.) What OS are you using? Do you know what LaTeX 
distribution you have? Actually, maybe a better questin is: What document class 
are you using?

If you could produce as small a file as possible that causes this to happen and 
post that, then it will help debug the issue.

Richard


--
David Pesetsky [pese...@mit.edu]
Head, Department of Linguistics and Philosophy
32-D818 Massachusetts Institute of Technology
77 Massachusetts Avenue
Cambridge, MA 02139 USA
(617) 253-0957 office   (617) 253-5017 fax
http://web.mit.edu/linguistics/www/pesetsky.home.html



Re: Is "Citation Style" menu tweakable?

2017-06-20 Thread Richard Heck
On 06/20/2017 06:25 PM, David Pesetsky wrote:
> Thank you for your detailed reply (and hello)!  Your suggestion to add
> "comma" to /[...]Class Options>Custom/ works very well, thank you!  
>
> But no matter what I put after \setcitestyle (or where I locate the
> command in the document -- preamble, body), I get an error message
> from Lyx — for example:
>
>> \setcitestyle
>> {notesep={: }}
>> The control sequence at the end of the top line
>> of your error message was never \def'ed. If you have
>> misspelled it (e.g., `\hobx'), type `I' and the correct
>> spelling (e.g., `I\hbox'). Otherwise just continue,
>> and I'll forget about whatever was undefined.
>
> It's not worth chasing down this problem to the ends of the earth, but
> if you have any troubleshooting suggestions, I'd be happy to try them.

Very odd. The \setcitestyle command is defined by natbib.sty, and you
said you were using natbib, yes?  (It did not exist before version 8 of
natbib, but that was about a decade ago.) What OS are you using? Do you
know what LaTeX distribution you have? Actually, maybe a better questin
is: What document class are you using?

If you could produce as small a file as possible that causes this to
happen and post that, then it will help debug the issue.

Richard



Re: Is "Citation Style" menu tweakable?

2017-06-20 Thread David Pesetsky
Thank you for your detailed reply (and hello)!  Your suggestion to add "comma" 
to [...]Class Options>Custom works very well, thank you!

But no matter what I put after \setcitestyle (or where I locate the command in 
the document -- preamble, body), I get an error message from Lyx — for example:

\setcitestyle
{notesep={: }}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

It's not worth chasing down this problem to the ends of the earth, but if you 
have any troubleshooting suggestions, I'd be happy to try them.

Thank you again!

-David


On Jun 19, 2017, at 10:45 PM, Richard Heck 
> wrote:

On 06/19/2017 08:48 PM, David Pesetsky wrote:
Is there a way to tweak Lyx so the Citation dialog shows a different set of 
options for "Citation Style" than the ones that appear by default when I have 
selected  "natbib" and "author-year" in Document Settings/Bibliography?  I'd be 
interested in having a comma rather than semicolon separating multiple 
references, for example.

There's nothing I can't produce manually, of course, by simply selecting the 
date-only option on the Citation Style pull-down menu and typing what I want 
before and after the date, but if I could take advantage of the pull-down menu 
options more often, it would save some effort.

Similarly, for some purposes, at least, I'd be happy if I could tweak "text 
after" in the same dialog so that it ends up preceded by a colon rather than 
the comma that Lyx inserts.

The issues you're raising here are actually LaTeX issues, rather than
LyX issues. It's important, in understanding how LyX operates, to
separate these: There's the question how things look in LyX; then there
is the question how the PDF looks when it is generated. The latter
ultimately concerns LaTeX. In some cases, LyX provides a 'native' way to
tweak the LaTeX output. But oftentimes, you have to do something
manually, e.g., add something to the LaTeX preamble.

In this case, the semi-colon citation-separator and comma before the
"text after" are being inserted by natbib, which is what formats the
citations and bibliogrpahy. So it's natbib that we need to control. The
natbib manual
   http://mirror.utexas.edu/ctan/macros/latex/contrib/natbib/natbib.pdf
has a bunch of information about tweaks. Section 5 of the manual
mentions a number of package options that change global behavior. The
one you want for your first request is "comma". You just add this, as a
class option, under Document> Settings> Class Options> Custom. (If there
already are some there, this is a comma-separated list, so add it with a
new comma, e.g.: draft,comma.)

For the other one, section 2.9 of the natbib manual explains how to
select citation punctuation using the \setcitestyle command. In your
case, you want:
   \setcitestyle{notesep={: }}
to select a colon followed by a space. It is probably easiest to put
this command into Document> Settings> LaTeX Preamble, though it can also
be entered as TeX code in the document itself. Note, by the way, that
natbib seems to be quite picky about space before and after the "=",
i.e., it does not like space there.

As it happens, \setcitestyle will also control the citation separator,
so you could just do:
   \setcitestyle{notesep = {: },citesep={,}}
and skip the class option, if you wanted.

Note that this will NOT change how the citations appear within LyX
itself. That can be done, but it's a much messier matter.

Richard Heck

PS Yes, the Richard Heck from the other side of L


--
David Pesetsky [pese...@mit.edu]
Head, Department of Linguistics and Philosophy
32-D818 Massachusetts Institute of Technology
77 Massachusetts Avenue
Cambridge, MA 02139 USA
(617) 253-0957 office   (617) 253-5017 fax
http://web.mit.edu/linguistics/www/pesetsky.home.html



Re: Is "Citation Style" menu tweakable?

2017-06-19 Thread Richard Heck
On 06/19/2017 08:48 PM, David Pesetsky wrote:
> Is there a way to tweak Lyx so the Citation dialog shows a different set of 
> options for "Citation Style" than the ones that appear by default when I have 
> selected  "natbib" and "author-year" in Document Settings/Bibliography?  I'd 
> be interested in having a comma rather than semicolon separating multiple 
> references, for example.  
>
> There's nothing I can't produce manually, of course, by simply selecting the 
> date-only option on the Citation Style pull-down menu and typing what I want 
> before and after the date, but if I could take advantage of the pull-down 
> menu options more often, it would save some effort.
>
> Similarly, for some purposes, at least, I'd be happy if I could tweak "text 
> after" in the same dialog so that it ends up preceded by a colon rather than 
> the comma that Lyx inserts.

The issues you're raising here are actually LaTeX issues, rather than
LyX issues. It's important, in understanding how LyX operates, to
separate these: There's the question how things look in LyX; then there
is the question how the PDF looks when it is generated. The latter
ultimately concerns LaTeX. In some cases, LyX provides a 'native' way to
tweak the LaTeX output. But oftentimes, you have to do something
manually, e.g., add something to the LaTeX preamble.

In this case, the semi-colon citation-separator and comma before the
"text after" are being inserted by natbib, which is what formats the
citations and bibliogrpahy. So it's natbib that we need to control. The
natbib manual
http://mirror.utexas.edu/ctan/macros/latex/contrib/natbib/natbib.pdf
has a bunch of information about tweaks. Section 5 of the manual
mentions a number of package options that change global behavior. The
one you want for your first request is "comma". You just add this, as a
class option, under Document> Settings> Class Options> Custom. (If there
already are some there, this is a comma-separated list, so add it with a
new comma, e.g.: draft,comma.)

For the other one, section 2.9 of the natbib manual explains how to
select citation punctuation using the \setcitestyle command. In your
case, you want:
\setcitestyle{notesep={: }}
to select a colon followed by a space. It is probably easiest to put
this command into Document> Settings> LaTeX Preamble, though it can also
be entered as TeX code in the document itself. Note, by the way, that
natbib seems to be quite picky about space before and after the "=",
i.e., it does not like space there.

As it happens, \setcitestyle will also control the citation separator,
so you could just do:
\setcitestyle{notesep = {: },citesep={,}}
and skip the class option, if you wanted.

Note that this will NOT change how the citations appear within LyX
itself. That can be done, but it's a much messier matter.

Richard Heck

PS Yes, the Richard Heck from the other side of L



Is "Citation Style" menu tweakable?

2017-06-19 Thread David Pesetsky
Is there a way to tweak Lyx so the Citation dialog shows a different set of 
options for "Citation Style" than the ones that appear by default when I have 
selected  "natbib" and "author-year" in Document Settings/Bibliography?  I'd be 
interested in having a comma rather than semicolon separating multiple 
references, for example.  

There's nothing I can't produce manually, of course, by simply selecting the 
date-only option on the Citation Style pull-down menu and typing what I want 
before and after the date, but if I could take advantage of the pull-down menu 
options more often, it would save some effort.

Similarly, for some purposes, at least, I'd be happy if I could tweak "text 
after" in the same dialog so that it ends up preceded by a colon rather than 
the comma that Lyx inserts.

-David