LyXcite in picture caption

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Daniel
Posts: 2
Joined: Fri Jun 04, 2010 10:26 am

cite in picture caption

Post by Daniel »

Hi,

actually i write my Bachelor-Thesis in Lyx and need to insert citations into a figures caption. As soon as i try to compile my document with pdflatex i'll get this error message:
Error:
TeX capacity exceeded, sorry [input stack size=5000]

Description:
.....\citealt[20]{XXXXX2010}}
If you really absolutely need mor capacity you can ask a wizard to enlarge me
Therefore my question is how to have
1. a pictures caption with a working reference,
2. which is not shown in list of figures at the end of the document?

Thanks in advance

Daniel

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Daniel
Posts: 2
Joined: Fri Jun 04, 2010 10:26 am

Re: cite in picture caption

Post by Daniel »

Found out the solution, for all who need to insert citation into caption of tables, figures etc:

You need to insert a latex tag with \protect before inserting a reference in a caption. so you could compile your document without any problems
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

cite in picture caption

Post by localghost »

In LaTeX I would use the short form for the caption.

Code: Select all

\caption[Caption for list entry]{Caption with citation \cite{key}}
But I have no idea how to do that in LyX.


Best regards and welcome to the board
Thorsten
llewellyn
Posts: 17
Joined: Mon Feb 04, 2008 8:20 pm

Re: cite in picture caption

Post by llewellyn »

So many users on this site seem unaware of the abiity to insert what LYX calls an ERT in your document. At top of screen select INSERT which gives a drop menu. on that drop menu is TEX. Select TEx and you have a box appear where your cursor is for putting the latex code in. Click in the box to put your cursor there and type your Latex or tex code. When your code is in the box click any point outside it and the box shrinks to ERT and you can see your text without the latex being visible etc. Click on the ERT and it expands so you can change it if you need. Difficulty sometimes is deciding just where to insert the ERT to get desired effect.
Lyx allows you to cut and paste those ERT boxes and move them about even duplicate them at will.
kllim
Posts: 3
Joined: Tue Oct 05, 2010 8:33 am

cite in picture caption

Post by kllim »

Daniel wrote:Found out the solution, for all who need to insert citation into caption of tables, figures etc:

You need to insert a latex tag with \protect before inserting a reference in a caption. so you could compile your document without any problems
Hi. Can you explain more on this?
I did type in \protect{} But I can't insert citation inside the bracket. The main problem is that the citation number is appearing in list of figures.
drjrmnz
Posts: 1
Joined: Thu Mar 03, 2016 12:00 pm

cite in picture caption

Post by drjrmnz »

For either figure or picture caption in LYX highlight and delete the automatically generated figure box in the float and insert a TeX code box (Ctrl + l) with the following:

\caption[Text for table of figures] {Text for graphic\citep[leading text eg source:][]{bib ref eg jones2016}}
Post Reply