Tag Info

New answers tagged

56

The PDF format supports a feature "ActualText" that is used for copy-paste instead of the actual typeset text. However, it is not supported by all PDF viewers, but Acrobat Reader does support it. \documentclass{article} \usepackage{accsupp} \newcommand*{\copyable}[1]{% \BeginAccSupp{% ActualText=\detokenize{#1},% method=escape, }% #1% ...


2

A regular align with some macro-involvement would obtain the desired result: \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \newcommand{\alignmath}[2]{\makebox[0pt][#1]{$\displaystyle#2$}} \newcommand{\lmath}[1]{\alignmath{l}{#1}} \newcommand{\rmath}[1]{\alignmath{r}{#1}} \newcommand{\cmath}[1]{\alignmath{c}{#1}} ...


0

The following example uses environment tabular* to simulate the equations and to achieve the alignment requests: \documentclass{article} \usepackage{amsmath} \usepackage{array} \begin{document} \noindent A\hfill Z \begin{center} \begin{tabular*}{\linewidth}{% @{}l% description @{\extracolsep{\fill}}% >{$\displaystyle}c<{$}% simulate displayed ...


3

This code is Plain TeX style. It will possibly run on LaTeX, but \matrix will give an error if amsmath is loaded. Some changes are needed for using the code in LaTeX (I assume also amsmath): \begin{equation} D_{E}\propto \left\{ \begin{aligned} &(1-A)\cos(kh\sin\theta)-2B\cos\beta]^{2}\\ &\quad{}+[(1+A)\sin(kh\sin\theta)+2B\sin\beta]^{2} ...


3

Please always post complete documents which reproduce the problem. With the standard classes the bullets are to the left of the number: \documentclass[leqno]{article} \usepackage{amsmath} \begin{document} aaa \begin{itemize} \item Such and so \item the following holds \begin{align} x - 2 \end{align} always. \item whatever else ...


0

First, we need to know what you are using to create your LaTeX documents. I can only give you advice which is Emacs specific but maybe I will be lucky and that is what you are using. This will allow you to jump to the lines in the .tex document by holding shift and left clicking the equation in your pdf. Open Okular and go to settings-Configure Okular. A ...


9

The value for \label is written into the .aux file, thus you need \protect for the fragile \parbox: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \label{mylabel} \tag{\protect\parbox[c][3em][c]{4em}{1st tag \\ 2nd tag}} x = y^2 \end{equation} \end{document} A tabular fixes at least the right white space: ...


0

You can use flalign*: Notes: With the starred variant you don't need to use \nonumber. I also remove the manually added ~ for spacing as manual spacing should normally be avoided in math. Code: \documentclass[]{article} \usepackage{showframe} \usepackage{amsmath} \begin{document} \begin{flalign*} \eta_7 &= \eta_2 f_0(\lambda) - \eta_1 ...


7

You don't need those parentheses. But that way of typesetting the formula is heavy and doesn't add to clarity. Here's my proposals: the second one is surely how I'd typeset the formula. \documentclass{article} \begin{document} \begin{equation} \mathbf{S}_o = \frac{\sum\limits_{i=1}^{N} \frac{\sum\limits_{k=1}^{J-1} \frac{\| P_k^Q - P_{k+1}^Q \|}{\| ...


5

Just to show a version with build in scaling: \documentclass[a4paper]{memoir} \usepackage{mathtools} \DeclarePairedDelimiterX\brak[3]\langle\rangle{% #1 \delimsize\vert #2 \delimsize\vert #3} \begin{document} \[ \brak{e^+}{\mu}{e^-} \qquad \brak*{e^+}{\frac{\mu}{\sqrt{2}}}{e^-} \qquad \brak[\Big]{e^+}{\sum_i \mu_i }{e^-} \] \end{document}


6

You should use \brak{e^+}{\mu}{e^-} There're 3 different arguments, you can't separate them by commas.


1

Load the bbm package. \documentclass{article} \usepackage{bbm} \begin{document} \[p(x) = q^{\mathbbm{1}(x = 1)}\] \end{document}


3

Add an alignment character at the end: \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \begin{document} \begin{flalign} f(x) &= ax^2 + bx + c \end{flalign} \begin{flalign} f(x) &= ax^2 + bx + c & \end{flalign} \end{document} Note that in a regular alignment, you only use a single & around the relation you wish ...


4

Without knowing what \tagthisline looks like, I would opt for a different approach using a straight align: \documentclass{article} \usepackage{mathtools}% http://ctan.org/pkg/mathtools \providecommand{\tagthisline}{X}% Don't know what this means... \begin{document} \begin{tabbing} \hspace{.5cm} \= \hspace{.3cm} \= \hspace{3cm} \= \kill ...


1

You're probably after the following: \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \usepackage[retainorgcmds]{IEEEtrantools}% http://ctan.org/pkg/ieeetran \usepackage{hyperref}% http://ctan.org/pkg/hyperref \renewcommand{\theequation}{\thesection.\arabic{equation}}% Equation number format \numberwithin{equation}{section}% ...


6

Better solution if you are a new user \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \begin{cases} u'_0 = {u_0} + u_1^Tt + \tfrac{1}{2}{t^T}{U_2}t \\ {u'_1} = {u_1} + {U_2}t \\ {U'_2} = {U_2} \end{cases} \end{equation*} \end{document}


5

(With at least a few improvements): \documentclass{article} \begin{document} \[ %\begin{equation} \left\{ \begin{array}{l} u'_0 = {u_0} + u_1^Tt + {\textstyle{1 \over 2}}{t^T}{U_2}t\\ {u'_1} = {u_1} + {U_2}t\\ {U'_2} = {U_2} \end{array} \right. %\end{equation} \] \end{document}


2

Automatic output from Mathematica can't be directly inserted and some manual work is needed. For instance, you'll find useless \left and \right, also useless {} and wrong \text{$\Delta$p}_2$. I split the long equation at plus and minus sign, surrounded it by \begin{multline} and \end{multline}; then I inserted \\ at possibly appropriate spots not to make ...


3

With long mechanically generated terms it isn't clear that it makes sense to try to insert & and \\ in align-like structures. To make a human readable output really you need to break it up completely, give names to sub-terms etc, An alternative is just to let the whole thing flow as it comes: \documentclass{article} \usepackage{amsmath} ...


2

You've got some extremely long lines in that equation. You need to put an alignment & earlier in the first line so you can see the following lines: \documentclass{article} \usepackage[margin=1in,landscape]{geometry} \usepackage{amsmath,amssymb} \pagestyle{empty} \begin{document} \begin{align} \left(\nabla p_1\right){}^2 & g_2-\frac{1}{3} ...


4

How about the following? I've replaced the \text{Cos} (my eyes!) by \cos. You can use a gathered environment to break the equation in multiple, centered lines. Make sure that each line containing an opening \left... also contains a closing \right.... Also, use \[ and \] to open and close an unnumbered displayed equation, not $$; see Why is \[ ... \] ...


2

For some reason you want center the three lines. Then you can do the following (observe the commented version with \left and \right): \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{array}{c} \displaystyle \frac{1}{2} (1-\varepsilon^2) \left( \partial_\tau \phi\right)^2 = \frac{1}{2} \left(1-\epsilon ^2\right) %\left( \Biggl( ...


2

close an open \left( by an \right. before you put the linebreak and open it in the next line again with \left. here is the answer: \begin{align*} \frac{1}{2} (1-\varepsilon^2)\left(\partial_\tau \phi\right)^2 &= \frac{1}{2} \left(1-\epsilon ^2\right)\left( -\frac{S \epsilon \sin\tau }{\sqrt{\lambda }} -\frac{\text{g2} S^2 \epsilon ^2\sin2\tau }{3 ...


6

Replace each \left( \right) by (say) \Bigl( \Bigr) If you choose the size manually in this way then you may split the brackets over lines and alignment cells. Also, please always post complete documents not just a fragment: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} \frac{1}{2} (1-\varepsilon^2)(\partial_\tau \phi)^2 ...


0

It is unfortunate that the comment of Crowley here above is not more highlighted. He give me the answer I search : using \boldmath before the eqn environment, all the math portion is in bold font and the text stay normal. An example of my code: \boldmath\begin{align*} p(X,Y) \Leftrightarrow & minimal(X) \\ & ...


2

If you're comfortable with the macro-use in How can I center text/math inside a list environment?, then you could use \def\NLine#1{\par\hspace*{-\leftmargin}\parbox{\textwidth}{\begin{equation}#1\end{equation}}} This inserts the argument inside a numbered math display and allows referencing in the usual way. \documentclass{article} ...


3

If you really need numbering, you can do like \documentclass{beamer} \usepackage{mathtools} \begin{document} \begin{frame} \frametitle{Big formula} \begin{equation} \label{eq:recursive} \resizebox{.9\textwidth}{!}{$\displaystyle % restart math mode! R_{k+1}(a,b) = \begin{dcases} 1 & \text{if $a=b$} \\ 0 & \text{if $I(a)=\phi$ or $I(b)=\phi$} \\ ...


1

You are not in math mode inside the argument of the \resizebox command. You can get back into (display) math mode using dollar signs and \displaystyle. \documentclass{article} \usepackage{amsmath} \usepackage{graphicx} \begin{document} \begin{equation} \label{eq:recursive} \resizebox{\linewidth}{!}{$\displaystyle a = b$} \end{equation} \end{document} ...


1

For complex drawings (circles, etc), you might need to go the tikz road. But for simple shading of elements, a regular \colorbox should do, i.e. \documentclass{article} \usepackage{xcolor} \newcommand{\highlight}[1]{% \colorbox{red!50}{$\displaystyle#1$}} \begin{document} \begin{equation} \mathbf{Y_{ij}} = \highlight{\beta_{0}} +\mathbf{ b_i} + ...


2

It should work. Here are two ideas to split one equation on more lines. (The align family is used to align more than one equation.) Code \documentclass{article} \usepackage{amsmath} \begin{document} \begin{multline} f = c_{A1}x_{A1}+c_{A2}x_{A2}+c_{A3}x_{A3}+c_{B1}x_{B1}+c_{B2}x_{B2}+c_{B3}x_{B3} \\ + c_{X1}[y_X,(W/S)_X,(T/W)_X,(AR)_X]X_{X1} \\ ...


0

For example: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{split} f &= c_{A1}x_{A1}+c_{A2}x_{A2}+c_{A3}x_{A3}+c_{B1}x_{B1}+c_{B2}x_{B2}+c_{B3}x_{B3} \\ & \quad{} + c_{X1}[y_X,(W/S)_X,(T/W)_X,(AR)_X]X_{X1} \\ & \quad{}+ c_{X2}[y_X,(W/S)_X,(T/W)_X,(AR)_X]X_{X2} \\ & \quad {}+ ...


11

One possibility using TikZ: \documentclass{beamer} \usepackage{tikz} \newcounter{mybox} \newcommand\tikzmark[1]{% \tikz[remember picture,overlay] \node[inner xsep=0pt] (#1) {}; } \newcommand<>\ColorBox[2][]{% \stepcounter{mybox}% \node[draw=red!70!black,fill=red!20,align=left,#1] (box\themybox) {#2}; } \begin{document} \begin{frame} ...


1

Here are a couple of methods you can employ: \documentclass{article} \usepackage{mathtools}% http://ctan.org/pkg/{mathtools} \begin{document} One way \begin{align} y & = \Sigma aaa \\ & = bbb + ccc \nonumber \\ & \mathrel{\phantom{=}}{} + ddd + eee \nonumber \\ & \mathrel{\phantom{=}}{} + fff + ggg \nonumber \end{align} Another ...


0

Or rather this: \begin{align} y & = \Sigma aaa \\ \nonumber & = bbb + ccc \\ \nonumber & \quad{}+ ddd + eee \\ \nonumber & \quad{}+ fff + ggg \end{align} {} is for proper spacing around + sign and \quad and \qquad are standard lengths in math mode.


2

You want to use an align environment. Doing something like... \documentclass{article} \usepackage{amsmath,amssymb} \usepackage[margin=1in]{geometry} \pagestyle{empty} \newcommand{\dint}{\int} \newcommand{\ldbrack}{[} \newcommand{\rdbrack}{] } \begin{document} \begin{subequations} \begin{align} \dint_{K} \underline{E}_h \cdot \underline{z} \, dx + ...


3

To add to Przemysław Scherwent's answer, in the case you want to use an operator that is not already defined, you can use \operatorname{} or \operatorname*{} from the amsmath package. The former displays its argument like an operator -- like sin, for example --, and the latter does the same, but the following superscripts and subscripts will be typeset above ...


4

\begin{document} \begin{equation} \min_A\sum^{N}_{i=1}\sum^{N}_{j=1}|y_i - y_j|^2 W_{ij} \label{eqn4} \end{equation} \end{document}


1

\documentclass{article} \begin{document} $ X = \{x_n\}^{N}_{n=1} $ \end{document}


4

Here an example that looks more like chemistry and also contains an equation with an equal sign: \documentclass{article} \begin{document} \begin{equation} \mathrm{CO} + 2\,\mathrm{H}_{\mathrm{2}} \rightleftharpoons \mathrm{CH}_{3}\textrm{OH} \end{equation} \begin{equation} E=mc^2 \end{equation} \end{document} Remarks: \textrm ...


4

For example, class standalone can be used: \documentclass[border=1pt]{standalone} \begin{document} \mbox{$\displaystyle E=mc^2$} \end{document} Remarks: TeX only sees character bounding boxes of the font, not the bounding boxes of the visual appearance of the glyphs, thus it is possible that the visual appearances exceed the font character boxes. ...


2

You could just insert \!, which gives you a small "negative" horizontal space. \documentclass{article} \begin{document} \begin{equation} \textbf{P}(k+1|k) = \textbf{F}(k)\textbf{P}(k|k)\textbf{F}^T\!(k) + \textbf{Q}(k) \end{equation} \end{document} By the way, the eqnarray environment is deprecated nowadays. For this use, I think equation would serve ...


1

For example: \ce{$3.043$ Fe2O3} just use maths-escape mode, using $$ to embrace the number. There should not be any white spaces between $ and the number otherwise the compiling would go wrongly, though this is not the case in normal equations. Ref: http://tumutanzi.com/archives/11825


1

Remarks You might want to use the \numberwithin directive, like \numberwithin{equation}{section} Implementation \documentclass{scrartcl} \usepackage{amsmath,amssymb} \pagestyle{empty} \numberwithin{equation}{section} \begin{document} \section{First section} \begin{equation} \hat{f}(\omega) = \frac{1}{\sqrt{(2 \pi)^n}} \int_{\mathbb{R}^n} f(t) \, ...


3

You need a better spacing. A tricky solution in the first version. For some reasons the other versions might be more suitable for you, however I doubt. In all variants punctuation and spacing improved. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} 2 \pi R\left[q_x-p_x,q_y-p_y\right],&\quad\text{for } \left[p\leq ...


2

Since it seems the boundary condition is dependent on p, perhaps a numcases (from the cases package) is okay. In the example below I define the boundary B(p) as a function of p: \documentclass{article} \usepackage{amsmath,cases}% http://ctan.org/pkg/{amsmath,cases} \begin{document} Some text here. \begin{numcases}{B(p)=} 2 \pi ...


2

For comparision, in ConTeXt, the relation between blank lines in input and indentation in output can be controlled using the indentnext key. For example, if you set \setupformula[indentnext=no] then, there is no indent after an equation (irrespective of whether the input has blank lines or not). Similarly, if you set \setupformula[indentnext=yes] ...


4

AMS and LaTeX alignments use $$ internally so do use \predisplaypenalty and AMS \intertext also explicitly sets this penalty before the restarted display after the text. As for what value to use, it's a bit of a black art and somewhat dependent on your actual content. In the absence of any other suggestions I would use either \@medpenalty or \@highpenalty, ...


4

Sorry, but why are you using \textit{$f_{2}$} etc, there is no reason for this at all. Write $f_{1} \succ f_{2}$ if \begin{equation*} \begin{cases} dz_{f_{1}} \supseteq dz_{f_{2}} \\ \textup{outPorts}_{f_{1}} \in \textup{outPorts}_{f_{2}} \end{cases} \end{equation*} Sorry for saying this, but please consult a LaTeX manual.


5

Shouldn't \[ f_{1} \succ f_{2} \text{ if } \begin{cases} dz_{f_{1}} \supseteq dz_{f_{2}} \\ \textit{outPorts}_{f_{1}} \in \textit{outPorts}_{f_{2}} \end{cases} \] be what you're looking for? Notice that it requires \usepackage{amsmath} in the preamble. You seem to be using math mode in a wrong way.


3

Please always post complete documents, not just fragments. You can use \phantom \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} \begin{split} \left| \Psi \left( t \right) \right\rangle _{I}^{3}&=-\frac{1}{{{\hbar}^{2}}}\int_{0}^{t}{\hat{H}_{1}^{I}\left( t' \right)\,}\left( \int_{0}^{t}{\hat{H}_{1}^{I}\left( t'' ...



Top 50 recent answers are included