all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Create in Org a bilingual book with facing pages
@ 2022-09-27  9:09 Juan Manuel Macías
  2022-09-27 12:29 ` Ihor Radchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Juan Manuel Macías @ 2022-09-27  9:09 UTC (permalink / raw)
  To: orgmode

Hi all,

TL; DR:

The bilingual critical edition (ancient Greek/Spanish) of the letters of
Demosthenes and Aeschines has recently been published in Spain, a book
whose production and typesetting I have taken charge of, using Org and
Org-publish. Although I already have a long experience typesetting
bilingual editions of a certain complexity, especially for philological
use, I had never done it until now by centralizing the entire process in
Org-Mode. I have to say that it has been a very interesting experience,
so I leave here below a brief description of the process and some tips,
in case they can be useful to someone who wants to prepare from Org
bilingual texts with facing pages and certain complexity.

BTW, Here’s a sample of two pages from the book:

<https://i.imgur.com/XUOGEnf.png>

Long version:

First of all, for this kind of work you have to take into account an
inherent limitation of TeX: the compilation process in TeX is a
single-threaded process. That is, in TeX you cannot compile different
parts of a document, with different configurations (= different
preambles), at the same time. For example, you cannot have one
configuration for odd pages and another for even pages (original and
translation) and compile them in parallel and asynchronously. In Adobe
InDesign-style DTP programs you can load multiple page threads in
parallel, but these programs don’t have the typographic refinement of
TeX. And besides, I never use proprietary software ;-).

Therefore, to create a bilingual edition with facing pages, and for this
particular type of book where the odd pages (the text in Greek) is a
critical edition with a strong critical apparatus
(https://en.wikipedia.org/wiki/Critical_apparatus), it is necessary to
compile two separate documents and then synchronize them. The good news:
I have found that, thanks to Org, the process is much more streamlined
and controlled.

On the other hand, since in this book the content of the odd and even
pages is variable, the synchronization has been done per page, so that
the reader always obtains the same content on the odd and even page when
facing the open book. For the Greek document I used the reledmac LaTeX
package, which is the most mature LaTeX package for philological
critical editions, but I used it through my org-critical-edition package
(<https://gitlab.com/maciaschain/org-critical-edition>).

Once both PDFs are obtained and synchronized, they are loaded into the
master Org document using the pdfpages LaTeX package. Since it was
necessary to introduce in certain pages some commands specific to each
page, such as page styles, index entries or labels for references, and
to avoid having to load the pages one by one with pdfpages commands, I
wrote a function that obtains the number of pages of the synchronized
PDF (via mutool) and it does all that work. The function has three
arguments: the path to the synced PDF, the general page command, and a
list of page numbers with particular commands (these last two arguments
are optional). An example of use would be:

┌────
│ (inserta-pdfpages-bi "resultado.pdf" "\\thispagestyle{plain}" '((2 "\\label{some-label}"))) 
└────

The function is evaluated in the master document within a source block:

<https://i.imgur.com/yps6xRA.png>

To compile the two PDFs separately and get the PDF in sync, I also do it
from Org using a shell source block. So I have all PDFs always
synchronized up to date. The synchronized PDF is obtained with pdftk:

<https://i.imgur.com/qbSg2po.png>

The rest of the book, introduction, indices, etc. it is normally done
via Org publish. And the final compilation (the master document that
includes all sub-documents) is done asynchronously using latexmk.

And that’s it. The next challenge for this fall is going to be a
trilingual edition of the New Testament (Greek, Latin, Spanish). My idea
is to try to adapt to Org the use of the LaTeX package flowfram (an
attempt to create dynamic indesign-style text boxes in LaTeX, but
---because of TeX's limitations--- they would not be asynchronous
boxes). Then, each text in a language would go inside an org block.
We'll see how it turns out :-)

Best regards,

Juan Manuel

-- 
--
------------------------------------------------------
Juan Manuel Macías

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-10-05  8:02 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-27  9:09 Create in Org a bilingual book with facing pages Juan Manuel Macías
2022-09-27 12:29 ` Ihor Radchenko
2022-09-27 16:50   ` Juan Manuel Macías
2022-09-28  3:15     ` Ihor Radchenko
2022-09-28  7:50       ` Explicit page breaks (was: Create in Org a bilingual book with facing pages) Juan Manuel Macías
2022-09-29  3:13         ` Ihor Radchenko
2022-09-29  5:29           ` Explicit page breaks Juan Manuel Macías
2022-09-29  6:05             ` Max Nikulin
2022-09-29  6:21             ` Thomas S. Dye
2022-10-03  7:14             ` Ihor Radchenko
2022-10-04 20:24               ` Juan Manuel Macías
2022-10-05  7:59                 ` Ihor Radchenko
2022-09-27 16:34 ` Create in Org a bilingual book with facing pages Hendursaga
2022-09-28  6:14   ` Juan Manuel Macías
2022-09-28 14:14     ` Hendursaga
2022-09-28 15:14       ` Juan Manuel Macías
2022-09-28  7:14 ` Christian Moe

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.