Code: Select all
\[
6. \quad f(x) = \frac {1} {1+9x^2} \\
f(x) = x^2
\]
Why? The manual claims that a
\\
will instruct the program to create a new line.Code: Select all
\[
6. \quad f(x) = \frac {1} {1+9x^2} \\
f(x) = x^2
\]
\\
will instruct the program to create a new line.NEW: TikZ book now 40% off at Amazon.com for a short time.
Which manual exactly do you mean? And does it tell you that for text or math mode? Can you give a link where to find this manual?gremlint wrote:[…] The manual claims that a\\
will instruct the program to create a new line.
align
, multline
or split
. The package manual should help you on in this regard. In case the package is installed in your TeX system, you have direct access by the command line.
Code: Select all
texdoc amsmath
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
f(x) &= \frac {1} {1+9x^2} \\
&= x^2
\end{align}
\end{document}
&
. In those amsmath multi-line environments, you can break the line by \\
.\[ ... \]
and manually numbering (6. \quad
) I would let LaTeX do the numbering automatically. This allows automatic references if you use \label
and \ref
, or \eqref
from amsmath.I'm using the manual that came with the software, "More Math into LaTeX," by George Gratzer.localghost wrote:Which manual exactly do you mean?
Code: Select all
\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage[parfill]{parskip}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\begin{document}
\begin{align}
f(x) &= \frac {1} {1+9x^2} \\
&= x^2
\end{align}
\end{document}
Code: Select all
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
restricted \write18 enabled.
entering extended mode
(./Alignment Test 2.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,
polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian,
welsh, loaded.
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/texlive/2012/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/local/texlive/2012/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/parskip/parskip.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/local/texlive/2012/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsmath/amsopn.sty))
(./Alignment Test 2.aux)
*geometry* driver: auto-detecting./Alignment Test 2.tex:11: Missing $ inserted.
<inserted text>
$
l.11
?
*geometry* detected driver: pdftex
(/usr/local/texlive/2012/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/ifluatex.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/grfext.sty
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/local/texlive/2012/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd)
Runaway argument?
./Alignment Test 2.tex:11: Paragraph ended before \align was complete.
<to be read again>
\par
l.11
?
No, that's incorrect. The sample file returned errors, as one can plainly see above.localghost wrote:Your example works flawlessly.
I modified the example slightly in my second attempt, and there were still errors.Stefan_K wrote:A minimal example how your equation(s) could be typeset:
Code: Select all
\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage[parfill]{parskip}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\begin{document}
\begin{align}
\[
f(x) &= \frac {1} {1+9x^2} \\
&= x^2
\]
\end{align}
\end{document}
Code: Select all
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
restricted \write18 enabled.
entering extended mode
(./Alignment Test 2.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,
polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian,
welsh, loaded.
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/texlive/2012/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/local/texlive/2012/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/parskip/parskip.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/local/texlive/2012/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsmath/amsopn.sty))
(./Alignment Test 2.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
(/usr/local/texlive/2012/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/ifluatex.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/grfext.sty
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/local/texlive/2012/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsa.f./Alignment Test 2.tex:15: Extra }, or forgotten \endgroup.
<template> }
$}\ifmeasuring@ \savefieldlength@ \fi \set@field \endtemplate
l.15 \end{align}
? d)
(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd)
./Alignment Test 2.tex:15: LaTeX Error: Bad math environment delimiter.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.15 \end{align}
This modification can't work! Bothgremlint wrote:I modified the example slightly in my second attempt, and there were still errors.
Code: Select all
\documentclass[12pt]{article} \usepackage{geometry} \usepackage[parfill]{parskip} \usepackage{graphicx} \usepackage{amssymb} \usepackage{amsmath} \begin{document} \begin{align} \[ f(x) &= \frac {1} {1+9x^2} \\ &= x^2 \] \end{align} \end{document}
\begin{align}
and \[
shift to math mode which effectively means that the second one ends the math mode! Stefan's example is correct and compiles flawlessly. Did you by any chance insert an empty line inside the {align}
environment? That would cause the first error you reported. Empty lines are forbidden in the {align}
environment.Perhaps I should have written that it works for me on my system. So you shouldn't simply claim that my statement is not true. I understood this as a hint that you might face a systematical problem. So a follow-up question might have been suggestive.gremlint wrote:No, that's incorrect. The sample file returned errors, as one can plainly see above.
No, I did not, but thanks for asking. See my first reply to Stefan.cgnieder wrote:Did you by any chance insert an empty line inside the{align}
environment?
NEW: TikZ book now 40% off at Amazon.com for a short time.