Tag Info

New answers tagged

1

You can often literally smash the part which fiddles with your desired height :) \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} a\left[\frac{d\cos y}{e} + \smash{\overbrace{\frac{b\sin x}{c}}^{\text{second bit}}}\right] \end{equation} \end{document} This comes closer to the posted intended output than David's answer, ...


4

\documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} a\Bigl[\frac{d\cos y}{e} + \overbrace{\frac{b\sin x}{c}}^{\text{second bit}}\Bigr] \end{equation} \end{document}


4

Use align, or if you want only one number use aligned inside an equation. \documentclass{article} \usepackage{mathtools} \begin{document} \begin{align} e^{-\lambda T} &= ( 1 - \log S_j^* (T))^{\frac{1}{1-\theta}} \\ - \lambda T &= \dfrac{1}{1-\theta} \log ( 1 - \log S_j^*(t)) \\ T &= \dfrac{1}{\lambda (\theta-1)} \log ( 1 - \log S_j^*(t)) ...


5

Never pile up font package loading. The fourier package uses math fonts with a different encoding from the standard, so it changes several slot positions. On the other hand, the lxfonts use the standard encodings for math symbols, so loading fourier will have strange effects like the one you're describing. By the way, your package loading order is a bit ...


6

By putting extra newlines (\\) it is expected to get extra vertical spaces between the equations. Simply remove the extra \\ and complete as this example: \documentclass[12pt,a4paper]{article} \usepackage{amsmath} \begin{document} \begin{equation*} \boxed{ \begin{split} y = x^2 + x -2 \\[-.1cm] % adjust the value as you wish y = x^2 + x -2 \\[-.1cm] y = ...


0

This link shows a way of using \smashoperator[r] in mathtools. \begin{align*} \begin{array}{c} \min \: A = \min \: \smashoperator[r]{\sum_{i\in B}} C_i \\ \\ \min \: D = \min \: \smashoperator[r]{\sum_{i\in B}} \pi_i \cdot F_i \end{array} \end{align*}


0

\documentclass{article} \def\eqalign#1{\null\,\vcenter{\openup\jot\mathsurround\dimen12 \ialign{\strut\hfil$\textstyle{##}$&$\textstyle{{}##}$\hfil \crcr#1\crcr}}\,} \begin{document} $$\def\T{\mskip33mu} \eqalign{\alpha &= 1 + 2 \cr & \T - 3 + 4 \cr &= 4 \cr &= 5 - 1, ...


2

Or like this ;) \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} %\usepackage{amsmath} %% not needed, loaded by empheq \usepackage{amsfonts} \usepackage{empheq} \usepackage{amssymb} \usepackage[most]{tcolorbox} %% box from tcolorbox manual \newtcbox{\otherbox}[1][]{nobeforeafter,math upper,tcbox raise base, enhanced,frame ...


3

Something like that? \documentclass{article} \usepackage[many]{tcolorbox} \begin{document} \begin{tcolorbox}[enhanced,ams align,drop fuzzy shadow, colback=yellow!10!white,colframe=yellow!50!black] \tan{\theta} &= \frac{2t}{1-t^2} & \sin{\theta} &= \frac{2t}{1+t^2} & \cos{\theta} &= \frac{1-t^2}{1+t^2} \end{tcolorbox} \end{document}


2

You could use a split environment inside the equation environment. Choose the line breaks at natural-looking points. Vertical alignment points are indicated by the & symbol. The second row is shifted to the right by \quad, and rows 3 through 5 are shifted to the right by \qquad\qquad. Note that you can't use \left( and \right) across line breaks; use ...


3

I hope the following is what you're looking for. \documentclass{article} \usepackage{amsmath,mleftright} \mleftright % eliminate whitespace inserted by \left and \right \begin{document} \[ \left( \begin{bmatrix}M_{11}&M_{12}\\M_{21}&M_{22}\end{bmatrix} + \begin{bmatrix}A_{11}&A_{12}\\A_{21}&A_{22}\end{bmatrix} \right) \begin{bmatrix} ...


3

Here is an application of a macro I showed in Aligning equations with left and right comment (you find there explanations). \documentclass{article} \usepackage{amsmath,amssymb} \newcommand{\Prob}{\operatorname{\mathbb{P}}} \newcommand{\tp}{\mathrm{tp}} \newcommand{\fp}{\mathrm{fp}} \newcommand{\fn}{\mathrm{fn}} \newcommand{\tn}{\mathrm{tn}} ...


5

For your updated example code, I actually suggest that you use an array environment, with the value of \arraystretch increased to mimic a displaymath setting. Two additional suggestions: (i) for the "conditioning operator", use \mid instead of | -- you'll get much better spacing; (ii) most of the items you've declared as math operators are, as far as I can ...


2

You can centre the middle column with the makebox or the eqparbox packages. The eqparbox commands use a tag that makes all boxes that use that tag have width equal to the largest width of boxes; by default, their contents is centred in the box. \documentclass{article} \usepackage{amsmath} \usepackage{makebox} \usepackage{eqparbox} \begin{document} ...


6

\documentclass{article} \begin{document} \begin{eqnarray*} foo &=& bar &=& baz \\ foobar &=& barquux &=& bazzot \end{eqnarray*} \end{document} produces ! Extra alignment tab has been changed to \cr. the standard eqnarray only takes two & Using \documentclass{article} \usepackage{amsmath} \begin{document} ...


1

You have never been able to use \\ in the equation environment. The usage of it in that environment has always produced errors, because equation can just contain one line. An exception is the usage of internal auxiliary environments such as split, aligned or alignedat, but in this case \\ would not be in the equation environment, but in the auxiliary one. ...


4

You should load the amsmath package (if you don't do so already) and use its \tag macro to assign whatever number or symbol you like to a given equation. Cross-references to such equations can ba made via the usual \label--\ref (or \eqref) mechanism. \documentclass{article} \usepackage{amsmath} % for \tag and \eqref macros \setlength\textwidth{7cm} % ...


4

Here are two solutions, first with eqnarray, then with align (an environment provided by the amsmath package). Note the absurdly large amount of space around the = symbols when using eqnarray -- it's one of the reasons why eqnarray is considered badly deprecated these days and really shouldn't be used anymore. Incidentally, since both eqnarray and align set ...


5

It all can be displayed on two lines if you use the multlined environment, from mathtools. I also adjusted the size of some pairs of parentheses, and replaced \tilde with \widetilde , that fits better capital letters: \documentclass{article} \usepackage{mathtools} % \usepackage{amssymb} % \usepackage{showframe} \begin{document} \begin{equation} ...


6

Here is how I would do it: \documentclass{article} \usepackage{mathtools,amssymb} \begin{document} \begin{align*} \mathbb{E}(\cos^{2}) &= \frac{\pi}{16\beta} \Bigl\{\bigl[2\beta(8(\alpha + 1)^{2}\beta + (2\alpha + 1)^{2}) + 3\bigr] \mathstrut_{0}\tilde{F}_{1}(;2;\beta^{2})\\ &\hphantom{{}=\frac{1}{16\beta}\Bigl\{} + ...


6

Unless your document's text block is very wide, I believe it's necessary to split the entire equation twice, i.e., to typeset it across three lines. Note that I would use curly braces and square brackets in addition to the round parentheses in order to help the reader with the parsing of the material. \documentclass{article} \usepackage{amsmath} % for ...


9

Something like this? \documentclass{article} \usepackage{mathtools,amsfonts} \begin{document} \begin{align} \mathbb{E}(\cos²) &= \frac{π (A_{0}\tilde{F}₁(;2;\beta²) +B_{0}\tilde{F}₁(;3;β²))}{16 β},\\ \shortintertext{Where} A &= (2 β (8 (α+1)² β+(2 \alpha+1)²)+3)\notag\\ B &= (β (16 (α+1)² β² -2 (4 α(α+2)+5) β+12 ...


3

Numbering all equations makes it easier for the reader to find a specific equation. If only important equations are numbered, then you can have pages without any numbered equation, so you cannot know whether the equation you are looking for is before or after that page. The purpose of numbering equations is not to indicate which ones are important, but to ...


2

You may just set the reference in text mode. Load amsmath or mathtools for this. % arara: pdflatex % arara: pdflatex \documentclass{article} \usepackage[version=3]{mhchem} \usepackage{mathtools} \usepackage{hyperref} \begin{document} \begin{subequations} \begin{align} \cee{NO + O3 &-> NO2 + O2\label{eq:example1}\\ NO + O3 ...


1

The output is not what the OP wanted, but package tkz-linknodes is devised to create links between equations and label them. This is the code (some commands were taken from egreg's answer) \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel} \usepackage{amsmath} \usepackage{lmodern} ...


2

Abuse flalign ;-) Flushing the first part to the margin doesn't seem good, in my opinion, so I provided two macros for pushing it forward; with \rhide you get alignment to the right end, conversely with \lhide. \documentclass{article} \usepackage{showframe} \usepackage{mathtools} \newcommand{\rhide}[2]{\mathrlap{\hspace{#1}\mathllap{#2}}} ...


1

If a tricky solution is also allowed... We use the fact, that gather centers the lines. Tricky is \intertext. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{gather*} \intertext{$f a b c ={}$} <very very very very long centered definition of f>\\ \intertext{$g a b c d ={}$}\\ <very very very very long centered ...


0

Have you tried just making the font size of the body smaller? I imagine that would make it easier to use one of those environments effectively. Or try using a tabular environment?


0

Why nobody mentions the small environment? \begin{small} \[ x^2 + 2xy + y^2 \] \end{small}


9

Extending jlv's very good solution, here's one where the input is simpler, because common elements can be implicit. I also add some macros that help input and make it easier changing the rendering, if needed. So, instead of \to and \leftrightarrow I define \limplies and \liff for uniformity with \lnot, \lor and \land. Also, the justification is hidden in a ...


0

\begin{equation} \begin{aligned} a &= 1 & b &= 2 + 3 \\ c &= 4 + 5 & d &= 6 \end{aligned} \end{equation}


6

As @tohecz said, the amsmath package is quite helpful, and learning about it yourself is usually the best solution. The second best solution is seeing what other people have done, taking it, and adjusting it to your needs. Below is a second best solution. \documentclass{article} \usepackage{amsmath,array} \setlength{\tabcolsep}{2pt} ...


2

Please, try to break the beast into smaller pieces, add comments and explain. It as well allows you to simplify the formulas: Two comments: I didn't insert any explanatory text, you will have to do that yourself. If the star * doesn't denote convolution, but rather standard multiplication, simply remove it, it's redundant and it can be even confusing. ...


1

If you use the geometry package and employ that package's default (or even narrower) margin settings, the equations all fit between the margins without having to break lines. Alternatively, you can use the medsize environment (from nccmath, ~80 % of \displaystyle): \documentclass{article} \usepackage[utf8]{inputenc} ...


10

Two options; the first one using the empheq package, and the second one using the interaction between empheq and tcolorbox for fancyer designs: The code: \documentclass{article} \usepackage{amsmath} \usepackage[many]{tcolorbox} \usepackage{empheq} \usetikzlibrary{shadows} \tcbset{ highlight math style={ enhanced, colframe=red!60!black, ...


2

I suggest you make the following adjustments: Most importantly, use an align* environment instead of consecutive \[ ... \] constructs. Use \qquad to indent the subsidiary lines of each equation. You have some redundant parentheses in several of the equations. Keep things as visually uncluttered as possible -- you only need one large pair, not two. The ...


0

Other option would be put the pages with extreme long equations/matrices in landscape. So the required example would become \documentclass[a4paper,12pt]{article} \usepackage{pdflscape} \begin{document} \begin{landscape} \[ \begin{array}{lcc} \frac{1}{z^p}\left[ f(z)*\left( \frac{z^p - D z^{p+1}}{(1-z)^{2}} + \frac{\beta ...


6

Another amsmath possibility: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{split} \frac{1}{z^p}&\Bigl[ f(z)*\Bigl( \frac{z^p - D z^{p+1}}{(1-z)^{2}} + \frac{\beta e^{i\theta}(D-1)z^{p+1}}{(1-z)^{2}}\Bigr) \Bigr]\\[\jot] &{}=\frac{1}{z^p}\Bigl[ f(z)*\Bigl( z^p + \sum _{k=p+1}^{\infty} (k-p+1) z^k ...


4

You should use align here or align*, if you do not want to get the lines numbered. These environments are part of the package amsmath. You could load the package mathtools instead in order to move the first row to the left. Looks nicer in my eyes. Just adapt the [number] of \MoveEqLeft to your needs: % arara: pdflatex \documentclass{article} ...


1

\documentclass{article} \usepackage{stackengine} \stackMath \begin{document} \[ \{ \stackunder{1,}{\stackunder{\downarrow\,}{\scriptscriptstyle x_1}}\, \stackunder{2,}{\stackunder{\downarrow\,}{\scriptscriptstyle x_2}}\, \stackunder{3,}{\stackunder{\downarrow\,}{\scriptscriptstyle x_3}}\, \ldots \} \] \end{document} If one does not like the look of ...


4

I hope that one of the following interpretations is close to your expectations. \documentclass{article} \begin{document} \[ \begin{array}{*5{c}} 1&2&3&\ldots&n\\[-2pt] \downarrow&\downarrow&\downarrow& &\downarrow\\[-2pt] x_1&x_2&x_3&\ldots&x_n \end{array} \] \[ \begin{array}{*5{l}} ...


6

This is pretty well answered but I'll try and make it simpler: like others have said, you want to add \usepackage{amsmath} to your preamble, and then put the equations in an align environment. \documentclass{article} \usepackage{amsmath} \begin{document}\noindent Equations with numbers: align \begin{align} 2 + 2 &= 4\\ ...


9

Using align and friends from amsmath: \documentclass{article} \usepackage{amsmath,mathpazo} \newcommand{\deriv}[2][x]{\frac{\mathrm{d}#2}{\mathrm{d}#1}} \begin{document} \begin{align*} q u^{q-1} \deriv{u} &= p x^{p-1} \\ \deriv{u} &= \frac{p x^{-1}}{q u^{-1}} \\ \deriv{u} &= n x^{n-1} \end{align*} \end{document}


1

Another solution with the aligned environment and the \mathllap command from mathtools: \documentclass{beamer} \hypersetup{pdfpagemode=FullScreen} \usefonttheme[onlymath]{serif} %\usefonttheme{professionalfonts}% font de LaTeX \usetheme{Berlin} %\usecolortheme{miniframes} %\usepackage{listings} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel} ...


6

You can use the option aspectratio=169 as percusse says in \documentclass[aspectratio=169]{beamer} to get Or use the symbol for Laplacian \begin{align} \frac{-\hbar²}{2m}∇^{2}ψ(x,y,z)+V(x,y,z)ψ(x,y,z) = Eψ(x,y,z)\label{ecu-gen} \end{align} to get Or try to split the equation into two lines using amsmath (split/align/multline) \begin{multline} ...


3

The command \refeq, besides typesetting the reference, writes an \MT@newlabel entry in the .aux file, so defining a \silentrefeq that does this will suffice. \documentclass{article} \usepackage{mathtools} \mathtoolsset{showonlyrefs,showmanualtags} \makeatletter \MHInternalSyntaxOn \newcommand{\silentrefeq}[1]{ \@bsphack \MH_if_boolean:nT ...


1

In order to do what the empheq environment does, (I suspect) they are collect all of the material between \begin{empheq} and \end{empheq} into a box. If the delimiter that terminates the box collection is hidden in unexpanded macros, the collection continues until the end of the document. This new environment works for me: \newenvironment{empheqbox}{% ...


5

Synposis: %put a longer paragraph of text in a box \newsavebox\lipsumbox \begin{lrbox}{\lipsumbox}% \begin{minipage}{\textwidth}% \strut \lipsum \strut \end{minipage} \end{lrbox} %scroll the box content within a viewport of limited height \smoothscroll[autoplay]{\lipsumbox}{0.93\textheight}{400}{25} Usage: \smoothscroll[autoplay] ...


4

You could try: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{mathtools} \begin{document} \begin{equation} \begin{array}[t]{c @{\,} c @{{}={}} c} AAAAAA & yyyyy & bbbbbb \\ A & y & b \\ \end{array} \end{equation} \end{document} Addendum, to address the OP's follow-up query: To typeset the two versions of ...


3

Here is a tikz method with options to customize the thickness and colors of the arrow and text (you can provide the chemistry): Code: \documentclass{article} \usepackage{tikz} \newcommand*{\MyArrowWithCircleLength}{0.7cm} \newcommand*{\MyArrowWithCircle}[2][]{% % #1 = draw options % #2 = node text \,\tikz[baseline,overlay] \draw ...



Top 50 recent answers are included