Tag Info

New answers tagged

0

It is my personal taste, you might not agree with me. Here is my rule of thumb. We know that the first line of all items of "list" (enumerate, itemize, etc) are left aligned. So if the item starts with a multi-line aligned equation, use aligned environment (plus t passed to its optional argument) rather than align*. See my the second item in my example ...


0

This is somewhat similar to Werner's suggestion but with the additional use of \mathclap and \smash: \documentclass{article} \usepackage{mathtools} \begin{document} \[ A \stackrel{\mathclap{\scriptscriptstyle\smash{(\triangle)}}}{=} B \] From $\triangle$ we see that $A = B$. \end{document}


0

The problem is simply that you can't use align inside equation (and LaTeX will show you an error message that should tell you something is wrong with this). Just delete the \begin{equation} and \end{equation} lines. This should work fine: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} \mathbf{x_{t}=f_{t}(x_{t-1},u_{t})}\\ ...


1

Less is sometimes more. Consider this merely a suggestion: \documentclass{article} \begin{document} It is obvious that \[ LHS \stackrel{*}{=} RHS \] where $\stackrel{*}{=}$ denotes an equality based on the fact that $t = x^n\!$. \end{document}


1

The stackengine package has a parameter \def\useanchorwidth{} that when set to T, ignores the stacked-on or -under content when determining the width of the stack. The optional argument provides the stacking gap. A {}={} had to be used to get the stacked equal sign to act as a math relation. \documentclass{article} \usepackage{stackengine} \stackMath ...


4

