1

When I using[origin=c], the tabular is corrupted.

and all the next table's was destroyed.

xepersian is a package for bidirectional writing (with XeLaTex).

If I enable ‍\setLTR, the problem is solved.

I want the text vertically centred in cell.

please help me. thanks

% !TEX TS-program = XeLaTeX
\documentclass{article}
\usepackage{graphicx}
%%%\usepackage{bidi}
\usepackage{xepersian}
\settextfont{Arial}
\begin{document}
\setLTR

\begin{tabular}{|c|c|} \hline 
\rotatebox{90}{my longer text}  & \rotatebox{90}{my text} 
\\ \hline 
21 & 22  \\ \hline 
\end{tabular}

\vspace{10mm}

\begin{tabular}{|c|c|} \hline 
\rotatebox[origin=c]{90}{my longer text} & \rotatebox[origin=c]{90}{my text} 
\\ \hline 
21 & 22  \\ \hline 
\end{tabular}

\vspace{10mm}

\setRTL

\begin{tabular}{|c|c|} \hline 
\rotatebox[origin=c]{90}{my longer text} & \rotatebox[origin=c]{90}{my text} 
\\ \hline 
21 & 22  \\ \hline 
\end{tabular}

\begin{tabular}{|c|c|} \hline 
11 & 12 
\\ \hline 
21 & 22  \\ \hline 
\end{tabular}

\end{document}

in \setLTR enabled mode (without xepersian)

enter image description here

I have attached two photos.

pic 1: I enable \setLTR. (text in LTR mode). and i dont have problem.

pic 2: I enable \setRTL (default of xepersian package). and tabular 3,4 were hidden.

  • I was about to suggest to remove the [origin=c] command because the text will be centred anyway, only to receive "text my" in the table. Is that intended behaviour? – Huang_d Jun 16 '17 at 8:07
  • @Huang_d i want to center my text with orogin=c. in this example: \begin{tabular}{|c|c|} \hline \rotatebox{90}{my longer text} & \rotatebox{90}{my text} \\ \hline 21 & 22 \\ \hline \end{tabular} i want to (my text) is centered with origin=c and hiding the tabular, to be solved. – Hadi Safi aghdam Jun 16 '17 at 8:41
  • I'm not sure I understand you, you want the text vertically centred? The [origin=c] is the point around which the text is rotated. Within the tabular environment, the text is then shifted horizontally to the centre. So from my understanding, [origin=c] wound give the same result as [origin=b] or no specification. For vertical centring, have a look at this question: tex.stackexchange.com/questions/7208/… If I misunderstand you, please clarify. – Huang_d Jun 16 '17 at 8:56
  • @HadiSafiaghdam put \rotatebox[origin=c]{90}{my text} in \lr or \LRE. this solves your problem, but I've no idea why it cannot be typeset out of LTR environment. – javadr Jun 16 '17 at 9:11
  • @Huang_d thanks. Yes I want the text vertically centred. if i disable xepersian package or enable \setLTR, it is ok. and (my text) is centered. but if i enable xepersian package, The problem appears. and content of tabular and some lines are hidden. (picture 2) I want to work in the RTL text, as in Latin works (without mistake) i edit my question – Hadi Safi aghdam Jun 16 '17 at 11:42

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.