8

In my tex I have a sentence:

No external torque $\implies$ Angular momentum $L$ is conserved:

After I compile the tex file, it throws out "! Missing } inserted" error. If I delete the $\implies$ in the above sentence, all is fine.

Why and how to solve it?

The whole tex code (I run it with XeLatex+MakeIndex+BibTex):

\documentclass{beamer}   % 默认就是 4:3

\usetheme{Madrid}
\usecolortheme{seahorse}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{physics}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{calc, decorations.markings, arrows.meta, angles, quotes}
\usetikzlibrary{patterns,decorations.pathmorphing}
\usepackage{amsfonts}
\usepackage[utf8]{inputenc}
\usepackage[T3,T1]{fontenc}
\usepackage{tipa}
\usepackage{xcolor}
\usepackage{booktabs} % 用于绘制专业的表格线
\usepackage{setspace}

\usepackage{fontspec}
 % 如果你是 Windows 用户,通常 Arial 包含最全的音标字符
\setmainfont{Arial}
 
 \usepackage{siunitx}

\begin{document}

\begin{frame}{Exercise: Angular Momentum Conservation}
    \textbf{Problem:} \\
    Two flywheels $A$ and $B$ share a common axis. Initially, $B$ is at rest, and $A$ rotates with angular velocity $\omega_A$. After they are coupled by clutch $C$, they rotate together with velocity $\omega$. Find $J_B$ if $A$'s moment of inertia is $J_A$.

 
\textbf{Solution:} \\
    No external torque $\implies$ Angular momentum $L$ is conserved:
    \begin{equation*}
        J_A \omega_A = (J_A + J_B) \omega
    \end{equation*}

    \pause
  
\end{frame}

\end{document}
2
  • 1
    Unrelated: using the physics package is usually not recommended. Commented yesterday
  • Regarding “how to solve it?” One thing you can do as a learner is isolate the issue by removing as much as possible from your example. For instance, you don't have any tables in the document, so the booktabs package is probably not the source of the problem. Keep simplifying, and you'll discover that tipa is the culprit. Then you can look at the tipa documentation. Commented yesterday

2 Answers 2

10

If you look at the definition of \implies (latexdef -p amsmath implies)

\implies:
macro:->\DOTSB \;\Longrightarrow \;

you'll see that it uses a \; command.

However, the tipa package redefines \; (see the section 3.2.4 of its manual, Special macros \*, \;, \: and \!)

TIPA defines \*, \:, \; and ! as special macros in order to easily input phonetic symbols [...] they can be ‘dangerous’ in that they override existing LATEX commands used in the math mode.

You need to load tipa with its safe option

\usepackage[safe]{tipa}

(anyway, after reading samcarter_is_at_topanswers.xyz's answer, it seems that you simply don't need it).

Example:

\documentclass{beamer}   % 默认就是 4:3

\usetheme{Madrid}
\usecolortheme{seahorse}

\usepackage[safe]{tipa}

\begin{document}

\begin{frame}{Exercise: Angular Momentum Conservation}
  
    No external torque $\implies$ Angular momentum $L$ is conserved:
    
\end{frame}

\end{document}

Example

2
  • You don't need \usepackage{amsmath}, that is loaded automatically Commented 2 days ago
  • @samcarter_is_at_topanswers.xyz Fixed, thanks. Commented 2 days ago
11

You could remove the tipa package to compile your code. Given that you use an unicode engine, you should be able to use the symbols directly if you choose a suitable font. See also https://tex.stackexchange.com/a/554514/36296

Some other comments:

  • don't use xelatex with beamer. If you need an unicode engine, use lualatex instead
  • you don't need to load the ams* and xcolor packages, they are loaded automatically by beamer
  • utf8 is the default since a decade, no need to load inputenc
  • if you use an unicode engine, don't load fontenc
  • I wouldn't use setspace with beamer
  • using \setmainfont{Arial} won't have any effect on the sans serif font used by beamer. Did you maybe mean \setsansfont?
  • try the unicode-math package, this will give you nicer results for your font combination

% !TeX TS-program = lualatex -interaction=nonstopmode % | txs:///view-pdf | txs:///view-log
\documentclass{beamer}   % 默认就是 4:3

\usetheme{Madrid}
\usecolortheme{seahorse}

\usepackage{fontspec}
\setsansfont{Arial}
 
\usepackage{unicode-math}
\newfontfamily{\tipa}{Noto Sans}

\begin{document}

\begin{frame}
  \frametitle{Exercise: Angular Momentum Conservation}
  No external torque $\implies$ Angular momentum $L$ is conserved
  
  {\tipa [ˌɛkspləˈneɪʃən]}
\end{frame}

\end{document}

enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.