1

My system is XeTeX Version 3.14159265-2.6-0.99992 (TeX Live 2015/W32TeX).

I am typesetting a facing page bilingual edition of the Bhagavad-Gita. Left pages would be original Sanskrit text followed by Hindi translation, right pages would be transliterated text in IAST followed by English translation.

For the facing page feature, I am using reledmac and reledpar for the facing page feature.

I also have to use the longtable package for the original verses and their transliteration. This is because of two reasons: (1) the traditional alignment of verses in Sanskrit has the text justified but the end of line markers and numbers left aligned, so I need a tabular environment with two columns (2) Sometimes multiple verses form one sentence (e.g. verses 4, 5, and 6 of first chapter having six lines in all) are they have to be typeset together, so pagebreaks have to be allowed in the tabular environment. Also as the original text is large (700 verses) with the width of typeset lines varying widely, I need longtables with dynamic widths. For this I use textwidth and calc to dynamically compute widths.

So with that, this is how I proceeded. A working MWE is below

\documentclass[10pt,twoside]{book}
\usepackage[dvips=false,pdftex=false,vtex=false,top=2.25cm,left=16.5mm,bottom=0.75in,right=15mm,paperwidth=138mm,paperheight=216mm]{geometry}
\usepackage{calc}
\usepackage{array}
\usepackage{longtable,ltabptch}
\usepackage{setspace}
\setlength{\LTpre}{0pt}
\setlength{\LTpost}{0pt}
\usepackage{polyglossia}
\setmainlanguage{hindi}
\setotherlanguage{english}
\setmainfont[Script=Devanagari,AutoFakeBold=2.0]{Siddhanta}
\newfontfamily\englishfont{Charis SIL}
\usepackage[series={},nocritical,noend,noeledsec,nofamiliar,noledgroup]{reledmac}
\usepackage{reledpar}
\usepackage[pdfpagelayout=TwoPageRight]{hyperref}
\begin{document}
\newlength{\mylenone}
\newlength{\mylentwo}
\newlength{\mylenthree}
\mainmatter
\doublespacing
\begin{pages}
    \begin{Leftside}
        \beginnumbering
            \pstart
            LATEX-NEEDS-SOME-TEXT-HERE
            {\bfseries
            \settowidth{\mylenone}{धर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः}
            \settowidth{\mylentwo}{मामकाः पाण्डवाश्चैव किमकुर्वत सञ्जय}
            \setlength{\mylenone}{\maxof{\mylenone}{\mylentwo}}
            \setlength{\mylentwo}{\baselineskip}
            \setlength{\mylenone}{\mylenone + 1pt}
            \setlength{\mylenthree}{(\textwidth - \mylenone)*\real{0.5}}
            \settowidth{\mylentwo}{धृतराष्ट्र उवाच}
            \setlength{\mylentwo}{\mylenthree + (\mylenone - \mylentwo)*\real{0.5}}
            \begin{longtable}[l]{@{\hspace*{\mylenthree}}>{\setlength\parfillskip{0pt}}p{\mylenone}@{}@{}l@{}}
            \multicolumn{1}{l}{\hspace*{\mylentwo}धृतराष्ट्र उवाच} \\ \nopagebreak
            धर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः & ।\\ \nopagebreak
            मामकाः पाण्डवाश्चैव किमकुर्वत सञ्जय & ॥ १ ॥ \\
            \end{longtable}
            }
            \pend
            \pstart
            \begin{sloppypar}\justifying\hyphenrules{nohyphenation}
            \noindent धृतराष्ट्र बोले—हे संजय! धर्मभूमि कुरुक्षेत्रमें एकत्रित, युद्धकी इच्छावाले मेरे और पाण्डुके पुत्रोंने क्या किया?॥ १ ॥
            \end{sloppypar}
            \pend
        \endnumbering
    \end{Leftside}
    \begin{Rightside}
        \beginnumbering
            \pstart
            LATEX-NEEDS-SOME-TEXT-HERE
            {\englishfont\bfseries
            \settowidth{\mylenone}{dharmakṣetre kurukṣetre samavetā yuyutsavaḥ}
            \settowidth{\mylentwo}{māmakāḥ pāṇḍavāścaiva kimakurvata sañjaya}
            \setlength{\mylenone}{\maxof{\mylenone}{\mylentwo}}
            \setlength{\mylentwo}{\baselineskip}
            \setlength{\mylenone}{\mylenone + 1pt}
            \setlength{\mylenthree}{(\textwidth - \mylenone)*\real{0.5}}
            \settowidth{\mylentwo}{dhṛtarāṣṭra uvāca}
            \setlength{\mylentwo}{\mylenthree + (\mylenone - \mylentwo)*\real{0.5}}
            \begin{longtable}[l]{@{\hspace*{\mylenthree}}>{\setlength\parfillskip{0pt}}p{\mylenone}@{}@{}l@{}}
            \multicolumn{1}{l}{\hspace*{\mylentwo}dhṛtarāṣṭra uvāca} \\ \nopagebreak
            dharmakṣetre kurukṣetre samavetā yuyutsavaḥ & \\ \nopagebreak
            māmakāḥ pāṇḍavāścaiva kimakurvata sañjaya & \ (1) \\
            \end{longtable}
            }
            \pend
            \pstart
            \begin{sloppypar}\justifying\hyphenrules{nohyphenation}
            \noindent {\englishfont Dhṛtarāṣṭra said: Sañjaya, gathered on the holy land of Kurukṣetra, eager to fight, what did my sons and the sons of Pāṇḍu do?(1)}
            \end{sloppypar}
            \pend
        \endnumbering
    \end{Rightside}
