2

I need to insert two captions (in polish and exactly the same translated into english) under each of the figures and above each of the tables in my document.

Once captions were defined I would like to have control whether only one or both captions will be displayed in the whole document through boolean variable.

What is the most elegant / smart way to do that?


EDIT

According to suggestions in comments, I used bicaption to define two captions.two captions

\usepackage{polski}
 \usepackage[english, polish]{babel} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[lang=english]{bicaption}

\begin{figure}[H]
    \includegraphics[width=0.5\textwidth]{Einrad}

    \bicaption{Polish caption here with special letters: ĄĆŹŚÓŁ}{English caption just below}

    \label{Fig:FIgBicycle}
\end{figure}

However, I don't like:

  • that I needed to use babel to have properly labelled captions ("Rysunek" for polish and "Figure" for english), because in my document I'm already using many packages and I wish to avoid potential conflicts,
  • the big space between two captions,
  • that I can't see an option to control whether only the first, second or both captions were displayed

EDIT 2

Minimal Working Example:

%\documentclass[review,authoryear]{elsarticle}
\documentclass[oneside,12pt]{mwbk}

\usepackage{polski}
 \usepackage[english, polish]{babel} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[lang=english]{bicaption}

\usepackage{graphicx,float,multirow}
\graphicspath{ {figures/} }

\usepackage[caption = false]{subfig}
\usepackage{lineno,hyperref,amsmath}
\usepackage[normalem]{ulem}

\linespread{2}

\begin{document}

\linenumbers

\section{Some text}

\subsection{Some subsection}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate nisi dolor, vitae eleifend sem vehicula a. Nulla libero mi, scelerisque et dapibus at.

\begin{figure}[H]
    \includegraphics[width=0.5\textwidth]{Einrad}

    \bicaption{Polish caption here with special letters: ĄĆŹŚÓŁ}{English caption just below}

    \label{Fig:FIgBicycle}
\end{figure}


\begin{table}[H]
    \centering
    \bicaption{Polish caption here with special letters: ĄĆŹŚÓŁ}{English caption just below}
    \label{my-label}
    \begin{tabular}{|l|l|}
        \hline
        1st col   & 2nd col \\ \hline
        some text & ---     \\ \hline
    \end{tabular}
\end{table}


\end{document}
matandked
  • 619
  • 2
    Take a look at the bicaption package. – Arzigoglu May 17 '17 at 06:35
  • which document class you use? memoir have this capability. – Zarko May 17 '17 at 08:26
  • In document that I used to insert an example figure with caption here, I used elsarticle class, but in document within I need to use multiple captions, I use mwbk document class. – matandked May 17 '17 at 11:21
  • Well, yes, with \linespread{2} you introduce a large space between any two lines - that is just what you see between the two captions. Can you elaborate on what you want to achieve with \linespread{2} such that we can think of a solution for both wishes? – Tiuri May 18 '17 at 07:14
  • OK, I think that it might be actually expected by the publisher (if they need such spread between all lines). So, please ignore it, but, I just noticed that bicaptions provides warnings when I change the documentclass to mbwk (which is the class that I will use in my document that needs two captions): \documentclass[oneside,12pt]{mwbk} – matandked May 18 '17 at 07:19
  • Warning: Unsupported document class (or package) detected, usage of the caption package is not recommended. See the caption package documentation for explanation. – matandked May 18 '17 at 07:25
  • Regarding the requested boolean switch: \captionsetup{bi-lang=first} will only typeset the 1st language, and \captionsetup{bi-lang=second} will only typeset the 2nd language of the caption headings. –  Sep 20 '18 at 20:49

0 Answers0