4

I'm trying to use the inch mark (the double prime) in a piece of text; in the past I've gotten away with

4 $''$ \times 6 $''$

but for some reason that doesn't work when that line is an item in an itemized list. I'm now experimenting with the siunitx package, but now there's a new problem. This MOLMWE (More or Less Minimal Working Example)

\documentclass{article}
\usepackage{siunitx}
\usepackage[LY1]{fontenc}
\usepackage{fontspec}
\usepackage{xltxtra}

\setromanfont[Numbers=OldStyle]{Linux Libertine O}

\sisetup{detect-all = true}
\DeclareSIUnit[number-unit-product = {}]{\inchQ}{\prime\prime}

\begin{document}

\begin{itemize}

\item \SI{4 \times 6}{\inchQ} index cards

\end{itemize}

\end{document}

produces an incorrect result; I'd attach an image, but I don't have sufficient reputation for that privilege. What's the problem, if you can spot it from just the code, and how do I fix it?

P.S. As for the MOLMWE: I included possibly extraneous material because I wasn't sure whether it was relevant and decided to play it safe.

  • siunitx already defines the unit \arcsecond (and \arcminute). – Qrrbrbirlbel Aug 27 '13 at 20:55
  • The error is "invalid-token-in-number", caused by \times. – egreg Aug 27 '13 at 20:59
  • Does that mean I shouldn't be using \times in text? And if so, is there a better way to incorporate that symbol? – user35810 Aug 27 '13 at 21:01
  • @user35810 siunitx converts x in the input as an product (see the options input-product and output-product). – Qrrbrbirlbel Aug 27 '13 at 21:03
  • What's wrong with just doing $4''\times6''$? If you want to use the text font instead of the maths font, then just try $\rm 4''\times6''$. – Thruston Aug 27 '13 at 21:04
4

I’d use the UTF characters here and not the \prime\prime (better would be siunitx’ default setting {}^{\prime\prime} which is '', anyway). That way, the glyphs are taken from the same font as the digits.

Code

\documentclass{article}
\usepackage{fontspec}
\usepackage{siunitx}
\setromanfont[Numbers=OldStyle]{Linux Libertine O}
\sisetup{
  detect-all = true,
  text-arcsecond=″,
  text-arcminute=′,
  math-arcsecond=″,
  math-arcminute=′,
}
\DeclareSIUnit[number-unit-product={}]\inchQ{\SIUnitSymbolArcsecond}
\DeclareSIUnit[number-unit-product={}]\footQ{\SIUnitSymbolArcminute}
\begin{document}
\begin{itemize}
  \item Arcseconds
  \begin{itemize}
    \item \SI{4 x 6}{\arcsecond}
    \item $\SI{4 x 6}{\arcsecond}$
  \end{itemize}
  \item Inches
  \begin{itemize}
    \item \SI{4 x 6}{\inchQ}
    \item $\SI{4 x 6}{\inchQ}$
  \end{itemize}
\end{itemize}
\end{document}

Output

enter image description here

  • Extra marks for maintaining the semantic difference between an arc and inches :-) – Joseph Wright Aug 27 '13 at 21:14

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.