I've got some troubles with formatting the bicaption
package and would like to ask, if someone can point out some hints to solve it.
I guess it was too late yesterday, so first my dear apologies Axel!
Also sorry for not providing an MWE, which I included now:
\documentclass[12pt,halfparskip,BCOR0pt,DIV12]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[intlimits]{amsmath}
\usepackage[a4paper,left=2.5cm, right=2.5cm,top=2.5cm, bottom=2cm,headsep=0.865cm]{geometry}
\usepackage{graphicx}
\usepackage{bicaption}
\captionsetup[figure][bi]{labelfont=it, font=it,justification=raggedright, singlelinecheck=false, margin={0mm,0mm}}
\captionsetup[figure][bi-first]{name=Bild}
\captionsetup[figure][bi-second]{name=Fig.}
\numberwithin{figure}{section}
\begin{document}
\section{Exemplum}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
\begin{figure}[h]
\includegraphics[width=\textwidth]{sample.png}
\captionsetup{skip=0pt,}
\bicaption{Beispieltext}{Sample}
\label{fig:Q-pd}
\end{figure}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
\end{document}
I encountered two major problems and one open question:
-
the command referring to bi-first is not working, caption is still "Abbildung", why is that?
-
For the first cation "Abbildung" there is an indent, which I can only avoid with
ident=-6pt
at each bicaption within the Text, why is that and how can I remove indent for captions globally?
I tried usingraggedright
as set here, with no effect,Raggedright
with packageragged2e
causes unexpected error and is not working. -
Format should look like this, given offset (tab) between type and number and text, caption one aligned with caption two:
Bild x.xx:_{tab}_Text
Fig. x.xx:_{tab}_Text
How can I set a distance between figure number and caption, that first and second caption are aligned, but with an offset?
Thanks for any suggestion and also thank you Axel for coming up with this great package!
Best Answer
name=
does not work with bi-captions controlled bybabel
(yet). If you want to change the name globally, useinstead. If you want to change the name for bi-captions only, you (currently) need a helper construct as workaround like this:
But why does it work for the English caption? Because that caption language is not controlled by
babel
since you haven't given a second language to thebicaption
package, for example with\usepackage[lang=english]{bicaption}
or\captionsetup[bi-second]{lang=english}
.I just filled a ticket 1 and will fix this bug within the next weeks so the above workaround will not be necessary anymore.
Background:
name=Bild
will change the definition of\figurename
which will be used to label the caption, but later on thebicaption
package switches the language (usingbabel
) tongerman
for the first caption, and this will change the definition of\figurename
back toAbbildung
. So to make this work I need to add a special handling of the optionname=
for bi-captions to mybicaption
package, the argument needs to be stored and used after switching the language.2a. I cannot reproduce this here. Is your TeX distribution up-to-date? Could you add an image of the unwanted indention? This is what it looks like on my PC (TeXlive 2015, updated today):
If "Abbildung" (or "Bild") is indented this could be caused by spaces inserted when setting languages. Do you extend
\captionsngerman
within your document? If yes, mind the unwanted spaces! http://www.komascript.de/signifikanteLeerzeichen (I'm sorry for the German link, I'm not aware of an English counterpart.)2b. Changing
justification=raggedright
tojustification=RaggedRight
in your example document works fine here, too, what error message to you get?\DeclareCaptionFormat
which puts the label plus separator into a box of fixed width, for example:(6cm will be far to much, so you need to adjust this value to your own needs.)
1 https://sourceforge.net/p/latex-caption/tickets/38/