Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using xepersian package and I was trying to type $0.\overline{1011}$, but I noticed that the dot after 0 is not interpreted as a decimal point (The decimal sign in Persian is something like /). How do I make it look like a decimal sign?

To illustrate the situataion, consider the code below. The first line doesn't use the overline and outputs the correct character for decimal point, but second line output a dot instead. Third line is meant to show how decimal point character is different from $/$.

\documentclass{article}
\usepackage{xepersian}

\begin{document}
    $$0.1011$$
    $$0.\overline{1011}$$
    $$0/\overline{1011}$$
\end{document}

Here is how the output looks like:

enter image description here

share|improve this question
1  
Welcome to TeX.SE! Have you already tried $0/\overline{1011}$, where / would be the Persian decimal symbol? –  Mico Sep 29 '13 at 16:29
    
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  egreg Sep 29 '13 at 16:40
    
@Mico It doesn't output the exact same character. –  Untitled Sep 29 '13 at 19:05
    
@egreg Sure, I added an example. –  Untitled Sep 29 '13 at 19:05

1 Answer 1

up vote 4 down vote accepted

I believe that xepersian sets up a mechanism similar to ligatures (probably via a map file), so that if the period is followed by a digit it is transformed in the decimal separator. With \overline it fails because this command is not a digit.

I found an undocumented feature: you can use \decimalseparator in the cases such as this, where it is not followed by a digit.

\documentclass{article}
\usepackage{amsmath}
\usepackage{xepersian}

\begin{document}
\begin{gather*}
0.1011\\
0\decimalseparator\overline{1011}
\end{gather*}
\end{document}

enter image description here

share|improve this answer
    
You are fast! :-) I was poking around in the file xepersian-mathsdigitspec.sty, had come across a bunch of statements that look like typos (\undefied -- should probably be \undefined?), and a couple of callouts to a macro called \decimalseparator, and the following definition: \SetMathCharDef{\decimalseparator}{\mathpunct}{OPERATORS}{"066B}. Sure enough, in the Opentype spec \char"066B points to a glyph labeled "ARABIC DECIMAL SEPARATOR". I guess it's a Persian as well as an Arabic character... –  Mico Sep 29 '13 at 19:34
    
@Mico \undefied or \undefined is the same, so long as they are both undefined. In LaTeX packages it's customary to use \@undefined. Looking in the documented code, I saw exactly the definition of \decimalseparator and tried it. ;-) –  egreg Sep 29 '13 at 19:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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