# Tag Info

## New answers tagged equations

0

Just for fun with PSTricks. It needs the latest pst-plot to let us use postfix in \psxTick and \psyTick. \documentclass[pstricks,border=12pt,12pt,dvipsnames]{standalone} \usepackage{pst-plot,pst-eucl} \psset { urx=15pt, ury=15pt, llx=-15pt, lly=-15pt, ticks=none, labels=none, xAxisLabel=$Q$, yAxisLabel=$P$, algebraic, ...

5

Here is a suggestion: \documentclass[margin=10pt]{standalone} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture}[ every node/.style={text=black}, fdesc/.style={anchor=south east,sloped,font=\scriptsize,pos=#1}, fdesc/.default=1, ] \begin{axis}[ axis ...

4

I tweaked it a little. I hope you don't mind. \documentclass[tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture} \begin{axis}[ clip=false, axis x line=bottom, axis y line=middle, ytick={5,20}, xtick={-45,100}, no markers, ymin=0, xmin=-55, xmax=120, ...

6

There is nothing special, probably it was created by the verbatim environment: \documentclass{article} \begin{document} \begin{verbatim} expr :: atom ;; a variable identifier | "!" expr ;; logical not | expr1 "&" expr2 ;; logical and | expr1 "|" expr2 ;; logical or | ...

3

I'm not in a position to comment on your math, hence the following comments are strictly about improving the appearance of the typeset result. Your equation isn't just "slightly long", unless you have a truly enormous text block. As the answer by @Sigur has also already suggested, you need to use a math environment that allows a line break. Since it ...

2

Suggestion: \documentclass{report} \usepackage{amsmath} \begin{document} \begin{multline*} \left|\, \int_{% \Omega_1 \times \cdots \times \Omega_{n-1}}% \left|\, \int_{% \Omega_n} \overline{f}_{x_1, \ldots ,x_{n-1}}\,% e_{nj_n}\, d{\mu_n}% \right|^2\, d{(\mu_1 \times \cdots \times \mu_{n-1})}\,% \right| \leq \\ % \left|\, \int_{% \Omega_1 ...

4

You can use the \text{}-command with amsmath-package or \parbox{width}{text} To get a newline. \documentclass{article} \usepackage{amsmath} \begin{document} \label{key} \parbox{0.9\textwidth}{The product of two complex numbers is given by the vector whose angle is the sum of the angles of the two complex numbers and whose magnitude is ...

1

You could simply not use the \text{...} "wrapper" in the second argument of \DeclareMathOperator*} macro. Instead, just write \newcommand\myspacer{\quad} \DeclareMathOperator*{\minimize}{minimize\myspacer} \DeclareMathOperator*{\subjto}{subject\ to\myspacer} The macro \myspacer is set to \quad for now. If you wish to change it to \qquad or \, that's ...

4

You can set the problem in an array to adjust the spacing. For consistency, it's best to define this as an environment: \documentclass{article} \usepackage{amsmath,array,environ} \DeclareMathOperator*{\minimize}{\text{minimize}} \DeclareMathOperator*{\subjto}{\text{subject to}} \newcolumntype{R}{>{\displaystyle}r} ...

0

Thanks for the interesting example, Paul. It looks like the suggestion by Ethan regarding the .aux file is precisely what I wanted. I admit that I have been using LaTeX for about 13 years, but have never actually looked at the .aux file before. In my current document, I have an equation \min_{\psi,\mathcal{E}} -|\langle ...

2

Silently stolen from this answer (click). \documentclass[preview,border=12pt,12pt]{standalone} % change it back to your own document class %\documentclass[12pt]{article} \usepackage{array,tabularx} \newenvironment{conditions*} {\par\vspace{\abovedisplayskip}\noindent \tabularx{\columnwidth}{>{$}l<{$} @{${}={}$} ...

2

Here are two ways to do — to be adjusted according to the real data, equations, &c. \documentclass[ a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[showframe, nomarginpar]{geometry} \usepackage{array, mathtools} \begin{document} ... 3 This may or may not be desirable for your uses, because it doesn't physically alter your code files. (It leaves the \labels in the code rather than replacing them with the numbers.) But several ways to do this exist using the listings package's escape to LaTeX features. Other code pretty-printing packages have similar features, but I show an example with ... 4 Here's a solution that basically takes your code and just modifies the length parameter \arraycolsep; its default value (in all LaTeX document classes I'm familiar with) is 5pt, and I set it to 1.5pt around the + symbols and to 2.5pt around the = symbols. These changes also bring about a change in the positioning of the \vdots symbols. ... 2 Another solution with the alignat environmentand theempheqpackage for the brace. Don't loadamsmath:: empheq loadsmathtools, which loads it. I deleted the\ddots`, that I don't understand in this context. The + signs and the unknowns are vertically aligned: \documentclass[10pt]{amsart} \usepackage{amsfonts} \usepackage{amssymb} ... 3 An example of a solution. It may be simplified, if we know, e.g., the structure of equations. \documentclass[10pt]{amsart} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsthm} \usepackage{mathtools} \begin{document} \begin{align*} \left\{ \begin{array}{c@{\,}c@{\,}c@{\,}c@{\,}c@{\,}c@{\,}c@{\;}c@{\;}ccccc} a_{1,1}x_{1} ... 5 \documentclass[10pt]{article} \usepackage{makeidx} \usepackage{multirow} \usepackage{multicol} \usepackage[dvipsnames,svgnames,table]{xcolor} \usepackage{graphicx} \usepackage[margin=0.5in]{geometry} \usepackage{epstopdf} \usepackage{ulem} \usepackage{hyperref} \usepackage{amsmath} \usepackage{amssymb} \usepackage[super]{nth} \usepackage{graphicx} ... 5 An exemplary solution. The second label commented. \documentclass{article} \usepackage{amsmath} \begin{document} \def\dint{\displaystyle\int} \def\dsum{\displaystyle\sum} $$\mathrm{COG} = \frac{\dint_a^b\!\mu_{A}(x)x\, {d}x}{\dint_a^b\!\mu_{A}(x)\, {d}x} \label{eq:cogCont}$$ \mathrm{COG} = ... 1 There are many possibilities for introducing a line break. A key step is not to use \left and \right to size the square brackets, since you can't have a line break across a \left-\right pair. Here are two possible solutions, one using the multline environment, the other the split environment nested inside an equation environment. ... 3 For example (the presence of - at the end of line depends on typographic rules in your country): \documentclass[12pt,twoside,a4paper,openright]{report} \usepackage[portuguese]{babel} \usepackage[utf8]{inputenc} \usepackage{siunits} % added - PS \usepackage[inner=3cm,outer=2cm,tmargin=2.0cm,bmargin=2.0cm, includefoot, includehead, ... 0 As \raisetag doesn't seem to work properly here the align environment looks like a decent solution: \documentclass{article} \usepackage{mathtools} \begin{document} \begin{align} A = &\left( B \right. \notag \\ &\phantom{(} \left. + C \right) \end{align} \end{document} 1 I'd do something like this \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} A &= \Bigl( B \notag \\ &\phantom{= \Bigl(} + C \Bigr) \end{align} \end{document} or using split \documentclass{article} \usepackage{amsmath} \begin{document} \begin{split} A &= \Bigl( B \\ ... 3 This is what you may need actually. \documentclass{article} \usepackage{mathtools} \begin{document} \begin{align*} I\left(a;\frac{1}{a}\right) &= I\left(\frac{1}{a};a\right) \\ I\left(a;\frac{1}{a}\right) &= -I\left(a;\frac{1}{a}\right) \\ \hbar I\left(a;\frac{1}{a}\right) &= 0 \end{align*} \end{document} 3 You have several ways: I'll present four. In all, the long fraction line has been replaced by \frac{1}{N} in front of the numerator, which is probably less heavy to read. The examplese after the first actually have \tfrac{1}{N} which is possibly even better. Exercise your taste. \documentclass[10pt]{article} \usepackage{amsmath} \begin{document} I have ... 4 How about this solution that uses alignedat? There is only one number naturally: \documentclass[10pt]{article} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage{mathtools} \begin{document} I have tried for over one hour now, in vain, on centering one equation. Why in the world is the equation not centered - i.e., so ... 6 As you can see from the enlarged version, the equation is longer then \textwidth, hence cannot be centered. But, in general instead of TeX ..., a LaTeX \[... (or other structure) should be used. See Why is $...$ preferable to $$...$$? \documentclass[10pt]{article} \begin{document} I have tried for over one hour now, in vain, on centering one ...

4

The names ‘lim’ and ‘max’ should be at the same level as ‘f’; also the absolute value bars should be as high as necessary to cover the material inside them; what's before the opening bar is irrelevant as far as the absolute value is concerned. This is a case where \left and \right are plainly wrong, because they produce too large delimiters. I don't think ...

1

\documentclass{article} \usepackage{amsmath} \begin{document} You have: $\lim_{d \rightarrow \infty} \left [ \underset{a\leq x\leq b}{\mathrm{max}_p} \left | f(x) - m(x) \right | \right ] = 0$ You say, that it is produced: $\lim_{d \rightarrow \infty} \left [ \max_{a\leq x\leq b} \left | f(x) - m(x) \right | \right ] = 0$ You want: \[ \lim_{d ...

1

As egreg mentioned in comment, it does look wrong what you are trying to do (refering to the raised functions). The functions should stay vertically centered. But here is, how it is done: % arara: pdflatex \documentclass{article} \usepackage{mathtools} \begin{document} \[ \raisebox{.25\baselineskip}{$\displaystyle\lim_{d \rightarrow \infty}$} \Biggl[ ...

4

You could use the environment multline provided by the package amsmath \documentclass{article} \usepackage{amsmath} \setlength\multlinegap{0pt} \begin{document} \begin{multline} P(x) = \\ a + b + c + d + e + f \end{multline} \end{document} The \setlength\multlinegap{0pt} assures no indentation of the first line.

4

Ypu can define the flmultline environment and its starred counterpart: \documentclass{article} \usepackage{amsmath} \usepackage{lipsum} \makeatletter \newenvironment{flmultline} {\multlinegap=\z@\start@multline\st@rredfalse} {\endmultline} \newenvironment{flmultline*} {\multlinegap=\z@\start@multline\st@rredtrue} {\endmultline} \makeatother ...

4

The following example defines \myeqref, which prepends the equation reference by Eq.~ and includes the prefix and the parentheses into the link. The prefix can be overwritten by the first optional argument. The \autoref name macros do not have access to the counter, thus the following definition of \equationautorefname is just a dirty hack. ...

4

If you're not willing -- or allowed! -- to modify some lower-level TeX macros, you could still achieve your objective of getting parentheses placed automatically around cross-referenced equation numbers by (a) executing the following instruction in the preamble: \usepackage[nameinlink,capitalize]{cleveref} and (b) using \cref instead of \autoref to ...

3

You could align the condition to the right margin and center the equation to the rest of the line using flalign. \documentclass{scrreprt} \usepackage{fontspec} \usepackage{amsmath}% loads also amsmath \usepackage{showframe}% to show the page layout \begin{document} \begin{flalign*} &&x_j = 1,\quad y_j = 2,\quad z_j = 3 &&\text{for }j=1, ...

7

Just load mathtools instead of amsmath (it loads the latter) and use its \mathrlap command. You may put the \qquad inside the \rlap or not. In my opinion, if you put it inside, the main part of the equation doesn't look centred to the reader,though it is. You must also be aware the condition might overlap the right margin. In such a case, I would one of ...

9

TeX has three main modes horizontal, vertical and math with math split into display and inline. So the question is really what commands are allowed in display math. Basically vertical mode commands are not allowed (with the exception of \halign, in the special case that it is the only thing in the display) so for example \vskip2in produces ...

1

Here is an attempt to get something sensible. Note that you have a command for double integrals, that is \iint. The amsmath package (loaded by mathtools) defined a number of multiline equations environment, of which I use align*. The nccmath package is here to have medium-sized fractions in in-line formulae, rather than text-style, which is too small in my ...

0

You're quite close but you are over working things. First, inside a displayed equations you do no need to enclose mathematics within dollar signs, so you can drop then $...$. Secondly, your \stackrel's are unnecessary and completely confused me: subscripts and superscripts are done with _ and ^, respectively. Here is a cleaned up working version of your ...

5

I've taken a crack at cleaning up your code. Some dos and donts: Don't use $...$ inside display-math mode to denote math objects; all objects in display-math mode are assumed to be math objects. Similarly, don't use \textit{...} to denote math items: If already in math mode, you need do nothing extra; if not, use $u$. (Some, but not all, fonts ...

9

Here's an example using the tikzmark library for TikZ; there was no information in the question regarding how the formula was typeset, but the idea will still apply: place marks using \tikzmark and then use the marks to draw the arrows and place the accompanying texts: \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{tikzmark} ...

1

The following is too long to post as a follow-up comment on Mike Renfro's answer. It should be clear, though, that my posting isn't so much a separate answer as an implementation of some of Mike's suggestions and observations. Here, then, are some additional suggestions that will, hopefully, raise the visual and aesthetic appeal of the table: In tables, ...

2

I can think of two main options: first, use a substitution for common expressions. Second, make a savebox of a more complicated aligned equation, and insert that box into the table. This protects the & characters from being interpreted by the tabular environment. Also, in terms of general table layout, see the booktabs documentation. I've left your ...

2

If TeX generates an error as in your example (you have undefined command \del and more \left than \right) you should only look at the pdf for debugging purposes. TeX's recovery actions are designed to let it carry on, not to generate sensible typeset result. I don't know what you intended but this runs without error \documentclass{article} ...

3

Here's an application of expl3: for splitting I cycle the requested number of times through the input string, picking up the items corresponding to the cycle and forming a sequence; for rebuilding it's just the reverse: I cycle over the sequence elements picking up the first element, the second one and so on from each item. \documentclass{article} ...

7

If I understand your wish, you need to use the following macros: \newcount\tmpnum \def\sedef#1{\expandafter\edef\csname#1\endcsname} \def\expandcsname#1{\expandafter\ifx\csname#1\endcsname\relax \else \csname#1\endcsname\fi} \def\brk#1#2#3{\bgroup\def\brkLines{#2}\ifx+#1\tmpnum=0 \brkA#3{}% \else\tmpnum=1 ...

11

tikz is not necessary, just use a vertical rule with some spacing: \documentclass{article} \usepackage{amsmath,amssymb,amsthm,mathtools} \begin{document} \begin{equation*} \begin{Bmatrix} ( 0\mkern-5mu\smash{\vrule height 0.8em depth 1.5em}\mkern5mu00)\\ (100) \end{Bmatrix} \end{equation*} \end{document}

5

I would place the graphic and equation in the following way: \documentclass{article} \usepackage[export]{adjustbox} \begin{document} \begin{figure} \centering \includegraphics[valign = c, width = .3\linewidth]{example-image} \qquad $\displaystyle A = \frac{B}{C}$ \caption{A picture and an equation} \end{figure} \end{document} The image would ...

1

How about $stuff >= other stuff$ Unfortunately, you won't get an equation number this way...

5

I agree with @egreg (especially) that typesetting 10/20pt is not a card of the good typography. I have a special and extensive notice about this bad practise in theses mentioned in my templates for theses. But the problem from TeXnical point of view is very interesting and it seems to be non-trivial. This is the reason why I tried something... We need to ...

0

I suggest you use a split environment, which in contrast to multline may be used a subenvironment of equation. You need to specify an alignment point on each line with & and separate lines with \\. In this case the first line should be move left relative to the others and the package mathtools provides a convenient command for this: ...

Top 50 recent answers are included