Re: [XeTeX] footnotes and ArabXeTeX

2011-10-05 Thread Zdenek Wagner
2011/10/5 Nathan Sidoli nathan.sid...@utoronto.ca:
 Here is one for Vafa in your new capacity as maintainer of ArabXeTeX. Thanks
 for taking over this package! (I sent this to François some time ago, but I
 don't think anything has been done about it.)

 In certain environments, there is some problem with the input which is
 controlled by ascii 'operators' such as ^ and _ and maybe some others. For
 example, ش is input as ^s, ذ is input as _d, and so on. The letters that are
 input using . seem to be unaffected.

This is a problem of \catcode. Apparently \textarab changes \catcode
of ^ and _ to 12. However, \footnote (as well as other macros) read
the whole argument and when \textarab starts to play its role, it is
too late and \catcode of ^ and _ is already set. I do not know how to
solve this problem without breaking math in \footnote, some dirty
trick will be needed.

 The effect occurs in a number of environments, such as footnotes and
 pstricks figures (it doesn't occur TikZ, and this is good, but many people
 have legacy figures in pstricks). In these environments, the operators seem
 to be treated as some sort of mathematical operator and the compiler
 complains that a $ is missing and the file will not compile.

 I have included a couple of minimal files, below.

 --

 \documentclass{article}

 \usepackage{fontspec}
 \setmainfont[Mapping=tex-text]{Junicode}
 \usepackage[novoc,fdf2noalif]{arabxetex}
 \newfontfamily\arabicfont[Script=Arabic,Scale=1.3,WordSpace=2]{Scheherazade}

 \begin{document}

 We have a footnote that contains the word
 \textarab{al-^skl}.\footnote{\textarab{al-^skl}.}
 It is the \^\ \ in the asci input of \textarab{^s} that causes the problem.
 It seems that it is being read as an operator in an uncalled math
 environment.

 This is also true of \_ in, used in, say,
 \textarab{_d}.\footnote{textarab{_d}.}

 And maybe some of the other operators, but the . works fine, as in
 \textarab{.z}.\footnote{\textarab{.z}.}

 \end{document}

 

 \documentclass{article}

 \usepackage{pstricks}
 \usepackage{pst-eps}

 \usepackage{fontspec}
 \setmainfont[Mapping=tex-text]{Junicode}
 \usepackage[novoc,fdf2noalif]{arabxetex}
 \newfontfamily\arabicfont[Script=Arabic,Scale=1.3,WordSpace=2]{Scheherazade}

 \newcommand{\A}{\textarab}

 \begin{document}

 \begin{center}
 \begin{pspicture}(0,0)(3,3)
 \psline[linewidth=1pt](0,0)(0,3) %base
 \psline[linewidth=1pt](0,0)(3,0) %2e base
 \psline[linewidth=1pt](0,3)(3,3) %3e base
 \psline[linewidth=1pt](3,0)(3,3) %oblique 1
 \psline[linewidth=1pt](0,3)(3,0) %oblique 1
 \rput(1.5,2.4){\A{mA'iT}}
 \rput(1.5,3.278){\A{`^srT}}
 \rput*[0,0]{-45}(0.23,1.74){\A{j_dr mA'ityn}}
 \rput*[0,0]{-90}(3.125,2.1){}
 \rput*[0,0]{-90}(-0.7,2.1){}
 \rput(1.5,-0.275){}
 \end{pspicture}
 \end{center}

 \end{document}





 --
 Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex




-- 
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] footnotes and ArabXeTeX

2011-10-05 Thread Philip TAYLOR



Zdenek Wagner wrote:


This is a problem of \catcode. Apparently \textarab changes \catcode
of ^ and _ to 12. However, \footnote (as well as other macros) read
the whole argument and when \textarab starts to play its role, it is
too late and \catcode of ^ and _ is already set. I do not know how to
solve this problem without breaking math in \footnote, some dirty
trick will be needed.


To re-catcode a TeX sequence known to contain (e.g.) ^12 :

Pass the sequence + \sentinel to a macro with parameter structure

#1^12#2\sentinel


Yield as expansion #1^#2, where ^ has its normal catcode.

Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
 http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] footnotes and ArabXeTeX

2011-10-05 Thread Zdenek Wagner
2011/10/5 Philip TAYLOR p.tay...@rhul.ac.uk:


 Zdenek Wagner wrote:

 This is a problem of \catcode. Apparently \textarab changes \catcode
 of ^ and _ to 12. However, \footnote (as well as other macros) read
 the whole argument and when \textarab starts to play its role, it is
 too late and \catcode of ^ and _ is already set. I do not know how to
 solve this problem without breaking math in \footnote, some dirty
 trick will be needed.

 To re-catcode a TeX sequence known to contain (e.g.) ^12 :

 Pass the sequence + \sentinel to a macro with parameter structure

        #1^12#2\sentinel


 Yield as expansion #1^#2, where ^ has its normal catcode.

Generally, \footnote may contain both math, where ^ and _ must have
their catcodes as written in the TeXbook, and \textarab, where the
catcodes of ^ and _ have to be changed. there may be several
occurences of \textarab (\texturdu, \textpersian) in a \footnote and
several occurences of ^ and _ in \textarab. I am not sure whether math
can appear inside \textarab. Thus the solution would not be that
simple.

 Philip Taylor


 --
 Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex




-- 
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex