0

I want to put math inline segment in an item element, but it keeps saying that I've an undefined control sequence error.

I'm trying this way

\documentclass[UTF8]{article}
\usepackage[UTF8]{inputenc}
\usepackage{enumerate}
\usepackage{amsmath}

\title{My title}
\author{Me}
\date{\today}

\begin{document}
    \maketitle
    \clearpage
    \begin{itemize}
        \item Text $\Ohm$
        \item More text $\mu$F
        \item Lorem ipsum $\mu$F
    \end{itemize}
\end{document}

And I also tried this other way.

\begin{itemize}
    \item Text \(\Ohm\)
    \item More text \(\mu\)F
    \item Lorem ipsum \(\mu\)F
\end{itemize}

The error I got is like this:

! Undefined control sequence.
<recently read> \Ohm
\item Text $\Ohm$

?

How can I make this work ?

6
  • 1
    Use siunitx package and its syntax for writing of units: \si{\ohm}, \si{\micro\farad} etc. Read package documentation: siunitx — A comprehensive (SI) units package. For complete answer you need to extend your code fragments to MWE (Minimal Working Example), a complete small document which reproduce your problem.
    – Zarko
    Commented May 21, 2021 at 4:42
  • @Zarko siunitx v3 changed a lot of things, for example is \si deprecated
    – daleif
    Commented May 21, 2021 at 5:15
  • @daleif, I do not know yet, I still have version "v2.8e, last revised 2021-04-17." Now check for updates of my MiKTeX installation: now have recent package version "v3.0.2, last revised 2021-05-19." I will ned some time to read it ...
    – Zarko
    Commented May 21, 2021 at 5:22
  • @daleif, thank you for info. To be honest, changing vide spread uses of commands names as is \SI etc .... I don't like. For example, when new siunitx will be available in Overleaf? Fortunately old names still work :-). Improvement for tables is interesting and seems to promising.
    – Zarko
    Commented May 21, 2021 at 5:31
  • 1
    If you have new version of siunitx package, i.e. v3.0.2, last revised 2021-05-19, than you can use new package syntax, for example \unit{\micro\farad}.
    – Zarko
    Commented May 21, 2021 at 5:33

1 Answer 1

2

Compilation of my comments:

enter image description here

As I already mentioned in my comments, for writing od units ar variable with units is recommended to use siunitx package. Few days ago is available its new version v3.0.2, last revised 2021-05-19, which introduce many novelties (with all I'm still not familiar) so reading its documentation is strongly recommended (also to me).

\documentclass[UTF8]{article}
\usepackage{enumerate}% I prefer enumitem ;-)
\usepackage{siunitx}

\begin{document}
\noindent%
Old syntax (used in \verb+siunitx+, version v2.8e, last revised 2021-04-17 or older):
    \begin{itemize}
        \item Text \si{\ohm}
        \item More text \si{\micro\farad}
        \item Lorem ipsum \si{\micro\farad}
    \end{itemize}
New syntax (needed \verb+siunitx+, version v3.0.2, last revised 2021-05-19):
    \begin{itemize}
        \item Text \unit{\ohm}
        \item More text \unit{\micro\farad}
        \item Lorem ipsum \unit{\micro\farad}
    \end{itemize}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .