0

I am looking to typeset a classical Persian poem in a classicthesis-styled document which is otherwise in German or English.

Based on this question I tried this:

% article example for classicthesis.sty
\documentclass[10pt,a4paper]{article} % KOMA-Script article scrartcl
\usepackage[LAE,T1]{fontenc}
\usepackage{lipsum}
\usepackage{url}
\usepackage[farsi,ngerman]{babel}
\usepackage[nochapters]{classicthesis} % nochapters

\begin{document} \pagestyle{plain} \title{\rmfamily\normalfont\spacedallcaps{the title}} \author{\spacedlowsmallcaps{My Name}} \date{} % no date

\maketitle

\begin{abstract}
    \noindent\lipsum[1] Just a test.\footnote{This is a footnote.}
\end{abstract}

\tableofcontents


\clearpage
    {\selectlanguage{farsi}

        \begin{paracol}{2}
        \poemtitle{دست برداشتن به مناجات به دستیاری ارباب حاجات}
        \switchcolumn
        \poemtitle{}
        \switchcolumn
        \begin{verse}
            خداوند ز هستی ساده بودیم\\
            نخست از نیست ما را هست کردی\\
            ز ضعف ناتوانایی رهاندی\\
            فرستادی به ما روشن کتابی\\
            میان نیک و بد تخلیط کردیم\\
            ره فرمودنیها کم سپردیم\\
            تو نگذشتی ز دستور عنایت\\
            بر آن نور از تو گیرم پوششی نیست\\
            ز ناکوشیدن خود در خروشیم\\
            چو دانا همچو نادان گشته غرق است\\
            دستانهای نفس ناخوش آهنگ \\
            در آن تنگی که ما باشیم و آهی\\
            ازان ره خوان سوی درگاه ما را
        \end{verse}
        \switchcolumn
        \begin{verse}
            ز بیم نیستی آزاده بودیم\\
            به قید آب و گل پابست کردی\\
            ز نادانی به دانایی رساندی\\
            به امر و نهی فرمودی خطابی\\
            گهی افراط و گه تفریط کردیم\\
            به نفرمودنیها پا فشردیم\\
            نپوشیدی ز ما نور هدایت\\
            چه حاصل زان چو از ما کوششی نیست\\
            بده توفیق کوشش تا بکوشیم\\
            ز دانش تا به نادانی چه فرق است\\
            ز   مکن بر ما رهِ حسن عمل تنگ\\
            ز رحمت سوی ما بگشای راهی\\  
            به ایمان بر برون همراه ما را
        \end{verse}
        \switchcolumn
        \end{paracol}


    }

\subsection{A Subsection}

\section{A Section}
\lipsum[1]

% bib stuff
\nocite{*}
\addtocontents{toc}{\protect\vspace{\beforebibskip}}
\addcontentsline{toc}{section}{\refname}
\bibliographystyle{plain}
\bibliography{../Bibliography}

\end{document}

Unfortunately, paracol does not seem to work properly in the RTL environment. The two columns don't appear next to each other as I was hoping, but rather like this: poem in its current form I am aiming for something that roughly looks like this: poem typeset in Microsoft Word

This is a problem I will face over and over again, so an elegant solution would be favourable. The general scheme is part of the content in two columns and part in one (not necessarily the heading), like so. For now I am seeking a solution to have the poem in two columns.

Floris
  • 89
  • 1
    Hi, can you please line out a bit more in your question (via edit) what you mean by "paracol does not seem to work properly in the RTL environment."? Perhaps you can add a screenshot, e.g. as-is vs. as-wanted? Thanks – MS-SPO Apr 14 '22 at 16:09
  • 1
    @MS-SPO added another screenshot. Hope this clarifies my issue. – Floris Apr 14 '22 at 19:03

2 Answers2

3

The elegant way would be to use bidipoem package and traditionalpoem or modernpoem environments (and preferably in conjunction with XePersian).

This is a simple XePersian example:

\documentclass[10pt,a4paper]{article} % 
\usepackage[nochapters]{classicthesis} % 
\usepackage{bidipoem}
\usepackage{xepersian}
\settextfont{XB Niloofar.ttf}
\begin{document}
\setLTR
\pagestyle{plain}
\begin{persian}
دست برداشتن به مناجات به دستیاری ارباب حاجات
\begin{traditionalpoem}
خداوند ز هستی ساده بودیم&
نخست از نیست ما را هست کردی\\
ز ضعف ناتوانایی رهاندی&
فرستادی به ما روشن کتابی\\
میان نیک و بد تخلیط کردیم&
ره فرمودنیها کم سپردیم\\
تو نگذشتی ز دستور عنایت&
بر آن نور از تو گیرم پوششی نیست\\
ز ناکوشیدن خود در خروشیم&
چو دانا همچو نادان گشته غرق است\\
دستانهای نفس ناخوش آهنگ &
\end{traditionalpoem}
\end{persian}

\end{document}

enter image description here

The main advantage of bidipoem here is that you won't need a two-column environment nor to break the verses.

