4

please help me i can't resolve this problem the problem is character _t

\documentclass{article}

\usepackage{array,booktabs ,tabularx,multirow}
\usepackage{fontspec}
\usepackage{arabxetex}
\newfontfamily\arabicfont[Script=Arabic , Scale=1.5]{Nazli}

\begin{document}

\begin{tabularx}{\textwidth}{|r  ||||X|||| r |}
\toprule
\textarab{AlmdT AlzmnyT : sA`tAn} & \centering \textarab{{\LARGE Al-'imt.hAn Al|m|.hly Al|m|w.hd }} & \textarab{'i`dAdyT `bd Alkrym Alx.tAby } \\
\textarab{AldwrT : $II$}& \centering   \textarab{\Large{fy m|AdT AlryA.dyAt}}&\textarab{nyAbT tAwryrt} \\
\textarab{Alm`Aml : $3$} & \centering  \textarab{AlsnT Al_tAl_tT  'i`dAdy} & \textarab{dabdw} \\
\bottomrule
\end{tabularx}

\end{document}
  • 1
    Is the tabularx necessary for the example? Can you reduce to a minimum that still describes the issue? – egreg Sep 16 '14 at 22:07
  • Can you reproduce the issue with a font which people are already likely to have or which they can download if necessary? (Only ask people to download it if it is really essential to reproduce the issue because asking that will reduce the number of people prepared to try to help you.) – cfr Sep 16 '14 at 22:26
2

The problem is that tabularx reads the whole contents of the table for typesetting it a couple of times. Doing so disrupts the working of \textarab that normally changes the category code of _ so to become a “letter”, but it can't in this case, because the text has already been read in (and tokenized).

A possible workaround is to make _ math active and behave like a printable character outside math mode.

\documentclass{article}

\usepackage{array,booktabs ,tabularx,multirow}
\usepackage{fontspec}
\usepackage{arabxetex}
\newfontfamily\arabicfont[Script=Arabic , Scale=1.5]{Scheherazade}

\begingroup\lccode`~=`_ \lowercase{\endgroup\let~\sb}
\AtBeginDocument{\mathcode`\_=\string"8000 \catcode`\_=12 }


\begin{document}
$x_{1}\ne x_{2}$

\noindent
\begin{tabularx}{\textwidth}{r X r}
\toprule
\textarab{AlmdT AlzmnyT : sA`tAn} &
  \LARGE\centering \textarab{Al-'imt.hAn Al|m|.hly Al|m|w.hd} &
  \textarab{'i`dAdyT `bd Alkrym Alx.tAby } \\
\textarab{AldwrT : $II$}&
  \Large\centering \textarab{fy m|AdT AlryA.dyAt} &
  \textarab{nyAbT tAwryrt} \\
\textarab{Alm`Aml : $3$} &
  \centering \textarab{AlsnT Al_tAl_tT 'i`dAdy} &
  \textarab{dabdw} \\
\bottomrule
\end{tabularx}

\end{document}

I added a formula to show that _ still works in math mode.

enter image description here

1

You have a problem with the symbole of underscore inside tabularx environment , what you need to do is to change the category of the underscore symbole with \catcode

\documentclass{article}

\usepackage{array,booktabs ,tabularx,multirow}
\usepackage{fontspec}
\usepackage{arabxetex}
\newfontfamily\arabicfont[Script=Arabic , Scale=1.5]{Amiri}

 \catcode`\_=11  % change the category of underscore to a lettre

\begin{document}

\begin{tabularx}{\textwidth}{|r  ||||X|||| r |}
\toprule
\textarab{AlmdT AltzmnyT : sA`tAn} & \centering \textarab{\LARGE Al-'imt.hAn Al|m|.hly Al|m|w.hd } & \textarab{'i`dAdyT `bd Alkrym Alx.tAby } \\
\textarab{AldwrT : $II$}& \centering   \textarab{\Large fy m|AdT AlryA.dyAt}&\textarab{nyAbT tAwryrt} \\
\textarab{Alm`Aml : $3$} & \textarab{AlsnT Al_tAl_tT  'i`dAdy} & \textarab{dabdw} \\
\bottomrule
\end{tabularx}

 \catcode`\_=8  % return the category of the underscore


\end{document}
0

i can't resolve this problem please help

\documentclass[oneside]{article}

\usepackage{xkeyval} \usepackage[top=1cm,bottom=0cm,left=1cm,right=1cm]{geometry}

\usepackage{xltxtra} \usepackage{arabxetex}
\newfontfamily\arabicfont[Script=Arabic, Scale=1.5]{Andalus}

%-----------\qst[bareme,bar=...]{......}----------------------%

\makeatletter \define@cmdkey[EX]{qst}{bar}{} \define@boolkey[EX]{qst}{bareme}[true]{} \presetkeys[EX]{qst}{bar= ,bareme=false}{} \newcommand{\qst}[2][]{ \setkeys[EX]{qst}{#1}

\ifEX@qst@bareme \ifdim pt < 2 pt \begin{arab} $-\arabic{k}$ #2 \marginpar{ \cmdEX@qst@bar} \end{arab} \else \begin{arab} $-\arabic{k}$ #2 \marginpar{ \cmdEX@qst@bar } \end{arab} \fi \else \begin{arab} $-\arabic{k}$ #2 \end{arab} \fi \stepcounter{k} }

\makeatother

\begin{document}

\qst{ml mA yly Al-ll_ah 'akbr mmT: } \qst[bareme, bar=2]{ml mA yly : } \qst{ml mA yly : } \qst{ml mA yly Al------ll_a----------h: } \qst{`ml mA yly : }

\end{document}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.