Tag Info

New answers tagged

1

As noted in comments the amsmath and breqn documentation have several good examples, also the mathtools package has extended versions of several of the amsmath alignments. But the usual style here is to answer inline rather than refer to manuals, so this is a document giving the basic usage of the environments you mention. \documentclass{article} ...


3

I know this was a long time ago, but how about using Sam Buss's macro that is supposed to work for Gödel numbers. See http://www.logicmatters.net/latex-for-logicians/symbols/corner-quotes-for-godel-numbers/ \documentclass{article} \usepackage{amssymb} \newbox\gnBoxA \newdimen\gnCornerHgt \setbox\gnBoxA=\hbox{$\ulcorner$} \global\gnCornerHgt=\ht\gnBoxA ...


8

Easy enough: use aligned: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \begin{aligned} x + 2 &= 3\\ % First equation -2 &= -2\\ % Second equation \hline x &= 1 \end{aligned} \end{equation*} \end{document} Better yet, use also booktabs and \midrule: \documentclass{article} \usepackage{amsmath,booktabs} ...


14

Here's a solution that uses an array environment and takes care to preserve the appropriate amounts of spacing around operators of type mathbin ("+" and "-") and mathrel ("="). It also uses the macro \midrule (from the booktabs package) to get nice spacing around the horizontal line. \documentclass{article} \usepackage{array,amsmath,booktabs} ...


5

Use a tabular \documentclass{article} \usepackage{amsmath,array} \begin{document} \begin{tabular}{>{$}r<{$}@{\,}>{$=}l<{$}} x + 2 & 3 \\ -2 & -2 \\ \hline x & 1 \end{tabular} \end{document}


2

The \mathpunct{} (without : inside {}) is the definition of \colon. Link1 Both : and \colon typeset a colon, but \colon is a punctuation symbol, while : is considered as a relation symbol as regards to spacing. Link2


2

Here are unicode math macros I think I'll try to use: \documentclass{article} \usepackage{amsmath} \usepackage{unicode-math} \setmathfont{Asana Math} \usepackage{newunicodechar} % roots: \newunicodechar{√}{\sqrt} \newunicodechar{∛}{\sqrt[3]} \newunicodechar{∜}{\sqrt[4]} % full differential: \newunicodechar{d}{\,\mathrm{d}} % superscripts: ...


6

It's easy with newunicodechar \documentclass{article} \usepackage[intlimits]{amsmath} \usepackage{ifxetex} \ifxetex \usepackage{unicode-math} \removelimits{\int} \else \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \fi \usepackage{newunicodechar} \newunicodechar{√}{\sqrt} \ifxetex\else % these are already available with unicode-math ...


4

Use \DeclareMathOperator{operatorcommandname}{operator name} in the preamble for function or operator names that should be printed upright. \documentclass{article} \usepackage{amsmath} \DeclareMathOperator{\sinc}{sinc} \DeclareMathOperator{\si}{si} \begin{document} \begin{align} \si(x) &= \dfrac{\sin(x)}{x} \\ \sinc(x) &= \si(\pi x) ...


1

Going with simplicity, and the most common use case for the win I'm copying my edits here as the answer. According to How can LaTeX code in a data file be read by pgfplotstable? it is impossible to insert expandable material in headers to be formatted by pgfplotstable. Therefore, as in percusse comment use column name key to access and format any column ...


3

You can't use \left and \right across& which limits the scope. Also, it is not a good idea to use \left and \right, use \big brothers family from amsmath. These need not be balanced. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{split} \left\{\right.&(a,b) \mid \\ &\left. a \in A, b \in B\right\} ...


2

Have a look at http://ctan.sharelatex.com/tex-archive/macros/latex/contrib/physics/physics.pdf 2.5 Derivatives I use it and i am very happy with this package. EDIT: \documentclass{article} \usepackage{amsmath} \usepackage{physics} \usepackage{amssymb} \begin{document} \begin{align} \left(\int\limits_{-\infty}^\infty e^{-x^2} \dd{x} \right)^2 ...


0

Short Description Here are three solutions -- see the example. Links http://ctan.org/pkg/amsmath http://ctan.org/pkg/mathtools Example \documentclass{article} \usepackage{mathtools} % also loads amsmath \usepackage{parskip} \begin{document} \section{Using \texttt{flalign}} \begin{flalign} \text{Proof} && a &= b &&\\ ...


