I'm using tufte-book and would like to define and environment that is fullwidth but also align-ed (from amsmath).  I've tried doing this with   \newenvironment{walign}{     \begin{fullwidth}\begin{align} }{     \end{align}\end{fullwidth} }   and this visually seems to work, but the compiler throws compilation errors;  LaTeX Error: \begin{align} on input line 35 ended by \end{walign}.  See the LaTeX manual or LaTeX Companion for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.37 \end{walign}  Your command was ignored. Type  I &lt;command&gt; &lt;return&gt;  to replace it with another command, or  &lt;return&gt;  to continue without it.   main.tex, line 39 LaTeX Error: \begin{list} on input line 35 ended by \end{document}.  See the LaTeX manual or LaTeX Companion for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.39 \end{document}  Your command was ignored. Type  I &lt;command&gt; &lt;return&gt;  to replace it with another command, or  &lt;return&gt;  to continue without it.   Minimal working example;  \documentclass[     a4paper,     nofonts,     justified ]{tufte-book}  \usepackage{amsmath}  \newenvironment{walign}{     \begin{fullwidth}\begin{align} }{     \end{align}\end{fullwidth} }  \begin{document}  This paragraph and the below \texttt{align} environment are regular-width, and leave space for a margin notes column to the right. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vel facilisis volutpat est velit egestas dui id. Tempor nec feugiat nisl pretium fusce id. Venenatis tellus in metus vulputate eu. Quam elementum pulvinar etiam non quam lacus. Facilisi cras fermentum odio eu feugiat pretium nibh ipsum consequat. Sed lectus vestibulum mattis ullamcorper velit sed ullamcorper.  \begin{align}     Z_\theta &amp;= \sum_{\tau \in T} q(\tau) e^{R(\tau)} \end{align}  \begin{fullwidth}     This paragraph and the below \texttt{align} environment are full-width, and bleed into the margin notes column.     Magna eget est lorem ipsum dolor sit amet. Enim eu turpis egestas pretium aenean pharetra magna. Massa placerat duis ultricies lacus. Cras ornare arcu dui vivamus arcu. Urna molestie at elementum eu facilisis sed odio morbi. Odio ut sem nulla pharetra diam sit amet nisl. Eu facilisis sed odio morbi quis commodo odio aenean. Mi tempus imperdiet nulla malesuada pellentesque elit. Id aliquet lectus proin nibh. Pulvinar sapien et ligula ullamcorper malesuada proin.      \begin{align}         Z_\theta &amp;= \sum_{\tau \in T} q(\tau) e^{R(\tau)}     \end{align} \end{fullwidth}  I would like to define a custom environment `\texttt{walign}' that creates a \texttt{fullwidth}, \texttt{align}-ed environment, but doing so with \verb+\newenvironment{}{}+ gives compilation errors whenever I use the environment;  \begin{walign}     Z_\theta &amp;= \sum_{\tau \in T} q(\tau) e^{R(\tau)} \end{walign}  \end{document}   What is the correct syntax / usage of the \newenvironment{}{} command?
27962
In the example below, an error is caused by \begin{align} and \end{align} but I do not see why:  \documentclass{book} \usepackage{amsmath} \newenvironment{subalign}{\begin{subequations}\begin{align}}{\end{align}\end{subequations}} \begin{document} \begin{subalign}      a&amp;=b\\     &amp;=b \end{subalign} \end{document}
88417
I am stuck with a LaTeX glitch! I am making an exercise on sequences and series. I have to write down an expression for the general form of a sequence for which I need large delimiters. I tried various ways but it did not work.   Here is a minimal example.  \documentclass[a4, 14pt]{extarticle}  \begin{document}  \begin{align}  \[ \left{        \frac{(-1)^{n}}{n}     \right}_{n=1}^{\infty}  \]  \end{align}  \end{document}   I tried $$ .... $$, \[ ... \], and \begin{align} ... \end{align} but all returned errors on compiling. I don't know how to fix this!
42927
I know from the  that it is not possible to introduce direct abbreviations like \newcommand{\bal}{\begin{align}} % doesn't work \newcommand{\eal}{\end{align}}   % doesn't work  or \newcommand{\bal}{\align}    % doesn't work \newcommand{\eal}{\endalign} % doesn't work  What is puzzling me is that \newenvironment{foo}{\align}{\endalign}  does work, at least if one is well-behaved enough to diligently type \begin{foo}...\end{foo}, since \foo...\endfoo won't work either. I'd really appreciate some help to shed some light on what is going on behind the scenes :-)
10375
I have a very long equation that must be separated into two lines, and it has several pairs of nesting \left \right delimiters. Unfortunately, it seems that they need to be on the same line in order for them to work.  Also I'm using the align environment because I need the aligning functionality. Is there a way to have the size of delimiters automatically adjusted over multiple lines?
24114
Is there an easy method to compile a LaTeX document ignoring contents of \begin{figure} ... \end{figure} blocks altogether?   I am looking for an equivalent for draft and demo options (as in \documentclass[demo]{article} or \usepackage[draft]{graphics}) that will ignore figure environment completely. Specifically, don't want to see any placeholders nor figure captions, just continuous text.   Is there a way to do the same thing for table environments?
93051
I have a long equation in LaTeX, which I need to break up into more lines. I've done this, although its not quite what I was looking for. Here is a MWE showing my problem:  \documentclass[10pt]{article}  \usepackage[T1]{fontenc} \usepackage{amsmath, amsthm, amssymb} \usepackage[ansinew]{inputenc}  \begin{document} \begin{equation}   \begin{aligned}         \alpha &amp;= 1 &amp;&amp;+ 2     \\                &amp;    &amp;&amp;- 3 + 4 \\                &amp;= 4 \\                &amp;=5-1,   \end{aligned} \end{equation} \end{document}   So there is a long equation broken into 2 lines, followed by 2 short lines. Here is what I desire:   There should be an equation label for each equality sign, so 3 in total. At the moment there is only one The "+2" and "-3+4"-parts are aligned right, which distorts the whole equation. I'm not quite sure why it is doing that, I haven't told it explicitly to do so.   Is there a way to correct these errors?    EDIT: Original output looks like
92241
My problem is that I would like to write something like in LaTeX:   But I can't seem to do it wihtout reading like:   Which is pretty anoying to do all the time, in the middle of writting. Is there a code to do it for a whole paragraph without written \hspace*{1,5 cm} in middle of a sentence
47149
I'm working on my thesis, and I've realized that, any time I try to use \( \)-type inline delimiters in captions, that pdflatex breaks. While I can weasel out of actually \needing\ math in my captions, it's very inconvenient. I'm pretty perplexed.  Here's a (relatively) minimal example that breaks for me:  \documentclass{uafthesis}  \usepackage{amsmath} \usepackage{graphicx} % Graphics stuff  \begin{document}  \listoffigures  \begin{figure}[h] \centering \includegraphics[width=0.3\textwidth]{angle.png} \caption{\(\theta \)} \end{figure}   \end{document}   Here's a sample of the output:     ! LaTeX Error: Bad math environment delimiter.      See the LaTeX manual or LaTeX Companion for explanation.   Type  H   for immediate help.    ...                                                    l.1 ...k or  to continue without it.}}}{2}      ?    ! Extra }, or forgotten $.    ...r  to continue without it.}}      l.1 ...k or  to continue without it.}}}{2}      ?    Some things:   uafthesis is the unofficial official document class for my university. It has been written mostly by physics grad students by hacking at other document classes. My fork is . This only happens if I include amsmath. The minimal example and the resulting log file are gisted .   I'm defending tomorrow, and I have to turn in my thesis pretty soon, so hopefully we can figure this out within a day or so! If not, I understand, and thanks anyway.
75501
I'm using the \align* environment from the amsmath package.  How can I center one of the lines inside the environment?  In the following example, I want to the \vdots to be centered, instead of awkwardly aligned with the b above it.  \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} &amp; a = (a_1, a_2) \\ &amp; b = (b_1, b_2) \\ &amp; \vdots \\ &amp; z = (z_1, z_2) \end{align*} \end{document}
11225
I have a question about making an ending symbol.  It is a LaTex-default that every proof environment has an ending symbol. I want to make every theorem-alike environment such as the example environment have also an ending symbol. But how to manually set this up? Specifically, I want to make all these environments ended by a square symbol.  \newtheorem{thm}{Theorem} \newtheorem{lem}[thm]{Lemma} \newtheorem{cor}[thm]{Corollary} \newtheorem{pro}[thm]{Proposition} \newtheorem{assump}{Assumption} \newtheorem{axiom}{Axiom} \newtheorem*{conj}{Conjecture} \theoremstyle{definition} \newtheorem{defi}[thm]{Definition} \newtheorem{exam}{Example} \newtheorem{exer}{Exercise} \newtheorem*{rem}{Remark} \newtheorem*{notation}{Notation} \newtheorem*{note}{Note}   I am looking for, with gratitude, a comprehensive setup.
2783
Related (but not the same):         Earlier today I asked a question about aligning equations in an enumerate environment and got an answer that seemed to work for the example I gave, but it turns out I wasn't really specific enough for my problem.  I'm using align* environments, often as the only part of a list item. (If you're wondering why I'm not using more words to introduce the align*, these are mostly homework solutions where most of the work is algebra, etc.)  Here's my code and what it makes (above the middle line):  \begin{enumerate}   \item \begin{align*}     x^2 + y^2 &amp;= x^2 + (iy)^2 \\               &amp;= (x + iy) (x - iy)   \end{align*}   \item \begin{align*}     \frac{1}{n^2-4} &amp;= \frac14 \frac{4}{(n-2)(n+2)} \\                     &amp;= \frac14 \left( \frac{1}{n-2}-\frac{1}{n+2} \right)   \end{align*} \end{enumerate}     I'm trying to make the baseline of the first line of the align* environment the same as the number's baseline—I want the first line of the align* to have the same vertical position (centered horizontally in the same way) relative to its number as in the second half of my picture. (Side question: why is there so much space before the align* starts?)
27835
I have a document class test.cls, in which I have defined a custom environment myenvironment using the environ package as follows:  \NeedsTeXFormat{LaTeX2e} \ProvidesClass{test} \LoadClass{article} \RequirePackage{changepage} \RequirePackage{environ} \NewEnviron{myenvironment}{     \begin{adjustwidth}{10pt}{10pt}         \BODY     \end{adjustwidth} }   Now if I try to use tikz-cd inside myenvironment, it fails, e.g. this gives an error:  \begin{myenvironment}     \[\begin{tikzcd}         1 \ar[r] \ar[d] &amp; 2 \ar[d] \\         3 \ar[r] &amp; 4 \\     \end{tikzcd}\] \end{myenvironment}   On the other hand, if I simply write it like this—that is, I substitute what the environment would do—, everything is fine:  \begin{adjustwidth}{10pt}{10pt}     \[\begin{tikzcd}         1 \ar[r] \ar[d] &amp; 2 \ar[d] \\         3 \ar[r] &amp; 4 \\     \end{tikzcd}\] \end{adjustwidth}   What could be the problem?
16244
The first time I learnt LaTeX, I thought \newcommand properly fits for inline mode and \newenvironment for displayed mode.  Later I noticed it is not correct. So the question is   What is the rule of thumb when deciding whether we should use one over the other one?
95968
I want to use an environment defined with NewEnviron from  in another environment definition:  \documentclass{article}  \usepackage{environ}  \NewEnviron{inner}[1]{%   \textbf{#1:} \BODY }  \newenvironment{out}{%   \begin{inner}{Using outer}% }{%   \end{inner}% }  \begin{document}   \begin{inner}{Using inner}     Lorem ipsum\ldots   \end{inner}    \begin{out}     Lorem ipsum\ldots   \end{out} \end{document}   The resulting PDF looks as desired:    But the log shows some erros:  ./test.tex:22: LaTeX Error: \begin{inner} on input line 20 ended by \end{out}.  ...                                               l.22 \end{out}  ./test.tex:23: LaTeX Error: \begin{out} on input line 20 ended by \end{document }.  ...                                                   l.23 \end{document}  ... (\end occurred inside a group at level 1)  ### semi simple group (level 1) entered at line 20 (\begingroup) ### bottom level   If I define out using NewEnviron, that is  \NewEnviron{out}{%   \begin{inner}{Using outer}%     \BODY   \end{inner}% }   then pdflatex does not terminate.  Apparently, something is mixed up (presented to the parser in the wrong order). What is going wrong?
64234
A number of related questions have already been asked about this issue:       and even    But I'm still confused by the conflicting suggestions that have been given so far. So I'm trying again.  Which should be the preferred command to produce a displayed equation in my LaTeX documents?  So far the suggestions indicate that one should use \[ ... \], maybe \begin{equation*} ... \end{equation*}, or maybe even the gather* or align* environments from amsmath.  And one should definitely avoid using either $$...$$ or the eqnarray environment.  Now I have to say that, from a language perspective, I have a strong preference for the equation* environment because it is less cryptic than the \[ ... \] notation and it is  the most accurate.  So, is it fine to use equation*? Maybe only after loading amsmath? Or should the equation/equation* environment be redefined to something else so that spacing, package support, or whatever is improved?
50721
Is there a TeX command that returns the width of a given text as length value, so that I can use the result directly as a length argument of another command?  I mean, I would like to have a command \getWidth{my text} and want to use the result directly as the first argument of \parbox:  \parbox{\getWidth{my text}}{my foo\\bar text}
79301
Consider the following code example:  \setuppapersize[A8,landscape][A8,landscape] \starttext \startformula     \startalign         \NC 1 \NC= 1\NR         \NC 2 \NC= 1\NR         \NC 3 \NC= 1\NR         \NC 4 \NC= 1\NR         \NC 5 \NC= 1\NR         \NC 6 \NC= 1\NR         \NC 7 \NC= 1\NR         \NC 8 \NC= 1\NR     \stopalign \stopformula \stoptext   Coming from a LaTeX background I would expect align to break over pages and  tells me     Somewhere between March and Arpril, \startalign lost the ability to break equations across pages. Hopefully, it will be added back soon.   So basically it is intended to have page breaks, isn't it? Question: How to enable them for align?