Tag Info

New answers tagged

0

We would use \label{labelname} on a line (before the \\ command) to label a particular line. It is conventional to use the \eqref command in order to automatically wrap the reference with parentheses. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{amsmath,amsthm,amssymb,mathtools} \begin{document} \begin{alignat}{2} \sigma_1 &= x + y ...


2

I take it you're using a figure* environment because your document is typeset in two columns per page and you wish to let the equations span both columns. (Please advise if this hunch is incorrect.) At any rate, you also need a suitable math environment for the three equations that span five lines. I suggest you use the align environment of the amsmath ...


4

Are you looking for the alignat environment? I hope that the margins of your document are not too large otherwise the last two lines won't fit in the line.... MWE \documentclass[10pt]{article} \usepackage{amsmath} \usepackage[margin=2cm]{geometry} \begin{document} \begin{figure*} \label{eq:eq1} \begin{alignat}{2} &E_{\mathrm{access}} && = ...


3

If space constraints are really tight, you can reduce the size using smallmatrix, but it's better avoiding it as long as possible. I have also introduced some changes to the input. Notably \textbf has been changed into \mathbf; flalign with \notag in all lines is align* (there's no point in using flalign anyway, in this case); for the partial derivative, ...


4

I would try to linebreak in preference to changing font size, perhaps: \documentclass[a4paper,twocolumn]{article} \raggedbottom \usepackage{amsmath} \begin{document} \noindent X\dotfill X \begin{flalign} \notag J_{G}(\textbf{x}) &= \frac{\partial G}{\partial \textbf{x}} = \frac{\partial }{\partial \textbf{x}}(\mathbf{RP_{i}+T-Q_{i}})\\[\jot] \notag ...


1

Or the aligned one: \documentclass{article} \usepackage{mathtools} \begin{document} \[ \begin{aligned} \mathrm{Unit.Sales}_{t} = \alpha &+ \beta_{1} \mathrm{Date}_{t} \\ &+ \beta_{2} \mathrm{Cable.TV}_{t} \\ &+ \beta_{3} \mathrm{Int.Display}_{t} \\ &+ \beta_{4} ...


3

If you want the equations to be in display mode (i.e, set on their own line you can achieve your desired results with the align* environment: Notes: The mathtools package loads the amsmath and provides some fixes. Code: \documentclass{article} \usepackage{mathtools} \begin{document} \begin{align*} \mathrm{Unit.Sales}_{t} = \alpha &+ ...


2

Here is how I would do it: \documentclass{article} \usepackage{mathtools} \newcommand*\Vector[1]{\mathbf{#1}} \DeclarePairedDelimiter{\norm}{\lVert}{\rVert} \DeclarePairedDelimiter{\something}{\lbrack}{\rbrack} \begin{document} \noindent Either \begin{alignat}{2} \norm{\Vector{R}}_{F}^{2} &\le \norm{\Vector{R}}_{F}^{2} + \lambda ...


5

You can add some negative space, for example \hspace*{-1em} before the last = MWE \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb} \begin{document} \begin{align} \Vert\mathbf{R}\Vert_F^2 & \le \Vert\mathbf{R}\Vert_F^2 +\lambda\Vert \mathbf{B}^{'}\Vert_F^2-\sum_{k=1}^{m}\Vert \mathbf{B}^{'}\mathbf{A}\Vert_F^2 & \hspace*{-1em} ...


4

With tikzmark \documentclass{article} \usepackage{amsmath,tikz} \newcommand{\tikzmark}[2]{\tikz[overlay,remember picture] \node[minimum width=1.5em] (#1) {#2};} \begin{document} \begin{equation} A= \begin{pmatrix} 1 & -1 & 0 & 0 & 0 & \dots\\ 0 & 1 & -1 & 0 & 0 &\dots\\ 1 & 0 & -1 & 0 & 0 ...


4

Here's one way with using a \smashed \fbox around a dropped \rule. EDITED to provide a colored box. \documentclass{article} \usepackage{amsmath,xcolor} \fboxrule=1pt \begin{document} \begin{equation} A= \begin{pmatrix} 1 & -1 & 0 & 0 & 0 & \dots\\ 0 & 1 & -1 & 0 & 0 &\dots\\ 1 & 0 & -1 & 0 & 0 ...


0

Try, if this you can accommodate in two column format of IEEE (since you didn't provide MWE, i don't know the paper size, etc). \documentclass[12pt]{article} \usepackage{empheq} \usepackage[active,displaymath,tightpage]{preview} \setlength\PreviewBorder{1em} \begin{document} \begin{equation} LD(a_{x},b_{y}) \begin{cases} \max(x,y) ...


3

Use the & symbol before each expression. For example to align: \begin {aligned} \sum^{n}_{i=1} K=0\\ a^2+b+c=0\longrightarrow\Psi \end{aligned} Which is: Use & at the beginning to align them left: \begin {aligned} &\sum^{n}_{i=1} K=0\\ &a^2+b+c=0\longrightarrow\Psi \end{aligned} And obtain: Or use it before whathever you ...


6

Just use the cases environment: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{mathtools} \begin{document} \begin{equation} \begin{dcases} \hat a \sum x^2_i + \hat b \sum x_i = \sum x_i \cdot y_i,\\ \hat a \sum x_i + n \cdot \hat b =\sum y_i.\\ \end{dcases} \end{equation} \end{document}


0

Following your question-answer, I thought "why not just use an align instead of two equations?". I tried it out and it worked, so here it is. Note: \DeclarePairedDelimiterXPP just won't work for me. I must have an outdated mathtools. You can put it back in. I substituted it with E\big[ and E[. \documentclass[12pt, a4paper] {article} \usepackage{mathtools} ...


0

Thanks, Bernard for your help. However I do encounter another problem now aligning this equations with my previous ones. \documentclass[12pt, a4paper] {article} \usepackage{mathtools} \DeclareMathOperator{\var}{var} \usepackage{mathdesign} \renewcommand{\vec}[1]{\mathbf{#1}} \providecommand\given{} \DeclarePairedDelimiterXPP\EV[1]{E}[]{}{ ...


1

You can use the multlined environment from mathtools. I also defined an \EV command, that works with a given command (following an example in the mathtools documentation). It has a simple syntax (\EV{A \given B} and gives a correct spacing for the Expected Value, and has delimiters and vertical line that adapt to the contents size in the star version; ...


1

i was stopped short by the error ! Double superscript. which was caused by several instances of this sub/superscript combination: \vec{X}^*_{i}' the ^* and ' are both superscripts, and, although this may not be immediately obvious, tex wants to consider them as a single group. so either precede the apostrophe (prime) by an empty group {} to separate it ...


1

Insert a \phantom equality sign (with appropriate spacing around it - as in {}={}) and add \qquad to push that part of the equation to the right. Here is a mock-up of what it will look like, using strutted boxes to represent your equation components: \documentclass{article} \usepackage{amsmath} ...


3

I can't read the image very well. This uses bm and \tau. I've also replaced x with \times. I've also added some potentially useful packages - remove any you don't want. I've used Latin Modern just for the example because mathdesign didn't display well in my viewer with the default settings and I didn't want to mess around with it. \documentclass[12pt, ...


4

the image shows a rather inconsistent font choice using bold upright roman and bold slanted greek for vectors. Perhaps the simplest way to achieve that is using bm package and \newcommand\vec[1]{\bm{\mathrm{#1}} then \vec{R} and \vec{\theta} should do the right thing


6

You are better off with bm package and \renewcommand{\vec}[1]{\bm{#1}} Code: \documentclass[12pt, a4paper] {article} \usepackage{amsmath} \usepackage{bm} \DeclareMathOperator{\var}{var} \usepackage{mathdesign} \renewcommand{\vec}[1]{\bm{#1}} \begin{document} \begin{equation} \begin{gathered} R_{i\tau} = \alpha_{i} + \beta_{i} R_{m\tau} + ...


3

You can set anything inside an equation, including a \parbox (or other textual components like a minipage or tabular). Here's an example: \documentclass{article} \usepackage{lipsum,amsmath} \begin{document} This is a displayed quote. \begin{equation} \tag{A}\label{eq:A} \parbox{\dimexpr\linewidth-4em}{% \strut \lipsum*[1]% \strut } ...


4

I suggest three strategies. The first one is to define a command \iheq that prints an equals sign with some padding to become the same width as \overset{\mathrm{IH}}{=}, which can be simply obtained with \iheq*. The second strategy is adding “(IH)” to the side. \documentclass{article} \usepackage{amsmath} \usepackage{xparse} ...


4

You can use \mathmakebox or \mathclap (thanks to Andrew) from mathtools \documentclass{article} \usepackage{mathtools} \begin{document} \begin{equation*} \begin{split} S_n &= 2^iS_{n-i}+2^i-1\\ &\stackrel{\mathmakebox[\widthof{=}]{\mathrm{IH}}}{=} 2^i(2^1S_{n-i-1}+2^1-1)+2^i-1\\ &= ...


5

No need for extra packages. The printing of section numbers is performed by the internal command \@seccntformat. If we redefine it to do nothing, the number will not appear. \documentclass[10pt,a4paper]{article} \usepackage{amsmath} %Command to not display numbers of sections and subsections... \makeatletter \renewcommand{\@seccntformat}[1]{} \makeatother ...


8

You should not redefine thesection etc in to nothing. But redefine the sectional levels using titlesec \usepackage{titlesec} \titleformat{\section} {\normalfont\Large\bfseries}{}{0em}{} \titleformat{\subsection} {\normalfont\large\bfseries}{}{0em}{} \titleformat{\subsubsection} {\normalfont\normalsize\bfseries}{}{0em}{} \titleformat{\paragraph}[runin] ...


2

I'm not really sure you want to do it, because it will be confusing your reader. \documentclass{scrbook} \usepackage{amsmath,mathtools} \begin{document} \begin{equation} \begin{pmatrix} a \\ b \\ c \end{pmatrix}_{\!\!\mathrlap{\mathrm{SCR}}} = x \end{equation} \end{document} The \!\! is for moving the subscript nearer the parenthesis (I always use ...


3

Another solution, using the clap and \underbracket commands, from mathtools, and the alignat environment: \documentclass[a4paper, 11pt]{book} \usepackage[utf8]{inputenc} \usepackage{mathtools} \usepackage{stackengine} \setstackEOL{\\} \begin{document} \begin{alignat}{2} 3.0 & = & & x + y \\ 1.5 & =2 & & x-y \\ ...


2

\begin{align} 3 =& x + y \tag{1} \\ 1.5 =& 2x - y \tag{2} \\ \underbrace{0.2} =& \underbrace{x - y} \tag{3} \\ n\text{ observations} \phantom{=}& u\text{ unknowns} \notag \end{align}


5

I used align for the basic equation work and stackengine for the undertext, since it allows for ignoring the width of the undertext. \documentclass{article} \usepackage{amsmath,stackengine} \def\useanchorwidth{T} \stackMath \begin{document} \begin{align} 3.0 &= \phantom{2}x + y\\ 1.5 &= 2x - y\\ ...


4

Use gathered and not aligned: \documentclass{article} \usepackage{amsmath} \DeclareMathOperator{\var}{var} \begin{document} \begin{equation} \label{eq: market model} \begin{gathered} R_{it} = \alpha_{i} + \beta_{i} R_{mt} + \varepsilon_{it} \\ E(\varepsilon_{it} = 0) \qquad \var(\varepsilon_{t}) = \sigma_{\varepsilon_{it}}^2 \end{gathered} \end{equation} ...


3

This can go wrong if the figure floats after LaTeX has typeset other numbered equations, but here it is anyway: \documentclass{scrreprt} \usepackage{amsmath, amssymb,siunitx} \begin{document} \begin{equation} \label{eq:periodischefunktion} f(t)=f(t+T), \end{equation} \begin{figure}[ht] \renewcommand*\figurename{Gleichung} \makeatletter ...


2

(Answer based on this post and @egreg's comment that the subequations environment management has changed.) You can force the top-level label of the subequations environment to be treated as an equations-environment label through an optional argument to \label: \begin{subequations} \label[equation]{eqlabel} [...] \end{subequations} Your MWE would look ...


5

Here's an answer using Tikz: I created two new environments, spanrecto and spanverso, which should be placed on their respective pages with identical content, to create the appearance of something spanning both pages. What's actually going on is I'm making a mintage 16 inches wide, and then positioning it so that half the text is on the page, and half is ...


4

How about: \documentclass{article} \usepackage{array,ragged2e} \newcolumntype{P}{>{\RaggedRight\arraybackslash}p{0.25\textwidth}} \begin{document} \[ \left(\begin{array}{P} the marginal utility of doing so and so given this and that \end{array}\right) = \left(\begin{array}{P} the marginal utility of doing so and so given this and that ...


3

\[ \parbox{.25\textwidth}{something...} = \parbox{.25\textwidth}{something...} \times \parbox{.25\textwidth}{something...} \]


4

It is also possible to put the equation into the brackets and then use the \middle/ instead of the regular slash. So, for example, this equation: \int \limits_{a}^{b} \frac{x}{y} / \int \limits_c^d \frac{x}{y} would turn into this one: \left[ \int \limits_{a}^{b} \frac{x}{y} \middle/ \int \limits_c^d \frac{x}{y} \right] Or if you do not need any ...


1

I think you're looking for the \tag macro, which is provided by the amsmath package. E.g., \documentclass{article} \usepackage{amsmath} % for "\tag" macro \begin{document} \begin{equation} \sin^2\theta + \cos^2\theta = 1 \tag{1.1} \end{equation} \end{document} If you just want "normal", consecutive numbers, use an equation environment and omit the \tag ...


5

Tell LaTeX to reset the equation number whenever section or subsection is stepped: \documentclass{article} \usepackage{chngcntr} \counterwithin*{equation}{section} \counterwithin*{equation}{subsection} \begin{document} \section{One} \begin{equation} 2+2=3.99 \end{equation} \begin{equation} \pi^2=9.86 \end{equation} \section{Two} \begin{equation} ...


3

I would use an align* environment instead of an eqnarray* environment; the latter is badly deprecated. In the align environment, a single & symbol is used to mark the alignment point. To typeset strings of "normal text" in upright-roman rather than math-italic, use the \text macro. \documentclass{article} \usepackage{amsmath} \begin{document} ...


2

The problem is that you have one & in the first line, but two in the other lines. With eqnarray you need an & on either side of the = for things to align correctly. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{eqnarray*} \phi(n) = \phi(pq) & = & pq - \text{(\# of multiples of \(p\)) - (\# of multiples of \(q\)) + (\# ...


0

Split environment allow to put ampersand anywhere in aporpriate place in text, so the solution given by egregcan be rewrite also into: \documentclass{article} \usepackage{amsmath} \newcommand{\val}[1]{\textbf{\textit{#1}}} \newcommand{\func}[1]{\textsf{#1}} \begin{document} \begin{equation} \begin{split} \forall \val{valu} % this value is ...


3

\documentclass{article} \usepackage{amsmath} \newcommand{\val}[1]{\textbf{\textit{#1}}} \newcommand{\func}[1]{\textsf{#1}} \begin{document} \begin{equation} \begin{split} &\forall \val{value}_{1}, \val{value}_{2}, \val{value}_{3} \quad \func{Relationship}(\val{value}_{1},\val{value}_{2},\val{value}_{3}) \to \\ &\qquad ...


3

Place an ampersand (&) at the point where you would like the equations to align. \documentclass{article} \usepackage{mathtools} \begin{document} \begin{equation} \begin{split} &\alpha_{a}\alpha_{b}+\alpha_{b} \alpha_{a}=\{\alpha_{a},\alpha_{b}\}=2\delta_{ab}\boldsymbol{1_{N}}, \: a,b=1,2,3, \\ &\{\alpha_{a},\beta\}=\boldsymbol{0}, \: a=1,2,3, \\ ...


1

Alright, I cooked up another answer. The following second version of the package imageeqn.sty reimplements the equation environment, the \[, \], \(, \) environments, and inline math between dollar signs. \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesPackage{imageeqn}[2014/11/30 v0.2 Image equations] \RequirePackage{graphicx} \RequirePackage{environ} ...


3

I suppose you could write a package that compiles equations in subjobs, like so (call this package imageeqn.sty): \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesPackage{imageeqn}[2014/11/30 v0.1 Image equations] \RequirePackage{graphicx} \newwrite\@out \newcounter{imageeqn} \begingroup \catcode `|=0 \catcode `[=1 \catcode`]=2 \catcode `\{=12 \catcode ...


2

I've noticed that the subscript material below the summation symbols is wide enough to extend to the left and right of the summation symbols. TeX inserts extra whitespace so as to avoid any overlap with the surrounding. If you're really pressed for space, you could use the macro \smashoperator (or its relative, \smathoperator[r]) to suppress this whitespace. ...


1

One option using blkarray: The code: \documentclass{article} \usepackage{blkarray} \usepackage{amsmath} \begin{document} \[ \begin{blockarray}{ccccc} x_{1} & x_{2} & \cdots & x_{n} \\ \begin{block}{[cccc|c]} a_{11} & a_{12} & \cdots & a_{1n} & b_{1} \\ a_{21} & a_{22} & \cdots & a_{2n} & b_{2} \\ ...


4

min should be \min (never use math italic for multi-letter identifiers) and b^{'} should be b' and no need for \substack if you only have one line in the subscript. but other than that, the equation fits in a two column IEEE document: \documentclass{IEEEtran} \usepackage{amsmath} \begin{document} \noindent X\dotfill X \begin{equation} \label{eq:3} \min ...



Top 50 recent answers are included