\documentclass[border=12pt,preview]{standalone} % change it back to your document class \usepackage{mathtools} \begin{document} \section*{side-by-side} \begin{align} x_{t} &= f_{t}(x_{t-1},u_{t}) & y_{t} &=g_{t}(x_{t},v_{t}) \label{eq:label1} \end{align} Please see equation~\ref{eq:label1} on page~\pageref{eq:label1}. \section*{split with ...


4

\documentclass{article} \usepackage{mathtools} \begin{document} \boldmath \begin{align} \begin{aligned} x_t &= f_t(x_{t-1},u_t)\\ y_t &= g_t(x_t,v_t) \end{aligned}\label{eq:state-space&obs-equ} \end{align} \unboldmath \begin{align} x_t &= f_t(x_{t-1},u_t) & y_t &= g_t(x_t,v_t) \end{align} \end{document} However, it is not a ...


1

It may be nice for your readers if you state the substitution steps one by one. Using the idea suggested in @egreg's answer to use a dedicated environment -- called substitutions, say -- that lists the steps one at a time, one might typeset your equation as follows: \documentclass{article} \usepackage{amsmath} % provides 'aligned' environment ...


3

I'd define my own environment for this. \documentclass{article} \usepackage{amsmath} \newcommand{\diff}{\mathop{}\!d} \newenvironment{subst} {\renewcommand{\arraystretch}{1.2}% \left\|\begin{array}{l}} {\end{array}\right\|} \begin{document} \begin{equation*} \int x\sqrt{x-1}\diff x \begin{subst} t=\sqrt{x-1}, t^2=x-1,\\ x=t^2+1, \diff x=2t\diff t ...


7

The equation is way to wide. \maxdimen is 16383.99998 pt = 1073741823 sp = (230 - 1) sp≈ 5.76 m. I can fit the equation to \maxdimen only, if the font size is reduced dramatically: \documentclass[12pt]{article} \usepackage{fix-cm}% to provide smooth tiny font sizes \usepackage{amsmath,mathtools} \usepackage[ paperwidth=\maxdimen,% normal paper ...


1

As I suggest idb here is meant to be a three-character variable. If this is the case you can write it in math mode as follows: $\mathit{idb}$ Then you get the correct spacing because LaTex assumes idb is just i times db here and db is treated as a differential term. If you mean the multiplication just write it as follows: $idb$ An image is provided for ...


3

Since you mention "inline", I will point out that \verb will not break across lines. However, if that is needed, then this approach, using \detokenize could work if you don't have unbalanced braces, and if you don't need to print % or # signs in the string. \documentclass{article} \usepackage[T1]{fontenc} \begin{document} \texttt{\detokenize{\[ This is a ...


5

Figured it out thanks to the comment by Sigur. \verb#\[# \verb#\]# or alternatively, thanks to Sigur as well, \verb+\[ \]+. I read this question previously, which seemed to suggest to me that I always needed to use texttt, but it looks like I was wrong.


1

If you need it only for the 2x3 matrix: \documentclass{article} \usepackage{array} \let\SC\scriptstyle \def\Biggg#1{\makebox(0,0){\put(0,-20){\bigg#1}}} \begin{document} $ \begin{array}{r@{\kern5pt}ccc@{}l>{\SC}l} & \SC C_1 &\SC C_2 &\SC C_3\\ \Biggg[ & 1 & 2 & 7 & \Biggg] & R_1 \\ & 2 ...


1

% arara: pdflatex \documentclass{article} \usepackage{blkarray} \newcommand{\mLabel}[1]{\mbox{$\scriptstyle{#1}$}} \begin{document} \[ \begin{blockarray}{c@{}ccc@{\hspace{4pt}}cl} & \mLabel{C_1} & \mLabel{C_2} & \mLabel{C_3} & & \\ \begin{block}{[c@{\hspace{5pt}}ccc@{\hspace{5pt}}c]l} & 1 & 2 & 7 & & ...


1

kpfonts has a nomath option for precisely this purpose. It will load all Kepler text fonts, but not modify any mathematics fonts. The \usepackage[math]{blindtext} and \blindmathpaper in the example are just for some sample text with mathematics; they are not needed for your actual document. Code: \documentclass{article} \usepackage[nomath]{kpfonts} % load ...


3

Instead of using the mathpazo package, which is (a) quite old and (b) well known for having various font metric problems, you could use the newpxtext and newpxmath packages. These are derived from the mathpazo package but have much better font metrics. In particular, these packages produce well-spaced hat symbols. If you use these packages instead of ...


3

Here I use stackengine to add a stacking gap on the argument of \hat. I also use scalerel package to preserve the math style, and to express the stacking gap, .3\LMpt, in terms of a unit that scales with the math style (as an argument to \ThisStyle{}, \LMpt is a scalable version of 1pt, that will scale with smaller math styles). The hat kerning is lost, ...


1

I suggest using the empheq package for a simpler syntax, with option overload. It loads mathtools, which in turn loadsamsmath. I also usenccmath` for its mediumsized fractions, that look better here, in my opinion: \documentclass{article} \usepackage[overload]{empheq} \usepackage{nccmath} \begin{document} \begin{align*}[left = \empheqlbrace] a^{3} + ...


2

When I tried using cases, it aligned nicely and worked just fine: \[ \begin{cases} a^3+b^3 &= -q \\ ab &= -\dfrac{1}{3}\,p. \end{cases} \] If that isn't an answer and you really are stuck with using the array, you might try to change the column separator to an equals sign with a bit of space around it, and then put @{} before the ...


3

I would use aligned rather than array here, because semantically it's not really a cases situation nor an array: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \left\{ \begin{aligned} a^{3} + b^{3} &= -q \\ ab &= \dfrac{-1}{3} \, p \end{aligned} \right. \end{equation*} \end{document}


1

The column separation specification @{<stuff>} inserts <stuff> between the columns, so the result is as expected in your case. If you want a 2.5pt gap, then you need to insert @{\hspace{2.5pt}}. However, if your main aim is to align the parts at the = sign, then you can use \documentclass{article} \usepackage{amsmath} \begin{document} ...


0

Leaving aside the power and flexibility of LaTeX, the huge existing codebase coupled with the lack of good conversion tools is a currently an insurmountable obstacle to any move away from LaTeX. I teach university mathematics. Like most of my colleagues, I maintain several hundred teaching related LaTeX documents (plus many other research documents). I would ...


3

If you load amsmath you can get the behavior you want with just two definitions: \documentclass{article} \usepackage{amsmath} \makeatletter \renewcommand{\slimits@}{\limits} \renewcommand{\nmlimits@}{\limits} \makeatother \begin{document} \( \sum_{i=0}^{3} \int_{-5}^{5} \lim_{n\to\infty} \prod_{j=0}^{n} \max_{j}\log_{2} x_{j} \) \[ \sum_{i=0}^{3} ...


3

This should work, placed in the preamble: \let\NOLIMITS\nolimits \let\nolimits\limits \let\displaylimits\limits \usepackage{amsmath} This prohibits completely limits to the right, the only way how to impose them now is using \NOLIMITS. It is necessary to use the tweaks before loading amsmath and it is necessary to load amsmath since amsmath redefines all ...


2

One hack would be to write: \let\originalsum=\sum \def\sum{\originalsum\limits} Of course, you would have to do this for every symbol that you wanted to "automate" the limits for. If you wanted to be swish you could do this in one hit with: \usepackage{etoolbox} \newcommand\ImposeLimitsOnOperator[1]{% \expandafter\let\csname ...


2

If I may, there is another alternative that provides more flexibility. i.e., Use of \rule[raise-height]{width}{thickness} The \rule command is used to produce horizontal lines. The arguments are defined as follows. raise-height specifies how high to raise the rule (optional) width specifies the length of the rule (mandatory) thickness ...


5

If I understand what you're trying to do, you can use \overline{\phantom{<text>}}: \documentclass{article} \pagestyle{empty} \begin{document} $\overline{\phantom{A}}: A\to B$ $\overline{\phantom{AA}}: A\to B$ $\overline{\phantom{AAA}}: A\to B$ \end{document}


4

There are two orders of problems: the distance from the arrow to the symbol is too big; in subscripts or superscripts, the arrow is too wide. Here's a solution for both. \documentclass[titlepage]{article} \usepackage{amsmath,graphicx} \newcommand{\harp}[1]{\mathpalette\harpoonvec{#1}} \newcommand{\harpvecsign}{\scriptscriptstyle\rightharpoonup} ...


0

Macros from the stackengine package allow one to set the vertical stacking gap. Compare items 1 vs. 2 and/or items 3 vs. 4, and/or 5 vs. 6 for a demonstration of changing the stacking gap. In addition, the appearance will also be affected by what is considered the baseline of the subscipt. In 1, 2, the baseline is between the "r" and the harpoon; in 3, 4, ...


1

A solution using the accents package. The difference of vertical spacing with respect to the O.P. method with \overset is null in scriptscriptstyle, slight in \scriptstyle and more important in \textstyle. Otherwise the placement is different : \documentclass[titlepage]{article} \usepackage{amsmath,amssymb} \usepackage{accents} ...


4

Here's a quick-and-not-too-dirty offering: a macro called \harp. It assumes it'll be used in subscript and superscript positions only. For now, it only works with letters that do not have an ascender part. I.e., don't use if with letters such as b, d, f, h, etc. (If you do need to use the macro with such letters, you'll need to tweak the argument of the ...


5

i) A tabular stack does the work almost everywhere there are ordered rows and columns of symbols, but a scalebox won't compile inside it. \scalebox should work there. ii) A raisebox seems to work well in some cases, but it won't compile when placing math mode font size commands inside it, and in similar instances. a \raisebox forms a ...


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} ...


6

From the amsmath user guide: The split environment is designed to serve as the entire body of an equation, or an entire line of an align or gather environment. There cannot be any printed material before or after it within the same enclosing structure. In particular, you can't have \left\{ to the left and \right. to the right of the split material. ...


7

The most likely cause is that you have an unbalanced pair $...$, this would make < produce an upside down question mark. \/ does not produce a slash, but a small amount of space (italic correction), use / or better \slash instead. As others have said in a minimal document your snippet compiles without error. However there are many mark-up details ...


0

To expand on 1010011010's comment: What you need is inline math. This is done by putting dollars signs $ math expression here $ around the expression. Double dollars signs denote display math, which is rendered on its own line and with more space (and usually centered). Also, it is prefereable to use \[ math expression \] to $$ math expression $$. See this ...


0

Here arer two ways of doing things. I define right aligned notes, that require using the flalign(*) environment and the \llap command. If there is enough white space to input a (short) note, you use the \shortrnote command. If there is not, you put the note on a line of its own. Similarly, I define left aligned notes, that use the alignat(*) environment ...


2

As mentioned before, the amsmath command \DeclareMathOperator{\Det}{Det} is a good way to do this, but this is actually basically a wrapper for \newcommand{\Det}{\operatorname{Det}}. So if you only want to use the command once and don't want to define a symbol (especially useful if you are using an online tex editor), then just use \operatorname And just ...


0

Thanks Andrew, that helped a lot! My final solution, for reference is (no section numbering, \g as environment shorthand): \documentclass[10pt,a4paper]{article} \usepackage{amsfonts} \usepackage[fleqn]{amsmath}%fleqn for align left \let\ul=\underline \newenvironment{Gather}[1]{\subsection*{\underline{#1}}% \minipage{\textwidth}\csname ...


1

With reference to your previous question: You can use \mathrlap also in the first three lines. \documentclass[10pt]{amsart} \usepackage{mathtools}% loads also amsmath \begin{document} \begin{alignat*}{3} \vert x + y + z \vert^{2} &= \mathrlap{[\cos{a} + \cos{b} + \cos{c}]^{2} + [\sin{a} + \sin{b} + \sin{c}]^{2}} \\ &= 3 ...


0

I can only guess that you have in mind one of the following: \documentclass{article} \usepackage{amsmath,amssymb} \begin{document} \[ \gtrless\text{ or }\lessgtr \] \end{document}


0

As far as I understand, you want to obtain the following (Oh!): \documentclass[10pt]{amsart} \usepackage{} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsthm} \usepackage{newlfont} \usepackage{mathtools} \usepackage{tikz} \begin{document} \begin{alignat*}{3} \vert x + y + z \vert^{2} &= [\cos{a} + \cos{b} + \cos{c}]^{2} ...


3

You could try something like the following: \documentclass[10pt,a4paper]{article} \usepackage{amsfonts} \usepackage[fleqn]{amsmath}%fleqn for align left \let\ul=\underline \newenvironment{Gather}[1]{\subsection{\underline{#1}}% \minipage{\textwidth}\csname gather*\endcsname} {\csname endgather*\endcsname \endminipage} \begin{document} ...


6

What do we know about \mathon and \mathoff? They are displayed by \showbox, \showlists and in other situations where the contents of a box or of a typeset list are written to the terminal or the log file. As can be read in paragraph "12. Displaying boxes", all these are implemented through the procedure show_node_list, which displays a node list (the data ...


4

In tex.web, you'll find 3826: @ @<Display math node |p|@>= 3827: begin print_esc("math"); 3828: if subtype(p)=before then print("on") 3829: else print("off"); 3830: if width(p)<>0 then 3831: begin print(", surrounded "); print_scaled(width(p)); 3832: end; 3833: end making it part of the "procedure Display math node. \mathon and \mathoff is ...


3

According to the description on page 170 of the TeXbook, automatic glue around math atoms can be “conditional”, that is, inserted only in display and text styles: Here 0, 1, 2, and 3 stand for no space, thin space, medium space, and thick space, respectively; the table entry is parenthesized if the space is to be inserted only in display and text styles, ...


4

1. Go to this side and check which fonts on your system provide this symbol. 2. Try including them like below and choose the one, you like most: % arara: lualatex \documentclass{article} \usepackage{unicode-math} \begin{document} Asana Math: \setmathfont{Asana Math} $\symbol{"003D0}$ XITS Math: \setmathfont{XITS Math} $\symbol{"003D0}$ Linux Libertine ...


2

You can have them with the MinionPro package, and (PDF)LaTeX both in usual and in French style: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{MinionPro} \begin{document} \[ \varbeta^{2} + \varkappa^{2} = \upvarbeta^{2} + \upvarkappa^{2} \]% \end{document} The same is probably true with MyriadPro. Not ...



Top 50 recent answers are included