TeX - LaTeX Asked on July 16, 2021
I use the multline
feature from amsmath
to display an equation that spreads acroos multiple rows. I tried to do that like this:
begin{multline}
label{eq:volume_boundaries}
intlimits_S Gammanablaphicdotmathbf{n}d{S} =
intlimits_{S_text{n}} (Gammanablaphicdotmathbf{n})_text{n}d{S_text{n}}
+intlimits_{S_text{e}} (Gammanablaphicdotmathbf{n})_text{e}d{S_text{e}}
+intlimits_{S_text{s}} (Gammanablaphicdotmathbf{n})_text{s}d{S_text{s}}
+intlimits_{S_text{w}} (Gammanablaphicdotmathbf{n})_text{w}d{S_text{w}}
end{multline}
However this leads to the error message Missing $ inserted. end{multline}
. What did I do wrong here?
The root cause of the problem you've encountered is that you're trying to use a text-mode-only command -- d
-- in math mode.
Rather than undefine and then redefine d
suitably, I think it's better to create a macro with a new name -- say, diff
-- to denote the "differential operator". E.g.,
newcommand{diff}{mathop{}!mathrm{d}}
Observe that this command does not take an argument. Thus, I would encourage you to just write diff S
, not diff{S}
, as the latter might create the (misleading and inappropriate) impression that diff
is a macro that takes an argument.
I would also replace with all instances of intlimits
with just int
, as I can't see a (typographic) justification for elongating the equation in the vertical direction.
Finally, I think the equation is easier to read if you used an equation
/aligned
combination instead of a multline
environment.
documentclass{article} % or some other suitable document class
usepackage{amsmath}
newcommand{diff}{mathop{}!mathrm{d}} % don't re-purpose the existing 'd' macro
newcommand{gnpn}{Gammanablamkern-2mu phicdotmathbf{n}} % handy shortcut macro
begin{document}
begin{equation}label{eq:volume_boundaries}
begin{aligned}[b]
int_S gnpn diff S
&= int_{S_mathrm{n}}! (gnpn)_{mathrm{n}}diff S_{mathrm{n}}
+int_{S_mathrm{e}}! (gnpn)_{mathrm{e}}diff S_{mathrm{e}}
&quad +int_{S_mathrm{s}}! (gnpn)_{mathrm{s}}diff S_{mathrm{s}}
+int_{S_mathrm{w}}!!(gnpn)_{mathrm{w}}diff S_{mathrm{w}}
end{aligned}
end{equation}
end{document}
Correct answer by Mico on July 16, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP