Quel est le problème avec cet alignement?
Quel est le problème avec cet alignement?
Le contexte:
Tout d'abord, toutes mes excuses pour le long post.
J'utilise donc l'environnement d'alignement pour la première fois dans mon document d'article LaTex, mais pas avec beaucoup de succès. Voici mon préambule pour mon document d'article:
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{parskip}
\usepackage[margin=1.25in]{geometry}
\usepackage[shortlabels]{enumitem}
\usepackage{graphicx}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{1pt}
\addtolength\parskip{3ex}
\fancyhfoffset{0.2cm}
\pagestyle{fancy}
\rfoot{Redacted}
\setcounter{secnumdepth}{4}
\addtolength{\footskip}{0.2in}
\newtheorem*{theorem}{\sc{Theorem}}
\newtheorem*{definition}{\sc{Definition}}
\newtheorem*{proposition}{\sc{Proposition}}
\newtheorem*{corollary}{\sc{Corollary}}
\newtheorem*{claim}{\sc{Claim}}
\newtheorem*{properties}{\sc{Properties}}
\newtheorem*{remark}{\sc{Remark}}
\DeclareMathOperator{\N}{\mathbb{N}}
\DeclareMathOperator{\Z}{\mathbb{Z}}
\DeclareMathOperator{\Q}{\mathbb{Q}}
\DeclareMathOperator{\R}{\mathbb{R}}
\DeclareMathOperator{\C}{\mathbb{C}}
\begin{document}
Question
Dans cet article, je voulais aligner certaines équations, j'ai donc utilisé le code suivant basé sur certains guides en ligne:
We can now use the Pythagorean Theorem to find PE in two different equations which utilise $x$ and hence solve for $x$:
\emph{From $\triangle$PEB:}
\begin{align*}
PE &= $\sqrt{BP^2 - x^2}$ \\
&= $\sqrt{10^2 - x^2}$ \\
&= $\sqrt{100 - x^2}$
\end{align*}
Cependant, j'obtiens ceci comme résultat:
Et le journal des erreurs semble aussi se corriger en me corrigeant (c'est-à-dire qu'il corrige quelque chose puis essaie de corriger cette correction qu'il pense être incorrecte ... vous savez quoi? Il suffit de regarder le journal :)
! Missing } inserted.
<inserted text>
}
l.65 \end{align*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing $ inserted. <inserted text> $
l.65 \end{align*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing { inserted.
<inserted text>
{
l.65 \end{align*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Extra }, or forgotten $. <recently read> } l.65 \end{align*} I've deleted a group-closing symbol because it seems to be spurious, as in `$x}$'. But perhaps the } is legitimate and you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'. ! Missing $ inserted.
<inserted text>
$ l.65 \end{align*} I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. ! Missing } inserted. <inserted text> } l.65 \end{align*} I've inserted something that you may have forgotten. (See the <inserted text> above.) With luck, this will get me unwedged. But if you really didn't forget anything, try typing `2' now; then my insertion and my current dilemma will both disappear. ! Missing } inserted. <inserted text> } l.65 \end{align*} I've inserted something that you may have forgotten. (See the <inserted text> above.) With luck, this will get me unwedged. But if you really didn't forget anything, try typing `2' now; then my insertion and my current dilemma will both disappear. ! Missing $ inserted.
<inserted text>
$ l.65 \end{align*} I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. ! Missing { inserted. <inserted text> { l.65 \end{align*} I've put in what seems to be necessary to fix the current column of the current alignment. Try to go on, since this might almost work. ! Extra }, or forgotten $.
<recently read> }
l.65 \end{align*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases the way to recover is to insert both the forgotten and the deleted material, e.g., by typing `I$}'.
! Missing $ inserted. <inserted text> $
l.65 \end{align*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.65 \end{align*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.65 \end{align*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing $ inserted. <inserted text> $
l.65 \end{align*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing { inserted.
<inserted text>
{
l.65 \end{align*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Extra }, or forgotten $. <recently read> } l.65 \end{align*} I've deleted a group-closing symbol because it seems to be spurious, as in `$x}$'. But perhaps the } is legitimate and you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'. ! Missing $ inserted.
<inserted text>
$ l.65 \end{align*} I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. ! Missing } inserted. <inserted text> } l.65 \end{align*} I've inserted something that you may have forgotten. (See the <inserted text> above.) With luck, this will get me unwedged. But if you really didn't forget anything, try typing `2' now; then my insertion and my current dilemma will both disappear. ! Missing } inserted. <inserted text> } l.65 \end{align*} I've inserted something that you may have forgotten. (See the <inserted text> above.) With luck, this will get me unwedged. But if you really didn't forget anything, try typing `2' now; then my insertion and my current dilemma will both disappear. ! Missing $ inserted.
<inserted text>
$ l.65 \end{align*} I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. ! Extra }, or forgotten $.
<recently read> }
l.65 \end{align*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases the way to recover is to insert both the forgotten and the deleted material, e.g., by typing `I$}'.
! Missing $ inserted. <inserted text> $
l.65 \end{align*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.65 \end{align*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.65 \end{align*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Misplaced \omit.
\math@cr@@@ ...@ \@ne \add@amps \maxfields@ \omit
\kern -\alignsep@ \iftag@ ...
l.65 \end{align*}
I expect to see \omit only after tab marks or the \cr of
an alignment. Proceed, and I'll ignore this case.
! Missing { inserted.
<inserted text>
{
l.65 \end{align*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Missing } inserted.
<inserted text>
}
l.65 \end{align*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing $ inserted. <inserted text> $
l.65 \end{align*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Extra }, or forgotten $. <recently read> } l.65 \end{align*} I've deleted a group-closing symbol because it seems to be spurious, as in `$x}$'. But perhaps the } is legitimate and you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'. ! Missing $ inserted.
<inserted text>
$ l.65 \end{align*} I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. ! Missing \endgroup inserted. <inserted text> \endgroup l.65 \end{align*} I've inserted something that you may have forgotten. (See the <inserted text> above.) With luck, this will get me unwedged. But if you really didn't forget anything, try typing `2' now; then my insertion and my current dilemma will both disappear. ! Missing } inserted. <inserted text> } l.65 \end{align*} I've inserted something that you may have forgotten. (See the <inserted text> above.) With luck, this will get me unwedged. But if you really didn't forget anything, try typing `2' now; then my insertion and my current dilemma will both disappear. ! Misplaced \omit. \math@cr@@@ ...@ \@ne \add@amps \maxfields@ \omit \kern -\alignsep@ \iftag@ ... l.65 \end{align*} I expect to see \omit only after tab marks or the \cr of an alignment. Proceed, and I'll ignore this case. ! Missing { inserted. <inserted text> { l.65 \end{align*} I've put in what seems to be necessary to fix the current column of the current alignment. Try to go on, since this might almost work. ! Missing } inserted. <inserted text> } l.65 \end{align*} I've inserted something that you may have forgotten. (See the <inserted text> above.) With luck, this will get me unwedged. But if you really didn't forget anything, try typing `2' now; then my insertion and my current dilemma will both disappear. ! Missing $ inserted.
<inserted text>
$ l.65 \end{align*} I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. ! Extra }, or forgotten $.
<recently read> }
l.65 \end{align*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases the way to recover is to insert both the forgotten and the deleted material, e.g., by typing `I$}'.
! Missing $ inserted. <inserted text> $
l.65 \end{align*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.65 \end{align*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.65 \end{align*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Misplaced \omit.
\math@cr@@@ ...@ \@ne \add@amps \maxfields@ \omit
\kern -\alignsep@ \iftag@ ...
l.65 \end{align*}
I expect to see \omit only after tab marks or the \cr of
an alignment. Proceed, and I'll ignore this case.
! Missing { inserted.
<inserted text>
{
l.65 \end{align*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
Donc, fondamentalement, tout ce que le journal des erreurs a fait était de me dérouter, et je ne sais pas trop quoi faire. Aide appréciée pour résoudre ce problème!
Merci!
Réponses
Donc, comme indiqué dans les commentaires, il s'agit d'une solution relativement simple - en d'autres termes une réponse relativement courte pour un long post :):
L' alignenvironnement, de par sa nature même, est déjà en mode mathématique , ne l'utilisez donc pas $. La suppression des $rendements de votre sortie souhaitée.
c'est à dire
We can now use the Pythagorean Theorem to find PE in two different equations which utilise $x$ and hence solve for $x$:
\emph{From $\triangle$PEB:}
\begin{align*} PE &= \sqrt{BP^2 - x^2} \\ &= \sqrt{10^2 - x^2} \\ &= \sqrt{100 - x^2} \end{align*}