0

I'm getting this annoying error when I try using some features of siunitx package. Let's say I want to make a simple table:

 \begin{table}[h!]
  \centering
  \caption{Caption for the table.}
  \label{tab:table1}
  \begin{tabular}{l|c||r}
    1 & 2 & 3 \si{\volt}\\
    \hline
    a & b & c\\
  \end{tabular}
\end{table}

If I would use command \si{\volt} there would be no error. But if I would use \SI{3}{\volt} instead, I would get an error. Do you have any idea what is happening and how to solve it?

  • 2
    Which document class do you use, and which packages that utilize additional math fonts do you load in your document? The reason I ask is that I am unable to reproduce the issue you describe if I prefix \documentclass{article} \usepackage{siunitx} \begin{document} and affix \end{document} to your code in order to make it (minimally) compilable. – Mico Jan 23 '17 at 14:17
  • The whole definition comes from a class file. Inside it the class is defined as article. – MarkoP Jan 23 '17 at 14:24
  • 1
    There are lots and lots of LaTeX document classes out there that are based loosely on the article class. To have a chance to solve the issue you're experiencing, it's crucial to know which class file is loaded by your document. – Mico Jan 23 '17 at 14:35
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – user36296 Mar 7 '18 at 16:08
1

The problem is solved. If you want to write:

\RequirePackage{ifplatform}
\ifwindows
  \setmainfont[Ligatures=TeX,ItalicFont=RobotoCondensed-LightItalic,BoldFont=RobotoCondensed-Regular,BoldItalicFont=RobotoCondensed-Italic]{RobotoCondensed-Light}
  \setmonofont[Scale=MatchLowercase]{RobotoMono-Light} 
  \setmathfont(Greek,Digits,Latin){RobotoCondensed-Light}
  \setmathrm[ItalicFont=RobotoCondensed-LightItalic,BoldFont=RobotoCondensed-Regular,BoldItalicFont=RobotoCondensed-Italic]{RobotoCondensed-Light}
\else
  \setmainfont[BoldFont=Roboto Condensed, BoldItalicFont=Roboto Condensed Italic,ItalicFont=Roboto Condensed Light Italic,Ligatures=TeX]{Roboto Condensed Light}
  \setmonofont[Scale=.9]{Roboto Mono Light} 
  \setmathfont(Greek,Digits,Latin){Roboto Condensed Light}
  \setmathrm[ItalicFont=Roboto Condensed Light Italic,BoldFont=Roboto Condensed,BoldItalicFont=Roboto Condensed Italic]{Roboto Condensed Light}
\fi

It will not work. However, if you write:

\RequirePackage{ifplatform}
\ifwindows
    \setmainfont[Ligatures=TeX,ItalicFont=RobotoCondensed-LightItalic,BoldFont=RobotoCondensed-Regular,BoldItalicFont=RobotoCondensed-Italic]{RobotoCondensed-Light}
    \setsansfont[Ligatures=TeX,ItalicFont=RobotoCondensed-LightItalic,BoldFont=RobotoCondensed-Regular,BoldItalicFont=RobotoCondensed-Italic]{RobotoCondensed-Light}
    \setmonofont[Scale=MatchLowercase]{RobotoMono-Light} 
    \setmathfont(Greek,Digits,Latin){RobotoCondensed-Light}
    \setmathrm[ItalicFont=RobotoCondensed-LightItalic,BoldFont=RobotoCondensed-Regular,BoldItalicFont=RobotoCondensed-Italic]{RobotoCondensed-Light}
    \setmathsf[ItalicFont=RobotoCondensed-LightItalic,BoldFont=RobotoCondensed-Regular,BoldItalicFont=RobotoCondensed-Italic]{RobotoCondensed-Light}
\else
    \setmainfont[BoldFont=Roboto Condensed, BoldItalicFont=Roboto Condensed Italic,ItalicFont=Roboto Condensed Light Italic,Ligatures=TeX]{Roboto Condensed Light}
    \setsansfont[BoldFont=Roboto Condensed, BoldItalicFont=Roboto Condensed Italic,ItalicFont=Roboto Condensed Light Italic,Ligatures=TeX]{Roboto Condensed Light}
    \setmonofont[Scale=.9]{Roboto Mono Light} 
    \setmathfont(Greek,Digits,Latin){Roboto Condensed Light}
    \setmathrm[ItalicFont=Roboto Condensed Light Italic,BoldFont=Roboto Condensed,BoldItalicFont=Roboto Condensed Italic]{Roboto Condensed Light}
    \setmathsf[ItalicFont=Roboto Condensed Light Italic,BoldFont=Roboto Condensed,BoldItalicFont=Roboto Condensed Italic]{Roboto Condensed Light}
\fi

I am guessint that the last command in second code block is important. However I cannot find what does \setmathsf does.

  • 1
    Please consider augmenting your code snippet into a standalone, compilable LaTeX document. Without this additional information, it's nearly impossible to tell what's going on. – Mico Jan 23 '17 at 14:44

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.