Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

English & Arabic document breaks when using paracol #241

Closed
amarakon opened this issue May 11, 2023 · 5 comments
Closed

English & Arabic document breaks when using paracol #241

amarakon opened this issue May 11, 2023 · 5 comments

Comments

@amarakon
Copy link

Followup to #233. Previously, there was an issue where English and Arabic documents broke within a multicols environment from the multicol package. This has since been fixed. However, the issue still persists within a paracol environment from the paracol package. This only happens when inserting a paragraph end before \end{otherlanguage}, but I want to insert a paragraph end before \end{otherlanguage}, so that the linebreaker package can work. On the first page of the following document, the English text is shifted all the way to the left edge of the document, and the Arabic text is not visible.

\documentclass{book}

\usepackage{paracol, lipsum, linebreaker}
\usepackage[bidi = basic]{babel}

\babelprovide[main, import]{english}
\babelprovide[import]{arabic}

\babelfont[arabic]{rm}{Amiri}

\newcommand{\arabictext}{%
	\begin{otherlanguage}{arabic}
		لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار  النشوة وتمجيد
		الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة
		البشرية، فلا أحد يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء
		الأشخاص الذين لا يدركون بأن السعادة لا بد أن نستشعرها بصورة أكثر عقلانية
		ومنطقية فيعرضهم هذا لمواجهة الظروف الأليمة، وأكرر بأنه لا يوجد من يرغب في
		الحب ونيل المنال ويتلذذ بالآلام، الألم هو الألم ولكن نتيجة لظروف ما قد تكمن
		السعاده فيما نتحمله من كد وأسي.

	\end{otherlanguage}%
}

\begin{document}

\begin{paracol}{2}
	\lipsum[1]
	\switchcolumn
	\arabictext
	\switchcolumn*
	\lipsum[2]
	\switchcolumn
	\arabictext
	\switchcolumn*
	\lipsum[3]
	\switchcolumn
	\arabictext
\end{paracol}

\end{document}

babel-issue-1
babel-issue-2

@jbezos
Copy link
Contributor

jbezos commented May 11, 2023

IIR, the order of columns is reversed, too (Arabic is first at the left, although hidden, and then at the right).

@amarakon
Copy link
Author

That would explain why the Arabic is not visible on the first page.

@jbezos
Copy link
Contributor

jbezos commented May 12, 2023

I’m not sure what paracol is doing, but the following piece of code seems to fix it (although the direction is hardcoded). I’ve done it a little blindly:

\makeatletter
\edef\pcol@output{\pagedir TRT \bodydir TRT \unexpanded\expandafter{\pcol@output}}
\makeatother

@jbezos
Copy link
Contributor

jbezos commented May 12, 2023

The following seems better:

\edef\pcol@output{\bodydir\pagedir\unexpanded\expandafter{\pcol@output}}

@amarakon
Copy link
Author

The following seems better:

\edef\pcol@output{\bodydir\pagedir\unexpanded\expandafter{\pcol@output}}

This works, thanks. If the problem is from paracol and not babel, you can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants