The inverse question has been asked in different fashions in this site, see for example , , or . There have been questions that seem to address my own, such as , but when I tried using command \textstyle inside an align environment I don't get the desired result. How can I locally set math to display as inline mode, in particular with regards to limits in summations and integrals, within the align environment? Note that I want to avoid having to use commands such as \nolimits before each symbol. Rather, I would like to set locally the behaviour of an environment instance. The following seems to work: \begin{align} \textstyle \bar{x}=\sum_{i&gt;0}x_i \end{align}  However, the following does not: \begin{align} \textstyle \bar{x}&amp;=\sum_{i&gt;0}x_i \\ \bar{y}&amp;=\sum_{i&gt;0}y_i \end{align}  In fact, as soon as I include an ampersand for alignment purposes, it seems the \textstyle command is ignored.
120540
I'm currently typing a mathematical document which counts many sum symbols. I frequently use the align environment to render equations, although the default behaviour of this environment is to render the equations in displaystyle, which in my opinion wastes vertical space. I therefore have added \textstyle at the beginning of each line of math in this environment, but I'm looking for a more convenient solution.   So is there an environment that is similar to align with the exception it displays textstyle math by default ? Thank you.
114798
I wanted to align a set of equations to left. I found on the Internet that you can do it easily with align* environment.   I found it here:   So I did it:  \begin{align*}  f(b)-f(a)=&amp;f((b_1,b_2,\dots,b_k))-f((a_1,a_2,\dots,a_k))=\ &amp;=\sum_{i=1}^{k}[f((a_1,\dots,a_{i-1},b_i,\dots, b_k))-f((a_1,\dots,a_i,b_{i+1},\dots, b_k))  \end{align*}   Unfortunately, I got bunch of red errors saying that there are missing $s. Why? Doesn't that align* environment provide a math environment already?
123362
Sorry if this is the wrong place to ask this, I'm new to the site :/  My issue is this: when editing in vim, my syntax file highlights underscores and carets when found in non-math text, which is fine, except vim doesn't recognize that "align" is a math environment. What do I need to do to fix this?
87037
My intention is to create equation which looks similar to one of examples below (I prefer the second one).     There should be an arrow from JKL to DEF and GHI and from GHI to DEF.   Neither alignment nor equation environment have to be used. Anything that will do is appreciated. Cheers.
107201
I'm just starting to learn LaTeX. I tried typing \begin{equation*}  (math goes here)  \end{equation*}  and I got a whole bunch of errors. It seems LaTeX interpreted the empty line as the equation: when it saw nothing there, I guess it just ended math mode? It then said my other commands needed $'s so I assume that's what happened. When I typed \begin{equation*} (math goes here) \end{equation*}  everything was fine. So I'm confused. If LaTeX sees an empty line in an environment, does it just interpret this as me changing my mind, and deciding not to use the declared environment?
83022
I know that the align environment labels all the lines, while the align* environment labels none of the lines. Is there a way to have the align environment label only some of the lines?  For example, suppose I have something like this:  \begin{align} x+y  \\ x-y  \\ xy \end{align}   This labels all three lines. Is there a way to only label, say, the second line (x-y)?
85096
Look at the following example  \begin{align}      &amp; x \\      \overset{\text{some long explanation}}= &amp; foo \\      &amp; = bar \end{align}   what is the best way to get the equal signs aligned? Now I have seen different solution such as adding \overset{\hphantom{\ţext{some long explanation}}}= to the beginning of every line, but I don't really think that is the best solution. Any better ideas?    UPDATE  I guess what i am actually after is   aligning the first column of the align environment right aligning the equal sign under the overset text right
83303
I need to display math in my report, but is it possible to remove the vertical space around align*?  A little example is the following (where I just want the align* to have the same vertical space as a \\  \documentclass[10pt,danish,a4paper,oneside,fleqn]{report}  \usepackage[english]{babel} \usepackage{amsmath}  \begin{document}  ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss \begin{align*}   A{\cap}B\ &amp; =\ {\left\{{b,d,e}\right\}}{\;}{\cap}{\;}{\left\{{a,b,f,g}\right\}}   \\   \nonumber\ &amp; =\ {\left\{{b}\right\}} \end{align*} ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss \\ ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss  \end{document}
4175
I have equations inside an environment which has a larger left-margin than the main text (analogous to an enumerate/itemize environment, implemented with the changepage package's adjustwidth environment). Just as equations in enumerate/itemize behave, the equations are centered with respect to the entire text, rather than just the width of the container environment. I want the latter behavior.  I'm trying to accomplish this by wrapping all display-math in minipages. Namely, I'm modifying the mathdisplay environment in amsmath.sty as follows:  \makeatletter \let\oldmd\mathdisplay \def\mathdisplay#1{%   \newline   \begin{minipage}{\textwidth-\@totalleftmargin}%     \oldmd{#1}% } \let\oldendmd\endmathdisplay \def\endmathdisplay#1{%   \oldendmd{#1}%   \end{minipage} } \makeatother   This is almost working, but there are some issues with spacing which I don't understand how to fix. Here's how the the normal \[ ... \] and numbered \begin{equation} ... \end{equation} look with the above modification:      My main confusion is why the numbered version is behaving so differently from the unnumbered. But all in all I want to fix this so that the spacing above and below is even as it usually is. Any help is appreciated, thanks.  Edit: Here's a compilable example:  \documentclass{amsart}  \usepackage{lipsum} \usepackage{calc} \usepackage{changepage}  \makeatletter \let\oldmd\mathdisplay \def\mathdisplay#1{%   \newline   \begin{minipage}{\textwidth-\@totalleftmargin}%     \oldmd{#1}% } \let\oldendmd\endmathdisplay \def\endmathdisplay#1{%   \oldendmd{#1}%   \end{minipage} } \makeatother  \setlength{\parindent}{0pt}  \begin{document}  \lipsum[1]  \begin{adjustwidth}{20pt}{} \lipsum[2] \[ x \mapsto \hom(-,x) \]  \lipsum[3] \begin{equation}   y \mapsto \hom(y,-) \end{equation} \lipsum[4] \end{adjustwidth}  \lipsum[5]  \end{document}
79221
I'm busy answering a question by constructing a new math operator that uses the sum symbol and some TikZ placed on top. My answer as it stands can be found . It looks (I think) pretty good in display style, but too large when shown inline. Even if it automatically set the sum symbol into inline size, the placement of the TikZ would be off.  Is there a way to define different code for when the operator is used in display mathematics environments, and when it's inline? Alternatively, is there a way to detect when you are in display or inline mode?  From the aforementioned example, here is the code I constructed:  \documentclass{minimal} \usepackage{amsmath} \usepackage{tikz}  % Modify the coordinate (-0.3ex,0) to adjust alignment, and (0.1) to adjust the size. \DeclareMathOperator*{\osum}{\ensuremath{     \begin{tikzpicture}[baseline=(char.base), inner sep=0, outer sep=0]         \draw (-0.3ex,0) circle (0.1);          \node (char) at (0,0) {$\displaystyle\sum$};  % Want to define a second symbol for inline...     \end{tikzpicture}}% }  \begin{document}  \[ G=\osum_a^b H \]  And now in inline mode the equation $G=\osum_a^b H$ is obviously too big.  \end{document}
65770
I've been using the align environment to line up equations in proofs/explanations/etc and I like to place parenthetical commentary for each step, similar to the code below:  \documentclass{article} \usepackage{amsmath} \begin{document}  \begin{align*}   f(ax + by) &amp; = f(ax) + f(by) &amp; (By Property 1) \\              &amp; = af(x) + bf(y) &amp; (By Property 2) \\ \end{align*}  \end{document}   The problem I have with this is that the commentary completely distorts the overall alignment of the equation area; far too much space is allocated to the column containing the commentary.  I would like, insofar as it is possible, for the equations themselves to be aligned in the center of the page and for the commentary to simply appear on the right without affecting the overall justification of the equations. What's the best way to achieve this?
94851
I want to set up a macro in TeXstudio for math mode which displays $*$ and places the cursor at position *. So far I have tried using $%|$ but upon triggering, this macro does not allow text insertion at the placeholder.  EDIT: The method above works fine if the macro shortcut is set to the default Shift+F1. However, changing the shortcut to another combination, as I would like to do, seems to be the cause of the problem.
70163
I have an align environment with 5 equations. I want 3 of them numbered, and the other 2 not numbered. I understand that there's other posts on the issue of selective numbering of those equations that are referred to in the body of the text, but that's different to what I'm trying to achieve.  I want the first three lines (equations) of the following to be numbered and the last two to be without numbering. Thanks.  \documentclass[a4paper,11pt]{article} \usepackage[fleqn]{amsmath} \begin{document}  \begin{align} &amp;R_{i,t} = \alpha_i  \\ &amp;R_{i,t} = \beta_i  \\ &amp;R_{i,t} = \gamma_i  \\ &amp;\mathbb{E}[\epsilon_{it}]=0;\textrm{   } \textrm{Var}[\epsilon_{it}]=\sigma^2_{\epsilon_{i}}\\ &amp;i \in \{1,2,...,N\};\textrm{   } t \in \{1,2,...,T\} \end{align}  \end{document}
2671
For some teaching I've been doing, I'd like to have code from two different languages side-by-side.  To do so, I hacked together a newcommand which uses a tabular environment to arrange two verb environments, but the problems are myriad:   Indentation can only be accomplished by changing spaces to ~'s Any math symbols have to be escaped with \, which requires knowing which ones to escape and which ones not to (can't escape the &lt;'s for instance, otherwise it complains) The &lt;- assignment operator gets changed into an upside down !- when compiled.   The listings environment doesn't work either.  Error message is:  Runaway argument? ! Forbidden control sequence found while scanning use of \lst@next. &lt;inserted text&gt;                  \par  l.23 \codeListing{x &lt;- y}{f(g(x))}   Here's some code to reproduce the problem:  \documentclass[english]{article} \usepackage[latin9]{inputenc} \usepackage{geometry} \begin{document}  \newcommand{\codeListing}[2]{ \begin{tabular}{p{8cm} p{8cm}} \begin{lstlisting} #1 \end{lstlisting} &amp; #2\tabularnewline \end{tabular} }  \section{verbatim test} \begin{verbatim} logLik &lt;- function(x) {    y &lt;&lt;- x^2+2   return(sum(sqrt(y+7))) } \end{verbatim}  \section{codeListing test} \codeListing{}{ logLik &lt;- function(x) \{   ~~y &lt;&lt;- x\^2+2  ~~return(sum(sqrt(y+7)))  \}  }  \end{document}   Is there any way to make a newcommand wrap parameter-passed code?  It doesn't have to be keyword-highlighted or do any of the other tricks that the fancier packages do; it just has to preserve whitespace and no interpret code as latex commands.
37160
Near the beginning of the definition of the amsmath environments aligned and gathered (and also mathtools' multlined) there's an explicit thin space \,. This often  has to be cancelled  with  \!, as has been observed  various  times:         I'd like to know why this explicit \, is there &ndash; what would go wrong without it?    From amsmath.dtx:  \newcommand{\start@aligned}[2]{%     \RIfM@\else         \nonmatherr@{\begin{\@currenvir}}%     \fi     \savecolumn@ % Assumption: called inside a group %    \end{macrocode} %    The \cs{null} here is to keep the \cs{,} glue from causing the %    invocation of the clause in \tex/'s built-in tag placement %    algorithm that can cause an equation to be shifted all the way over %    to the margin. %    \begin{macrocode}     \null\,%
111451
By default the style is  \renewcommand{\theequation}{\thechapter.\arabic{equation}}   for example                  x+y =4         (2.1)   How to put \dots in front equation numbering such as              x+y =4      ...(2.1)   while in the text reference remain (2.1).  and how to make it for the array by using \begin{eqnarray} \end{eqnarray}        x = y+ 4                   -Z+ E                  + 4gh     ...(2.1)
81540
\begin{equation}     \begin{aligned}         [c\mathbf{v}+c'\mathbf{v}',\mathbf{w}]=&amp;c[\mathbf{v},\mathbf{w}]+c'[\mathbf{v}',\mathbf{w}],\\         [\mathbf{v},c\mathbf{w}+c'\mathbf{w}']=&amp;c[\mathbf{v},\mathbf{w}]+c'[\mathbf{v},\mathbf{w}'],     \end{aligned} \end{equation}   In this code, [c\mathbf{v}+c'\mathbf{v}',\mathbf{w}] is not shown in the equation. Is it because of the aligned environment? How to fix it?