PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : includegraphics innerhalb einer caption gibt fehler



Novgorod
05-02-2009, 02:43
hiho,

ich will in einer figure-umgebung neben dem "haupt-bild" weitere bilder per \includegraphics einfügen, und zwar innerhalb des caption-textes..
es handelt sich dabei um "icons", für die es keine vordefinierten latex-symbole gibt, ich hab sie also selbst gezeichnet (in schriftgröße) und als pdf ohne rand gespeichert und will sie im text einbinden..

so siehts etwa aus:



\begin{figure}[ht]
\centering
\includegraphics{hauptbild}
\caption{blablabla \includegraphics{bullet_1} bla \includegraphics{bullet_2} blabla.}
\label{fig:bla}
\end{figure}


prinzipiell funktioniert das auch, d.h. die mini-bildchen erscheinen so wie sie sollen im caption-text.. allerdings gibts beim compilen fehler:



! Argument of \@caption has an extra }.
<inserted text>
\par
l.84 ...blabla.}

I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
\@captype {\def \reserved@a *{\Gin@cliptrue \Gin@i }\reserved@a }\def \ETC.
! Paragraph ended before \@caption was complete.
<to be read again>
\par
l.84 ...blabla.}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.


das ganze steht im abschnitt wo offenbar die ganzen bilddateien geladen werden.. also ne klammer fehlt da definitiv nicht (weder beim \includegraphics noch im caption oder irgendwo sonst im figure) - außerdem verschwinden die fehler, wenn ich den \includegraphics-teil rausnehme und sonst nichts ändere..

sollte man es ignorieren, weil das ergebnis ja passt? find ich trotzdem irgendwie "unschön" :D

voss
05-02-2009, 08:15
\begin{figure}[ht]
\centering
\includegraphics{hauptbild}
\caption{blablabla \protect\includegraphics{bullet_1} bla \includegraphics{bullet_2} blabla.}
\label{fig:bla}
\end{figure}



wie bei \cite usw.

Herbert

Novgorod
05-02-2009, 16:09
ah ok, das wusst ich nicht ;)

vielen dank!