1

I'm using XeLaTeX with specified fonts CMU and UbuntuMono

\usepackage{fontspec}
\usepackage{amsfonts}
\usepackage{unicode-math}

\setmainfont[Extension = .ttf, Path = ./../fonts/, UprightFont = *rm, ItalicFont = *it]{cmun}
\setmathfont[Extension = .ttf, Path = ./../fonts/]{cmunit}
\setmonofont[Extension = .ttf, Path = ./../fonts/, UprightFont = *-Roman, ItalicFont = *-Italic]{UbuntuMono}

However, anytime I'm trying to use any simple math symbol just like plus or equal sign in math mode, it throws error. For example:

./report.tex:190 Undefined control sequence.
<argument> (2+
              1)\cdot (2\text {+}1)
l.190 \end{longtabu}

For line 127

\(\frac{1}{(2+1)\cdot(2\text{+}1)}\text{=}0{,}11\)

With ‘+’ sign specified as ‘\text{+}’ I getting no trouble except for innormal binary operator spacing.

I have no idea how can I fix it

  • 2
    inside a tabular (of any kind) I don't see the reason to use math in \[\]. Use \(\) instead. \[\] would possibly work in a miniopage... but I can not see it (since you didn't provided a MWE :tex.meta.stackexchange.com/questions/228/…). – koleygr Mar 29 '18 at 9:28
  • Why would you set the math font to cmunit, which isn't a math font to begin with? The standard font used by unicode-math is Latin Modern Math, which blends nicely with CMUnicode. – egreg Mar 29 '18 at 15:48
2

Seems that you are using a math environment of the type \[ ... \] inside a tabular (longtabu) environment.

Possibly you are not using it inside a minipage or somewhere that could be acceptable.

For example check this:

\documentclass{article}
\begin{document}
\begin{tabular}{cc}
    \(F(x)+3\) & %does work
    %\[g(x)+9\] Doesn't work
    \begin{minipage}[b]{4cm}
\[g(x)+9\] % Does work but... not reason for it
    \end{minipage}
    \\
    z & 6
\end{tabular}
\end{document}

Reason: The \[\] environment "says" to the compiler to place the math their own line, centered etc. But inside the tabular, if theri is not a minipage or something similar... there is no line to add... no center of line etc...

  • I've replaced it with \(\frac{1}{(2+1)\cdot(2+1)}=0{,}11\) but still having same problem. I also tryed to use XITS Math font but getting same result for operators like ‘+’ and ‘=’. \cdot/\times works correctly. – Dmitri Engelhardt Mar 29 '18 at 9:46
  • 1
    Please read the link of the comment on your answer and provide a MWE. Nobody can help you otherwise. I just found an obvious mistake. This was the only I (or anyone) could do . You can Edit your post providing a MWE that demonstrates the problem and I am sure you will be helped in minutes... – koleygr Mar 29 '18 at 9:53

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.