0

This is my take formatting the MWE. Among other things, it replaces \item with \tag. \documentclass[12pt]{article} \usepackage[leqno]{amsmath} \usepackage{enumitem} \usepackage{amssymb} \newcommand{\mytext}[1]% #1 = same as intertext {&\rule[-0.5\baselineskip]{0pt}{1.5\baselineskip}\textrm{#1}&\\} ...


1

As a follow up to @Werner's excellent explanation, as I was using R I created a sanitise function to use instead of the default xtable::sanitize function that escapes these appropriately. The package optiRum can be downloaded for the sanitise function to be used.


0

I use \text{-} for a shorter minus sign.


4

You can underline the whole equation or colour it..... using tcolorbox. \documentclass[14pt,a4paper,headlines=6,headinclude=true]{scrartcl} \usepackage{amsmath,amssymb,stmaryrd} \usepackage{empheq} \usepackage[theorems,skins]{tcolorbox} \newtcbox{\underlined}[1][]{nobeforeafter,math upper,tcbox raise base, enhanced ...


2

Is this what you want? After a lot of phantoms, looks right. \begin{align*} \mathcal{H} (c, K, \lambda, t) &= \frac{c^{1-\frac{1}{\sigma} } -1}{1 - \frac{1}{\sigma}} + \lambda \cdot \left( r \cdot K + w \cdot L_Y + \Pi_x \cdot A - c \cdot L \right) \\ \rlap{% \underline{% \vphantom{$\displaystyle\frac{\dot c}{c}$}% \hphantom{$\Leftrightarrow ...


3

LaTeX can be hard to get started with. I can't comment on assistive technology, but — if a good LaTeX editor with syntax hilighting (or a WYS IWYG editor) will do — then I can give suggestions for how to get better output, and to write it more easily. Here are a few pointers which might help you to speed up your workflow, or at least get more ...


2

Use align, not gather: \documentclass{article} \usepackage{amsmath} \newcommand{\suchthat}{\mid} \begin{document} \begin{subequations} \label{eq:omegai} % \begin{align} \label{eq:omega0} \Omega_0 ={}& \{(\omega_{12},\omega_{23}) \suchthat \hat{\omega}_{12} > \omega_t,\ \hat{\omega}_{23} > \omega_t,\ \hat{\omega}_{31} > \omega_t \} \\ % ...


4

Apart from the wrong dots, it seems an align*: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath,amssymb} \usepackage{lipsum} \begin{document} \lipsum*[2] \begin{align*} \{B_1,\dots,B\cup\{\lnot\lnot\phi\},\dots,B_i\}\quad & \rightsquigarrow \quad \{B_1,\dots,B\cup\{\phi\},\dots,B_i\} \\ ...


2

You can use a regular array: \documentclass{article} \usepackage[margin=1in]{geometry}% Just for this example \usepackage[nopar]{lipsum}% Just for this example \usepackage{amsmath,amssymb} \begin{document} \lipsum[1] \[ \begin{array}{r@{\quad\rightsquigarrow\quad}l} \{ B_1, \dots, B \cup \{ \neg\neg\phi \}, \dots, B_i \} & \{ B_1, \dots, ...


5

It's much easier to debug code with a working minimal example rather than a code fragment. The problem with your code is that you have a \right} that isn't matched and doesn't seem to do anything. The label for an underbrace is added with _X after the \underbrace argument. Here is a fixed example. I've also replaced \Bbb with \mathbb as the former command ...


0

A (similar) alternative, using gathered environment: \documentclass{article} \usepackage{amsmath} \newcommand{\xdownarrow}[2][]{% \left.{#1}\right\downarrow{#2}} \begin{document} $ \xdownarrow[\begin{gathered} \vspace{5cm} \end{gathered}]{} $ \end{document} If you want, it can be used with linebreaks inside: $ \xdownarrow[\begin{gathered} ...


4

You are already using package amsmath and have therefore \tfrac, which puts the fraction in the math style \textstyle: \documentclass[10pt]{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{geometry} \geometry{a4paper, total={14.5cm, 23cm}} \newcommand*{\diff}{\mathop{}\!d} \begin{document} The amplitude $u_2 (x_2, y_2)$ at the back focal ...


2

The symbols provided by MnSymbol are not set up for use with unicode-math. Some are missing, some are not scalable in size. These need to be replaced by a different math font. For my opinion XITS Math does a good job. One just needs to find the unicode characters due to fix. Partial differential \partial: \setmathfont[range={"2202} ]{XITS Math} The ...


5

I think you have two options: Insert one or more judiciously chosen \allowbreak directives inside the inline math equation to allow line breaks after one of the commas, or Convert the inline equation to a displayed equation, as (i) the equation may be sufficiently important to merit this treatment and (ii) you're dealing with fairly narrow columns. ...


8

Such a big formula should be in a displayed formula, see later for reasons. Use equation or equation* (the latter if you don't want an equation number). I also changed a bit your preamble, with instructions to geometry rather than setting internal parameter such as \topmargin or \evensidemargin: you seem to want one inch margins and \geometry{margin=1in} ...


9

There is a bunch of options to improve this: Put T(n) in math mode --> spacing before = is better Use \left(....\right) to get bigger bracket, however the spacing before and after brackets are too large Use \biggl(...\biggr) for larger brackets and better spacing Use \mleft( and \mright) from the mleftright package for adapted brackets and better spacing ...


4

\limits can be used after \sum to put the bounds below and above instead to the side: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{gather} \hat{r}_{ui} = \bar r + \sigma_u \cdot \frac{ \sum_{v \in N_i(u)} w_{uv} (r_{vi} - \bar{r}_v) / \sigma_v }{ \sum_{v \in N_i(u)} |w_{uv}| } \\ \hat{r}_{ui} = ...


4

Don't use \epsilon for "element of"; instead, use the \in macro. You need to place curly braces around the material that's to be placed in the exponent positions. Don't switch in and out of math mode in one and the same equation. \documentclass{article} \begin{document} $A(n) \in \Theta(n^{\log_b a}) = \Theta(n^{\log_2 2} ) = \Theta(n)$ \end{document}


2

An example with tcolorbox \documentclass{article} \usepackage[most]{tcolorbox} \usepackage{amsmath, amssymb} \begin{document} \begin{tcolorbox} \[ \begin{bmatrix} 1 & 2 & 3 \\[0.3em]\end{bmatrix}.* \begin{bmatrix} 4 \\[0.3em] 2 \\[0.3em] 1 \\[0.3em] \end{bmatrix} =\text{ERROR} \] \[\begin{bmatrix} 1 \\[0.3em] 2 \\[0.3em] 3 \\[0.3em] ...


3

What about this? I added some vertical spacing at the beginning of inparaenum, with the etoolbox package. Don't forget a blank line: \documentclass[15pt, a4paper]{scrartcl} \usepackage{amsmath,amssymb,stmaryrd} %\usepackage[shortlabels, inline]{enumitem}%usepackage{enumerate} \usepackage{tabto} \usepackage{paralist} \usepackage{setspace} ...


5

This is an all-in-one solution using tasks. Time to use modern packages. I have defined two environments for clarity. \documentclass[12pt, a4paper]{scrartcl} \usepackage{amsmath,amssymb,stmaryrd} %\usepackage[inline]{enumitem} %\usepackage{enumerate} %\usepackage{tabto} %\usepackage{paralist} \usepackage[more]{tasks} ...


1

I am not good at pure TeX. (especially the \expandafter stuff.) But this could be a start. (Recall the \section[short]{long long title} syntax.) \documentclass{article} \usepackage{pgfplotstable} \begin{document} \pgfplotstableset{string type,col sep=&,row sep=\\} \makeatletter \gdef\pgfplotstabletypeset@fancy@column@name{} ...


3

The error occurs at the first \lim right after \begin{alignat*}. This environment expects an argument, the number of "equation columns". Since \lim is not a number, TeX throws the error. Unless you have redefined \( and \), they will cause further trouble, because they are usually used for inline math mode. Therefore I have replaced them by normal ...


4

If you hide the widths then you get over-printing without warning. I'm not sure it really works to have so much text in an underbrace, but a couple of suggestions: \documentclass[15pt, a4paper]{scrartcl} \usepackage{amsmath,amssymb} \usepackage{enumitem} \begin{document} this \begin{align*} MR &\stackrel{!}{=} MC \\ ...


1

I interpret the objective of your posting as wishing to modify (specifically, increase) the math subscript offset for all subscripts in the entire document. If this interpretation is correct, the following LuaLaTeX-based solution may be of interest to you. It works by modifying the "primitive" length parameter \Umathsubshiftdown. For a document set in 10pt ...


14

The following example sets \otimes as upper limit over the comma, which is turned to a math operator via \mathop. This also decreases the size of ⊗. By explicitly using \scriptscriptstyle, the symbol can be decreased further, see Manuel's comment. Then the result is wrapped in \mathpunct to keep the property of the comma as punctuation character: ...


14

You can use \overset from amsmath: \documentclass{article} \usepackage{amsmath} \begin{document} \[\{L(\lambda)\ \overset{\otimes}{,}\ L(\mu)\}\] \end{document} I added optional spaces to make it look more like your example: As noted in the comment, you can use \scriptscriptstyle to make \otimes smaller: \documentclass{article} \usepackage{amsmath} ...


5

One possibility \stackrel{\otimes}{,}: $\left\{L\left(\lambda\right)\ \stackrel{\otimes}{,}\ L\left(\mu\right)\right\}$


2

equation* is defined by amsmath. So, if you're loading amsmath, then there is no difference amsmath, as it executes the following at the end: \DeclareRobustCommand{\[}{\begin{equation*}} \DeclareRobustCommand{\]}{\end{equation*}}


1

You also can do it with the changcntr package: \documentclass{article} \usepackage{amsmath} \usepackage{chngcntr} \counterwithin{equation}{section} \counterwithin{equation}{subsection} \begin{document} \section{Section 1 Title} \subsection{Subsection 1.1 Title} \begin{equation} a = b \end{equation} \begin{equation} a+2=b+2 \end{equation} ...


1

In addition to the instruction \numberwithin{equation}{subsection} you need the instructions \makeatletter \@addtoreset{equation}{section} \makeatother The first instruction, \numberwithin{equation}{subsection}, resets the equation counter only when a \subsection instruction is encountered. If you have a \section instruction but no \subsection ...


3

I'm not sure you want a break before (, but rather a possible break after ). \documentclass[a5paper]{ltjsarticle} \usepackage{etoolbox} \usepackage{amsmath, amssymb} \usepackage[math-style=TeX]{unicode-math} \begingroup\lccode`~=`) \AtBeginDocument{% \edef\rparen{\Umathcharnum\the\Umathcodenum`) } \mathcode`)=\string"8000 } ...


5

unicode-math makes only sense if you also have a sensible "unicode math" font that you want to use as base math font. There is no "cm bright math" (sans serif math fonts are sparse ...). So it is better to use for the math setup the non-unicode way: \documentclass[a4paper,12pt]{article} \usepackage{cmbright} \usepackage{amsmath,amssymb} ...


1

I made two adjustments to your MWE I did a small \mkern and minus \mkern around each character to better align them with the slanted counterparts; and More importantly, I used the \ThisStyle{...\SavedStyle...} syntax of the scalerel package to preserve the math style of the argument. Here is the MWE. \documentclass[a4paper]{article} ...


4

You can use a box with width of the widest entry. \documentclass{article} \usepackage{amsmath} % \text nas equacoes \usepackage{mathrsfs} \usepackage{calc} \newlength{\mylen} \settowidth{\mylen}{$(dv_0+(1-dv_0))\text{cd4Hill}(i)$} \newcommand{\mb}[1]{\makebox[\mylen]{$#1$}} \begin{document} Network reaction model: \def\Ph{\text{P}_\text{h}} ...


1

Easiest here is just to scale the entire construction to suit your needs using graphicx's \resizebox or \scalebox functionality: \documentclass[12pt,border=5pt]{standalone} \usepackage{amsmath, graphicx} \begin{document} \resizebox{!}{1000pt}{$\displaystyle \binom{a}{b}$} \end{document}


5

You can use the Latin Modern fonts, provided you fix the largesymbols font: \documentclass[border=10]{standalone} \usepackage{lmodern} \usepackage{amsmath} \DeclareFontFamily{OMX}{lmex}{} \DeclareFontShape{OMX}{lmex}{m}{n}{ <-> lmex10 }{} \SetSymbolFont{largesymbols}{normal}{OMX}{lmex}{m}{n} \begin{document} \fontsize{1000}{1000}\selectfont ...



Top 50 recent answers are included