\cite in \caption

1,844 views
Skip to first unread message

Adelheid

unread,
Feb 25, 2010, 11:20:40 AM2/25/10
to tufte-latex
Hi all,

I'm typesetting my diploma thesis with tufte-latex and I really like
it ;)
But there are some problems left, one of them is the following:

I have some pictures where I have to put a reference in the caption
(\cite). So, normally \caption{... \protect\cite{xxx}} helps, but not
with tufte-latex;

This message is given in the error log:
-------------------
! Missing number, treated as zero.
<to be read again>
]
l.10 \end{figure}

?
-------------------
the message can be skipped, but the result is a caption (as usual in
the margin) with \it-typesetted reference just after the caption-text
AND a rule with a small "[a" under it.

Here is a minimal example:
-----------------------
\documentclass{tufte-book}
\usepackage[latin1]{inputenc}
\usepackage[german]{babel}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\chapter{test}
\lipsum[2]
\begin{figure}
\includegraphics{testimage}
\caption{testcaption \protect\cite{may001}}
\end{figure}
\lipsum[2]
\bibliography{mybib}{}
\bibliographystyle{plain}
\end{document}
-----------------------

Can anyone help me? A workaround would be fine! :)

Thanks a lot,
Adelheid

Kevin Godby

unread,
Feb 27, 2010, 10:55:26 AM2/27/10
to tufte...@googlegroups.com
Hello, Adelheid.

On Thu, Feb 25, 2010 at 10:20 AM, Adelheid <adelhe...@googlemail.com> wrote:
> Hi all,
>
> I'm typesetting my diploma thesis with tufte-latex and I really like
> it ;)
> But there are some problems left, one of them is the following:
>
> I have some pictures where I have to put a reference in the caption
> (\cite). So, normally \caption{... \protect\cite{xxx}} helps, but not
> with tufte-latex;

I apologize for the late reply; I've been busy with other projects.

At the moment, the \cite command doesn't work inside the \caption
command. This weekend, I will see if I can write some code to handle
this case.

Thanks for reporting this shortcoming!

--Kevin

Adelheid Grob

unread,
Feb 27, 2010, 11:29:42 AM2/27/10
to tufte-latex
Hi Kevin,


On Feb 27, 4:55 pm, Kevin Godby <god...@gmail.com> wrote:
> I apologize for the late reply; I've been busy with other projects.

... no need to apologize - thanks for the reply! :)

> At the moment, the \cite command doesn't work inside the \caption
> command.  This weekend, I will see if I can write some code to handle
> this case.

thanks a lot - would be nice, if you could find the time... :)

greetings, Adelheid

John Williams

unread,
Mar 8, 2010, 9:49:33 PM3/8/10
to tufte-latex
On Feb 28, 5:29 am, Adelheid Grob <adelheid.g...@googlemail.com>
wrote:
A thought to consider: the \cite probably should not be in the
argument to \caption. The caption may be typeset in special ways that
are appropriate to captions, but not to citations. You can always put
the citation into the enclosing figure or table environment, i.e.

\begin{figure}
\includegraphics{...}
\label{...}
\caption{...}
Source: \cite{...}
Blah blah blah
\end{figure}

Oleg Lobachev

unread,
Mar 9, 2010, 6:05:42 AM3/9/10
to tufte-latex
Hello Adelheid,

On Feb 25, 5:20 pm, Adelheid <adelheid.g...@googlemail.com> wrote:
> I have some pictures where I have to put a reference in the caption
> (\cite). So, normally \caption{... \protect\cite{xxx}} helps, but not
> with tufte-latex;

> Can anyone help me? A workaround would be fine! :)

You can use \citep instead of \cite. However this will produce the
standard style reference. This works for sure.

Another solution would be to fake the behaviour of TL's \cite
manually. If you cite the source somewhere else in the text:

Main text with citing\footnote{\bibitem{key}\label{mycite}} goes on.
\begin{figure}
image
\caption{This is the caption\footnotemark{\ref{mycite}}}

Greetings,
Oleg

Adelheid Grob

unread,
Apr 5, 2010, 10:48:01 AM4/5/10
to tufte-latex
Hello,

thanks for the two tips :) I'll use it the next time, I'm typesetting
something with TL... as far as my diploma thesis is concerned I now
switched due to several reasons to standard classes...

What I think may be interesting for the developers and the user
community: At the DANTE spring meeting in Dortmund, Germany I gave a
talk about my experiences with TL. A lot of the listeners found the
idea really great - especially those who had never before heard of
TL.

But I remember two questions that came up:
1. if you have the same reference (\cite{}) twice (or more often) on
the same page, it appears two (or more) times in the margin - this is
not really nice... perhaps you can develop something that can deal
with this effect (you can't always write a text with not having the
same source at two very close places in the text)
2. the things put in the margin don't break at the end of the margin
(as far as my experience went). That means if I have very much stuff
in the margin, it would be nice (if there is no place left) if the too-
much-material would be typeset in the margin of the next page.

However, the guys there really apreciated your work and liked it ;)

Greetings from Germany and Happy Easter,
Adelheid

Bil Kleb

unread,
Apr 6, 2010, 9:52:10 PM4/6/10
to tufte...@googlegroups.com
Hi,

On Apr 5, 2010, at 10:48 AM, Adelheid Grob wrote:
>
> But I remember two questions that came up:
> 1. if you have the same reference (\cite{}) twice (or more often) on
> the same page, it appears two (or more) times in the margin - this is
> not really nice... perhaps you can develop something that can deal
> with this effect (you can't always write a text with not having the
> same source at two very close places in the text)
> 2. the things put in the margin don't break at the end of the margin
> (as far as my experience went). That means if I have very much stuff
> in the margin, it would be nice (if there is no place left) if the too-
> much-material would be typeset in the margin of the next page.

I've run into both of these and over time have found them to be
signs that I was addicted to citations and marginal notes. They
are both a burden and a blessing for the reader.

I've found ways to reduce my citations to only the core references
and not just because it is so easy to include them from a bibtex database.

Similarly with margin notes: I now recall Strunk's 17th composition
principle, "omit needless words!" whenever I start typing \sidenote.

Regards,
--
Bil Kleb


Reply all
Reply to author
Forward
0 new messages