Hasan Zakeri
  • 1,942
  • 1
    Thank you for your reply! While the traditional poemenvironment does look nice, it lacks some features one might need with poems. Most notably, that is numbering the lines and setting a poem title. I looked for and found the documentation for the bidi package, unfortunately it offers none of these options. Furthermore, your solution does not solve having multiple languages in classicthesis. Also, using xepersianseems to break things for a document with a language other than Persian. – Floris Apr 18 '22 at 11:57
  • 1
    How exactly does Xepersian break the rest of your document? If you use it correctly, it shouldn't. Polyglossia and Xepersian both depend on bidi, and at least the core bidirectional engine is the same. If you know you used it correctly and there's a problem (which is very rare at this point--It's pretty stable), you should consider reporting a bug. Also, your solution simply extended upon traditionalpeom. The line number wasn't in your original question. – Hasan Zakeri Apr 20 '22 at 19:20
  • The main issue with using xepersian in a document that has a main language other than Persian is that numbers will behave weirdly. Sections numbered as 1.1, 1.2, 1.3, … will be numbered 1.1, 2.1, 3.1, … using xepersian (see this question: https://tex.stackexchange.com/questions/696406/xepersian-polyglossia-section-numbering-is-rtl-even-though-german-is-main-la). As to my earlier solution: you are right, I don't know what I did there. It does extend on your solution, the only difference seems to be that it avoids xepersian and uses polyglossia to handle multiple languages instead. – Floris Sep 27 '23 at 10:03
0

I want to share a solution that works for me, at least somewhat.

\documentclass[10pt,a4paper]{article} % 
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage[nochapters]{classicthesis}% 
\usepackage{polyglossia}
    \setmainlanguage[variant=german, spelling=new]{german}
    \setotherlanguage{persian}
    \newfontfamily\persianfont[Script=Arabic]{Noto Naskh Arabic}
\usepackage{bidipoem}
\usepackage{verse} % to use its headings

\newcount\LineNumber \newcount\templinenumber \newdimen\linenumberskip \linenumberskip=-1em \chardef\linestep=5 \def\poemlinenumber{% \advance\LineNumber1 \templinenumber=\LineNumber \computelinenumber } \def\computelinenumber{% \ifnum\templinenumber>\linestep \advance\templinenumber-\linestep \expandafter\computelinenumber \else \ifnum\templinenumber=\linestep \leavevmode\rlap{\kern\linenumberskip\the\LineNumber}% \fi \fi } \newenvironment{numberedpoem} % new environment with numbered lines {\everypar{\everypar{\poemlinenumber}}% \begin{traditionalpoem}} {\end{traditionalpoem}}

\section{Textgrundlage} \subsection{Originaltext und Übersetzung} Diese Arbeit wird sich auf einige wenige Zeilen aus Jāmis \emph{Yūsuf ū Zulaikhā} beschränken. Ziel der Arbeit ist es, Begriffe anderer Philosophen und dadurch Bezugnahme zu diesen zu erkennen. Im Folgenden zunächst der persische Originaltext, danach die Übersetzung.

\setLTR
\pagestyle{plain}
\begin{persian}

    \poemtitle{دست برداشتن به مناجات به دستیاری ارباب حاجات}
    \begin{numberedpoem}
        خداوند ز هستی ساده بودیم&
        ز بیم نیستی آزاده بودیم\\
        نخست از نیست ما را هست کردی&
        به قید آب و گل پابست کردی\\
        ز ضعف ناتوانایی رهاندی&
        ز نادانی به دانایی رساندی\\
        فرستادی به ما روشن کتابی&
        به امر و نهی فرمودی خطابی\\
        میان نیک و بد تخلیط کردیم&
        گهی افراط و گه تفریط کردیم\\
        ره فرمودنیها کم سپردیم&
        به نفرمودنیها پا فشردیم\\
        تو نگذشتی ز دستور عنایت&
        نپوشیدی ز ما نور هدایت\\
        بر آن نور از تو گیرم پوششی نیست&
        چه حاصل زان چو از ما کوششی نیست\\
        ز ناکوشیدن خود در خروشیم&
        بده توفیق کوشش تا بکوشیم\\
        چو دانا همچو نادان گشته غرق است&
        ز دانش تا به نادانی چه فرق است\\
        ز دستانهای نفس ناخوش آهنگ &
        مکن بر ما رهِ حسن عمل تنگ\\
        در آن تنگی که ما باشیم و آهی&
        ز رحمت سوی ما بگشای راهی    \\
        ازان ره خوان سوی درگاه ما را&
        به ایمان بر برون همراه ما را

    \end{numberedpoem}
\end{persian}

\end{document}

I have used the numberedpoem environment as suggested here. Unfortunately, I still have not figured out how to change the font of the numbers, at the moment they do not conform with the font of the rest of the document.

This results in the poem with a nice heading and numbered lines integrating well into my otherwise German document. The main difference to before is, that I am now using XeLaTeX for its native UTF8 support.

The chapter heading and the poem.

Floris
  • 89