2

I have been working on a document that is to be written in two languages. English and Latin. Both English text and Latin text say the same thing and occupy the same amount of pages.

However, I want to compile it as "two for one" sort-of-speak in a way that the English text is printed in the odd pages with Indoarabic counting-numbers, English labelings for Chapters, English names for "bibliography", etc., while in the even page is to be printed the Latin version. That means that in the even-pages I would like to have the counting in roman numbers, the labelings for "Capitulum" in Latin, etc. Now, I have both formats ready. One format compiles with fancy style in Indoarabic and English names, labels, etc., and the other does the same but in Roman numbers and Latin Language. That is done. What I cannot find how to do is to tell latex to use the Indoarabic format for the Odd pages and read the English text while in the Even page is to be used the Latin format with the Latin page.

I was searching in this community and I found many good examples of formatting even and odd pages but nothing resembles my problem. Maybe someone here can point me to the right place to check.

Thank you in advance.

Bpi
  • 188
  • 6
  • Maybe an easy option is to make two separate pdfs with LaTeX and merge them together with alternating pages using tools such as pdftk. – Marijn Jan 16 '21 at 17:31
  • Take a look at the changepage package and its \checkoddpage macro. – Peter Wilson Jan 16 '21 at 17:50
  • Thank you @Marijn, I will check this option – Bpi Jan 16 '21 at 18:18
  • Thank you also @PeterWilson, I will check this option too. – Bpi Jan 16 '21 at 18:19
  • Do you want the page numbering to be continuous throughout the document or the page number of a Latin page to be the same number as the corresponding English page? In the first case a 100 page document will have page numbers 1-100 and in the second case two sets of page numbers 1-50. – Peter Wilson Jan 17 '21 at 17:57
  • @PeterWilson That is a good pointing out. Yes, i want the document latin's part to have continuous counting in Roman numbers. Therefore, from 1 to 50 in Roman. Likewise, I would like to have the English part to have continuous counting in Indoarabic, from 1 to 50 in indoarabic. – Bpi Jan 18 '21 at 08:22

1 Answers1

1

You can define different page styles for odd and even pages with fancyhdr.

\documentclass[latin,english]{book}
\usepackage{babel}
\usepackage{Libertinus}
\usepackage{fancyhdr}
\usepackage{microtype}

\pagestyle{fancy} \fancyhead[L]{\textsc{Cicero}} \fancyhead[RE]{\textit{On the Ends of Good and Evil Things}} \fancyhead[RO]{\textit{\foreignlanguage{latin}{De Finibus Bonorum et Malorum}}} \fancyfoot[CE]{\arabic{page}} \fancyfoot[CO]{\roman{page}}

\title{\textsc{De Finibus Bonorum et Malorum}} \author{Cicero} \date{}

\begin{document} \maketitle

But I must explain to you how all this mistaken idea of reprobating pleasure and extolling pain arose. To do so, I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone \textbf{who loves or pursues or desires to obtain pain of itself, because it is pain,} but occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?] On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammeled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains. \clearpage

\begin{otherlanguage}{latin} Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, \textbf{qui do lorem ipsum, quia dolor sit amet} consectetur adipisci[ng] velit, sed quia non numquam [do] eius modi tempora inci[di]dunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum[d] exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? [D]Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus, qui blanditiis praesentium voluptatum deleniti atque corrupti, quos dolores et quas molestias excepturi sint, obcaecati cupiditate non provident, similique sunt in culpa, qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio, cumque nihil impedit, quo minus id, quod maxime placeat, facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet, ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. \end{otherlanguage}

\end{document}

Since this will go wrong as soon as the page-breaking algorithm doesn’t do what you expect, you might want to typeset each page inside an environment that prevents page breaking, such as minipage.

Within a \begin{otherlanguage} environment, babel will translate captions, such as “Chapter,” for you.

If you cannot strictly alternate, you can define your own englishpage and latinpage environments that change the language, and also override \fancyhead and fancyfoot.

\documentclass[latin,english]{book}
\usepackage{babel}
\usepackage{Libertinus}
\usepackage{fancyhdr}
\usepackage{microtype}

\pagestyle{fancy} \fancyhead[L]{\textsc{Cicero}} \fancyhead[R]{\textit{On the Ends of Good and Evil Things}} \fancyfoot[C]{\arabic{page}} \title{\textsc{De Finibus Bonorum et Malorum}}

\author{Cicero} \date{}

\newenvironment{englishpage}% {\selectlanguage{english}% \fancyhead[R]{\textit{On the Ends of Good and Evil Things}}% \fancyfoot[C]{\arabic{page}}} {\clearpage}

\newenvironment{latinpage}% {\selectlanguage{latin}% \fancyhead[R]{\textit{De Finibus Bonorum et Malorum}}% \fancyfoot[C]{\Roman{page}}} {\clearpage}

\begin{document} \maketitle \begin{englishpage} But I must explain to you how all this mistaken idea of reprobating pleasure and extolling pain arose. To do so, I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone \textbf{who loves or pursues or desires to obtain pain of itself, because it is pain,} but occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?] On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammeled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains. \end{englishpage}

\begin{latinpage} Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, \textbf{qui do lorem ipsum, quia dolor sit amet} consectetur adipisci[ng] velit, sed quia non numquam [do] eius modi tempora inci[di]dunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum[d] exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? [D]Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus, qui blanditiis praesentium voluptatum deleniti atque corrupti, quos dolores et quas molestias excepturi sint, obcaecati cupiditate non provident, similique sunt in culpa, qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio, cumque nihil impedit, quo minus id, quod maxime placeat, facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet, ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. \end{latinpage}

\end{document}

Davislor
  • 44,045
  • Dear @Davislor Thank you for your answer. It does help a lot. I will try ti because I want to check whether the page labering is continuous in each corresponding settings. As well as for their both corresponding indices and bibliographies. Thank you. Iwill be checking this advice deeply. – Bpi Jan 18 '21 at 08:24