双语书籍的章节定制

双语书籍的章节定制

我正在格式化一本双语书籍,其中的语言可能因章节而异。在英语章节中,我想\figurename全局更改每个图形环境,这样我就不需要将每个图形环境都放入\renewcommand{\figurename}{Fig.}其中。我该怎么做?

这是我的 MWE(使用编译器:XeLaTeX,TeX Live:2022):

\documentclass[11pt,oneside]{book}
% \usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{float}
% \usepackage[utf8]{inputenc}

\usepackage[banglamainfont=Kalpurush, 
            banglattfont=Kalpurush
           ]{latexbangla}  

\setdefaultlanguage[numerals=Bengali, 
                    changecounternumbering=false
                   ]{bengali}

\setotherlanguage{english}
\setcounter{secnumdepth}{5}

\title{Per-chapter customization (bilingual book)}

\usepackage[a4paper]{geometry}

\usepackage[backend=biber,style=authoryear,natbib=true]{biblatex}
% \addbibresource{sample.bib}


\begin{document}

\tableofcontents

%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Bengali Chapter}

\section{Section Heading}
     \begin{figure}[H]
         \begin{center}
             \includegraphics[width=0.5\textwidth]{example-image} 
             \caption{১ম চ্যাপ্টারের চিত্র}
         \end{center}
     \end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{English Chapter}
% \begin{refsection}
\section{Section Heading}
     \begin{figure}[H]
        \renewcommand{\figurename}{Fig.} % I want to make all figure names in English in this chapter
         \begin{center}
             \includegraphics[width=0.5\textwidth]{example-image} 
             \caption{Image in 2nd chapter} 
         \end{center}
     \end{figure}
% Here's another citation! \citep{lshort}

% \printbibliography[heading=subbibintoc,title={References}]
% \end{refsection}

\end{document}

相关内容