\end{pages} 
\Pages

    {\bfseries
\settowidth{\mylenone}{धर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः}
\settowidth{\mylentwo}{मामकाः पाण्डवाश्चैव किमकुर्वत सञ्जय}
\setlength{\mylenone}{\maxof{\mylenone}{\mylentwo}}
\setlength{\mylentwo}{\baselineskip}
\setlength{\mylenone}{\mylenone + 1pt}
\setlength{\mylenthree}{(\textwidth - \mylenone)*\real{0.5}}
\settowidth{\mylentwo}{धृतराष्ट्र उवाच}
\setlength{\mylentwo}{\mylenthree + (\mylenone - \mylentwo)*\real{0.5}}
\begin{longtable}[l]{@{\hspace*{\mylenthree}}>{\setlength\parfillskip{0pt}}p{\mylenone}@{}@{}l@{}}
\multicolumn{1}{l}{\hspace*{\mylentwo}धृतराष्ट्र उवाच} \\ \nopagebreak
धर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः & ।\\ \nopagebreak
मामकाः पाण्डवाश्चैव किमकुर्वत सञ्जय & ॥ १ ॥ \\
\end{longtable}
}
\begin{sloppypar}\justifying\hyphenrules{nohyphenation}
\noindent धृतराष्ट्र बोले—हे संजय! धर्मभूमि कुरुक्षेत्रमें एकत्रित, युद्धकी इच्छावाले मेरे और पाण्डुके पुत्रोंने क्या किया?॥ १ ॥
\end{sloppypar}
{\englishfont\bfseries
\settowidth{\mylenone}{dharmakṣetre kurukṣetre samavetā yuyutsavaḥ}
\settowidth{\mylentwo}{māmakāḥ pāṇḍavāścaiva kimakurvata sañjaya}
\setlength{\mylenone}{\maxof{\mylenone}{\mylentwo}}
\setlength{\mylentwo}{\baselineskip}
\setlength{\mylenone}{\mylenone + 1pt}
\setlength{\mylenthree}{(\textwidth - \mylenone)*\real{0.5}}
\settowidth{\mylentwo}{dhṛtarāṣṭra uvāca}
\setlength{\mylentwo}{\mylenthree + (\mylenone - \mylentwo)*\real{0.5}}
\begin{longtable}[l]{@{\hspace*{\mylenthree}}>{\setlength\parfillskip{0pt}}p{\mylenone}@{}@{}l@{}}
\multicolumn{1}{l}{\hspace*{\mylentwo}dhṛtarāṣṭra uvāca} \\ \nopagebreak
dharmakṣetre kurukṣetre samavetā yuyutsavaḥ & \\ \nopagebreak
māmakāḥ pāṇḍavāścaiva kimakurvata sañjaya & \ (1) \\
\end{longtable}
}
\begin{sloppypar}\justifying\hyphenrules{nohyphenation}
\noindent {\englishfont Dhṛtarāṣṭra said: Sañjaya, gathered on the holy land of Kurukṣetra, eager to fight, what did my sons and the sons of Pāṇḍu do?(1)}
\end{sloppypar}

\end{document}

The output pages 2 and 3 are below

enter image description here

Output page 4 is below

enter image description here

The problems

  1. If I remove the dummy text (delete the text LATEX-NEEDS-SOME-TEXT-HERE), the document does not compile and I get the error ! You can't use '\lastbox' in vertical mode.
  2. There is extra space between the second and third lines of the longtables on pages 2 and 3

None of these problems exist outside the pages environment, e.g. the typesetting is perfect on page 4. There is no dummy text needed, and there is no extra space.

  • I am afraid using longtable with reledmac will be not possible since a long long long time. I have no time to solve this complex question. – Maïeul Jan 9 '16 at 9:09
  • please open an issue on github webpage, but I really can tell you when I will have time to look on it. – Maïeul Jan 9 '16 at 9:42
  • I don't understand why you write "so I need a tabular environment with two columns". Or just I don't understand your sentence "the traditional alignment of verses in Sanskrit has the text justified but the end of line markers and numbers left aligned" (but I don't read well English). If you could explain it to me, I could find maybe a way for you without tabular. – Maïeul Jan 9 '16 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.