I am trying to write an article with the elsarticle class.
The journal I'm writing for uses numbered citations listed in order of citation.
I am using elsart-mum.bst, and an external bib database.
When compiled the citations are displayed but rather than simply "[1]" or "[1,2]" I get "(author?) [1]" and "(author?) [1,2]" in the pdf.
I have tried changing the bibliography options (both the settings of the bibliography and in the document settings) but these have had no effect and the poorly displayed citations also occur for other bst files selected.
Others have had the same problem:
http://www.latex-community.org/forum/vi ... 3F+#p48786 (there are other examples too),
but no-one to my searching has actually found a satisfactory solution and clearly stated what it is.
Is there anyone out there who has recovered from this problem, and knows how they did it?
LyX ⇒ Citations not displayed correctly
NEW: TikZ book now 40% off at Amazon.com for a short time.

Citations not displayed correctly
And still noone bothered to provide an example file (together with all necessary files for compilation and inspection)...tafi wrote:...
Others have had the same problem:
http://www.latex-community.org/forum/vi ... 3F+#p48786 (there are other examples too),
but no-one to my searching has actually found a satisfactory solution and clearly stated what it is.
...
Re: Citations not displayed correctly
Well I'm not shy.
Attached is all I need to make it happen.
In fact only one citation is all I need to make this problem occur.
Attached is all I need to make it happen.
In fact only one citation is all I need to make this problem occur.
- Attachments
-
- LyXCitationTest.zip
- zip archive of LyX file minimum bib source and resulting pdf output.
- (18.39 KiB) Downloaded 308 times
Re: Citations not displayed correctly
It seems that elsarticle-num.bst is no go. Try elsarticle-names-num.bst instead.
- Attachments
-
- test-I.pdf
- (50.2 KiB) Downloaded 361 times
-
- LyXCitationTest-I.zip
- LyX 2.0 or greater required.
- (19.05 KiB) Downloaded 325 times
Re: Citations not displayed correctly
To me it also sounds a bit funny to submit a source file to a journal with deliberately the wrong citation style. Doesn't sound like a way to make friends with the publisher. As I said above, the citation style doesn't appear to matter anyway.
I have now found the solution and it is down to a problem in LyX.
It relates to the (silly) default in LyX for specifying citations in the source as "Author [ID#]" rather than just [ID#], where "ID#" refers to the bibtex key.
In order to compile correctly the citation has to be present as just "[ID#]", but there appears to be no way to set this as the default citation insert. So instead all the citation inserts have to be reset.
It is not a big issue when you're just writing a paper, but I'm trying to get a thesis done as well; and for such a large document (much of which already has citations) this is a problem.
Thanks for your help
I have now found the solution and it is down to a problem in LyX.
It relates to the (silly) default in LyX for specifying citations in the source as "Author [ID#]" rather than just [ID#], where "ID#" refers to the bibtex key.
In order to compile correctly the citation has to be present as just "[ID#]", but there appears to be no way to set this as the default citation insert. So instead all the citation inserts have to be reset.
It is not a big issue when you're just writing a paper, but I'm trying to get a thesis done as well; and for such a large document (much of which already has citations) this is a problem.
Thanks for your help
Citations not displayed correctly
For things like this one, where it is expected for changes to occur, it is wise to define custom commands and use them instead of those provided by LyX (or LaTeX). So, e.g., you can define \mycite as
or something like that, and use it in ERT boxes to insert citations. So, if later something have to be changed, just change that command instead of all occurrences throughout the document.
However, in this case of yours, I wouldn't blame LyX: it does what it is expected to do, and do that pretty well, but it can't think. The user is the one who should pay attention if correct formatting is chosen
And the last but not least, if you want advanced features and greater flexibility, then you'll probably have to come down to LaTeX as well as to more powerful editors and sacrifice convenience which LyX provides.
Code: Select all
\newcommand{\mycite}[1]{\citep{#1}}
However, in this case of yours, I wouldn't blame LyX: it does what it is expected to do, and do that pretty well, but it can't think. The user is the one who should pay attention if correct formatting is chosen

And the last but not least, if you want advanced features and greater flexibility, then you'll probably have to come down to LaTeX as well as to more powerful editors and sacrifice convenience which LyX provides.
Re: Citations not displayed correctly
I had this exact problem and was able to fix it by going to Document -> Setting... -> Bibliography and changing the NatBib citation style to Numerical. My other documents seemed to default to numerical, but the elsevier template seemed to default to the Author-year style.