Skip to content
This repository has been archived by the owner on Nov 30, 2019. It is now read-only.

Right-to-left columns in Latin environment #5

Open
3 of 5 tasks
lrkrol opened this issue Jun 29, 2019 · 2 comments
Open
3 of 5 tasks

Right-to-left columns in Latin environment #5

lrkrol opened this issue Jun 29, 2019 · 2 comments
Assignees
Labels
Bug Something isn't working Question Further information is requested

Comments

@lrkrol
Copy link

lrkrol commented Jun 29, 2019

Brief outline of the issue

Using columns inside a XePersian Latin environment, the columns are in the wrong order (i.e., the first column is on the right-hand side of the page). In some cases, adding \LTRdblcol fixes this, but not always.

Specifically, when using makeidx's \printindex command, which prints a two-column index, in a Latin environment, the columns are in the wrong order. The same problem occurs when using a multicols environment. In the case of makeidx, this can be resolved by using bidi's \LTRdblcol --- but this should not be necessary. Furthermore, \LTRdblcol does not fix the same issue in the multicols environment.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode

\documentclass{article}

\usepackage{makeidx}
\usepackage{multicol}
\usepackage{xepersian}
\settextfont{IRXLotus}
\makeindex

\begin{document} 
\begin{latin}

\index{a}
\index{b}

% \LTRdblcol
\printindex

\begin{multicols}{2}
First column
\vfill\columnbreak
Second column
\end{multicols}

\end{latin}
\end{document}

Expected behavior

The first page should have an automatically generated two-column index, where the columns are populated left-to-right. The second page should have a two-column multicols environment, where the columns are populated left-to-right.

Instead, both are populated right-to-left. The \LTRdblcol command only solves the index, not the multicols environment.

Log and PDF files

xepersianlog.txt
xepersiancolumns.pdf

@lrkrol lrkrol added the Bug Something isn't working label Jun 29, 2019
@user-is-inactive-forever
Copy link
Owner

user-is-inactive-forever commented Jun 30, 2019

Dear Laurens,

Thanks for your bug report. My understanding from your bug report is that

  1. The control sequence \LTRdblcol has no effect when the package multicol is used; and

  2. Whenever we are inside the latin environment, the columns should automatically be typeset from left to right.

The control sequence \LTRdblcol is only for twocolumn option of the control word \documentclass. For the multicol package, you would need to use the control sequence \LTRmulticolcolumns.

Regarding issue 2, the columns order changes whenever the main direction changes. Since your document's main direction is right to left, therefore the columns order are right to left. If you change the main direction in your document to left to right, then columns are also typeset left to right.

\documentclass{article}

\usepackage{makeidx}
\usepackage{multicol}
\usepackage[%
  documentdirection=lefttoright%
]
{xepersian}
\settextfont{IRXLotus}
\makeindex

\begin{document} 
\begin{latin}

\index{a}
\index{b}

% \LTRdblcol
\printindex

\begin{multicols}{2}
First column
\vfill\columnbreak
Second column
\end{multicols}

\end{latin}
\end{document}

This has been the default behavior of the bidi package for more than 10 years. I think you are saying that whenever the direction changes, the order of columns also should be changed to agree with the direction. If I was going to make a change, this would introduce an incompatibility with older versions of the bidi package.

I keep this issue open while I am thinking about what it is best to do.

Best wishes, Vafa Khalighi

@lrkrol
Copy link
Author

lrkrol commented Jun 30, 2019

Dear Vafa,

Thank you very much for the swift reply. I wasn't aware of the separate \LTRmulticolcolumns command. Your suggestions have certainly solved the immediate issues I was having.

But it was indeed my expectation that any columns started in a latin environment would default to LTR. Using a single global option works fine for my document, where I only need one and the same column order throughout. I can see how switching between different column orders within the same document may actually be really confusing, but a RTL column order with LTR text (and vice versa) is, too. Perhaps it's best to leave the choice to the user, but emphasise that this choice exists --- e.g. \begin{...}[LTRcols] and \begin{...}[RTLcols] as additional, optional arguments for the latin and persian environments?

Either way, thanks again for the help, and for the great packages!

Laurens

@user-is-inactive-forever user-is-inactive-forever added the Question Further information is requested label Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants