TransWikia.com

Is it possible to have two listoffigures with bicaption?

TeX - LaTeX Asked by Ice0cean on March 13, 2021

Now I’m using Chinese to write a paper. It is required that the caption of the figures should be written in both Chinese and English. I found that this can be realized using bicaption package. However, if bicaption is used, the command listoffigures produces only one list of figures, in which both the English caption and Chinese caption are included. I want to make them separate, namely a list only contains Chinese caption, and a list only contains English caption. The following is my attempt.

documentclass{ctexbook}
usepackage{caption,bicaption,graphicx}
captionsetup[figure][bi-second]{name=Figure}
usepackage{mwe}

begin{document}
frontmatter
listoffigures
mainmatter
blindtext
begin{figure}[!htbp]
    centering
    includegraphics{example-image.pdf}
    bicaption{第一个图}{first figure}
    label{fig:figure1}
end{figure}

blindtext
begin{figure}[!htbp]
    centering
    includegraphics{example-image.pdf}
    bicaption{第二个图}{second figure}
    label{fig:figure2}
end{figure}
end{document}

In the above code, I use ctexbook class file to produce the Chinese document. I think the possible workaround is to redefine the command bicaption so that the English caption can be written into a different file such as enlof, rather than mixing with Chinese caption in lof file. I’m new to LaTeX and I don’t know how to implement it 🙁

One Answer

It seems to work like documented in section 5 "Customizing lists" of the bicaption package documentation, i.e. using the option listtype+=... for this purpose:

documentclass{ctexbook}
usepackage{caption,bicaption,graphicx}
captionsetup[figure][bi-second]{name=Figure}
usepackage{mwe}

% Use the bicaption package with list type "figureEng" for the 2nd language
captionsetup[bi-second]{listtype+=Eng}
% Define type "figureEng" and listoffigureEng
usepackage{newfloat}
DeclareFloatingEnvironment[fileext=lof2]{figureEng}[Figure][List of Figures]

begin{document}
frontmatter
listoffigures
listoffigureEng
mainmatter
blindtext
begin{figure}[!htbp]
    centering
    includegraphics{example-image.pdf}
    bicaption{第一个图}{first figure}
    label{fig:figure1}
end{figure}

blindtext
begin{figure}[!htbp]
    centering
    includegraphics{example-image.pdf}
    bicaption{第二个图}{second figure}
    label{fig:figure2}
end{figure}
end{document}

Correct answer by P.M. on March 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP