Tag Info

New answers tagged

3

I should probably not be surprised to get negative points for this answer. Here's something you could do, but I think it results in a very ugly output. Granted, this is a brute-force approach and could probably be a bit more prettified. But even then, I think, it would still be ugly. \documentclass{article} \usepackage{booktabs} ...


1

I agree that the concern for nested \mathchoices is real (I've seen cases that don't involve \text where it is significant, see, for example, Serious problem with \widebar, and the "important note" suffixed to the answer). But rather than asking the question, "when do I 'need' \text?", I am looking at it as "how can I make \text work for me? In my MWE, the ...


5

If it's a “one shot”, then $\langle w,\tilde{w}\rangle$ will be sufficient. If you have several inner products to typeset it is surely better to define a personal command for them; there are several possibilities. The simplest one is \newcommand{\innp}[1]{\langle #1\rangle} to be called as $\innp{w,\tilde{w}}$ $\innp{x,y}$ Defining a command is ...


1

You can try the physics package. It provides quite a lot of macros that are useful. The following code does what you want and in my opinion, it is quite simple :-) \documentclass{article} \usepackage{mathtools} \usepackage{physics} \begin{document} \[ \ev{w,\tilde{w}}. \] \end{document} Here \ev stands for expectation value.


4

To have a correct horizontal spacing and delimiters that adapt to the size of what's inside, you can use the mathtools package (it loads and extends amsmath). You have commands to define "paired delimiters" such as a scalar (inner) product: \DeclarePairedDelimiterX\innerp[2]{\langle}{\rangle}{#1\,,\,#2} Then you'll have two versions for inner products: ...


0

\documentclass{article} \begin{document} $y = \{ {a ,b ,c}\}\newline y\subseteq x\newline x = \{ {\{{a, b, c}\}, d, e, f}\} $ \end{document} Works fine.


2

While this is similar to @Bernard's, it seems to me the list of cases belong with the second line alone. The following numbers only the second line: \documentclass[a4paper, 11pt]{book} \usepackage{amsmath} \begin{document} \begin{align} W \in \mathbf{M}_N & \rightarrow W' \in \mathbf{M}_{N+1} \notag\\[-8pt] (w_{ij})_{1\leq i,j\leq N} & \mapsto ...


2

I realize that you specified you want to place the entire expression on two lines. However, I think the following form, which extends over five lines and uses a split environment inside an equation environment, may have some merit: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{split} W \in \mathbf{M}_N ...


3

\StrLeft is not robust and it should not expand its argument the hard way. The unbreakable stuff should be put into curly braces. Example based on the accepted answer of the cited question. Additionally it is modified to avoid the extra dots if they are not needed. \documentclass[12pt]{article} \usepackage{xstring} \usepackage{titleps} ...


1

Another solution, using alignat, aligned and cases: \documentclass[a4paper, 11pt]{book} \usepackage{amsmath} \begin{document} \begin{alignat}{2} & \begin{aligned} W \in \mathbf{M}_N & \longrightarrow W' \in \mathbf{M}_{N+1}\\[4pt] (w_{ij})_{1\leq i,j\leq N} & \longmapsto (w_{ij})_{1\leq i,j\leq N+1} \end{aligned} & \enspace ...


4

You could use the cases environment. See section 3.7 of the amsmath package documentation. Here I have split your equation in two so that it does not spill over the right margin. \documentclass[10pt]{article} \usepackage{amsmath} \begin{document} \begin{equation} W \in \mathbf{M}_N \rightarrow W' \in \mathbf{M}_{N+1} (w_{ij})_{1\leq i,j\leq N} \mapsto ...


8

A displayed equation should never be at the top of anything. The problem is that a paragraph is started and then the equation is typeset. \documentclass{beamer} \usetheme{Antibes} \usepackage{amsmath} \begin{document} \begin{frame} \begin{block}{Separation of variables} \vspace*{-\baselineskip}\setlength\belowdisplayshortskip{0pt} \begin{equation} 1 + 2 ...


5

The problem you're encountering is caused by the fact that \midrule can take an optional argument which indicates the thickness of the line to be drawn. Thus, LaTeX scans the string [89$^\circ$$_2$/12.7$^\circ$$_1$/89$^\circ$$_2$] for a unit of measurement, and an error message is generated because no legal unit of measurement (such as pt, cm, etc) is found. ...


3

I am not sure if this the correct formatting of that lines enclosed by [...], but I give it a try ;-) \documentclass{scrbook} \usepackage{booktabs} \begin{document} \begin{table}[h] \centering\small \caption{Thickness measurements on the two tubes.} \label{tab:Thickness_measurement} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lll} ...


3

The following example defines \boxwedge and \owedge using TikZ: The symbols adapt in size and line width according to the current math style. They are defined as binary operators like \boxplus and \oplus. The height, width/side bearings are derived from \boxplus and \oplus. \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{tikz} ...


3

Instead of using nested equation* and aligned environments, you could use a single align* environment. Two additional suggesions: (i) for the separation between the equation and condition parts, you could employ \qquad ("double \quad"); (ii) for a bit more vertical separation between the two rows, you could [1ex] immediately after the first \\ line break ...


2

If you don't want the equations numbered (since you are using aligned), just adding a && after the = 0 on each row will insert a \quad = 1em horizontal gap between the equation and what follows AND left-align the following content (a single & would also add the 1em gap, but right-align what follows). The aligned type environments are aligned ...


0

The alignat environment can do what you want. Here are two suggestions — the second one requires using the mathtools package, which loads amsmath anyway: \documentclass{article} \usepackage{mathtools} \begin{document} \noindent A first solution: \begin{alignat}{2} \frac{\partial \Psi}{\partial x} &= 0 & \hspace{4em} & \mbox{ for } 0 \leq y ...


0

Just to 'close' this question... \documentclass{scrbook} \begin{document} There are principally two methods to write an equation surrounded by text: \begin{enumerate} \item Displaystyle -- in a separate line It makes quadratic equation which is \[ ax^2 \pm bx \pm c,\] then by eliminating the constants and lower order terms... \item Inline It makes ...


5

If you are willing to live under the constraint that all matrix elements occupy the same width (though your question implies that such a constraint may actually be a desirable requirement), then this \sqmatrix[alignment]{content} macro will do the "squaring" automatically. Inter-element spacing (default 0pt) may be specified with \setstacktabbedgap{length}. ...


11

Adjust \arraystretch to an appropriate factor: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \renewcommand{\arraystretch}{1.3} \begin{bmatrix} \times & \times & \times & & & & & & \\ \times & \times & & \times & \times & ...


1

Simply define bondoxo as mathscript: \usepackage[scr=boondoxo, scrscaled=.98]{mathalfa} and use it via \mathscr. This way you can use both fonts, if you wish. Comment aside — the esdiff package makes it simpler to type partial derivatives, especially for crossed derivatives and specifying at which point the derivative is evaluated.


3

The BOONDOX font has the suitable interface: \documentclass[a4paper, 12pt]{scrartcl} \usepackage{amsmath} \usepackage{mathpazo} \usepackage{BOONDOX-cal} \newcommand{\derivataparziale}[3]{\dfrac{\partial^{#1}{#2}}{\partial {#3}^{#1}} } \begin{document} $\mathcal{E}(y) = - \derivataparziale{}{V(y)}{y}$ \end{document}


4

You could set the height of each line manually providing the line height in square brackets after each line end: \times & \times & ... & \times\\[1ex] To give all lines the same height, you can use a macro: \documentclass{article} \usepackage{amsmath} \newcommand{\squarelineheight}{0.9ex} \begin{document} \[ \left[ \begin{matrix} \times ...


4

To fully reproduce the screenshot you've posted, you need (as also pointed out in a separate comment by Heiko Oberdiek): \left\{ and \right\} for auto-scaled curly braces \mathbf{O} and \mathbf{e} to typeset "O" and "e" in math-bold A full MWE (minimum working example): \documentclass{article} \begin{document} \[ \left\{ ...


1

Add \nonumber or \notag for the lines you want unnumbered. By the way, are you sure flalign is the best option? I ask because this environment is rarely used.


8

This code should give you what you want: \documentclass{article} \usepackage{mathtools} \begin{document} \begin{equation*} \left\{\mathrm{O}^{\left(i\right)},\mathrm{e}^{\left(i\right)}\right\}_{i=1}^M \end{equation*} \end{document}


1

The second problem can be solved by giving spaces next to comma. Like this: $\mathcal{S}$ = \{\textit{Unclassified}, \textit{$Secret_1$}, \textit{$Secret_2$}, \textit{Top Secret}\}.


8

Avoiding line breaks in inline formulae For the first problem, it maybe requires a little rearranging/rephrasing. You can for example rephrase the previous sentence so it is a little longer and the formula (along with its introducing "Let") gets pushed into the next line. Another option, as suggested in the comments, is to turn the formula into a ...


3

I have never seen any rules on this, but both of your examples are quite hard to read. I will just point out some thoughts about readability: a minus followed by a minus could be understood as a plus. When reading the whole formula (and not being used to such repetition like in Russia, as pointed out be egreg), I would read j sin z minus minus j sin z ...


1

\usepackage{mathrsfs} $\mathscr{F}$ Take a look at What are all the font styles I can use in math mode?


3

I think you want to edit the style of fonts and symbols, but unless you give graphical details of what you want to achieve it is difficult to do it. The symbol for "belongs to" is obtained with \in. Then you can play with \mathcal if you want stylized R: $M \in \mathcal{R}^N$ This looks like:


0

\documentclass[preview,border=12pt,12pt,varwidth]{standalone}% change this line to \documentclass{article} or whatever you want. \begin{document} \noindent The square root of 100 is $\sqrt{100}=10$. \\ But the cubic root of 64 is $\sqrt[3]{64}=4$. \end{document}


0

You can just use \sqrt{.........} and put what ever numbers between the brackets.


4

This uses a stacking approach. This answer is helping me to think of ways to automate dotted/dashed lines as part of stacks, which in this MWE, had to be done very manually. \documentclass{article} \usepackage[usestackEOL]{stackengine} \usepackage{graphicx} \stackMath % DASHED LINE OF SPECIFIED LENGTH % From morsburg at ...


6

Since revtex4 seems to be incompatible with the arydshln package, here's an option using TikZ: \documentclass[aps,prl,twocolumn,nofootinbib,superscriptaddress,floatfix]{revtex4} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \[ \Biggl(\mkern-5mu \begin{tikzpicture}[baseline=-.65ex] \matrix[ matrix of math nodes, column sep=1ex, ] (m) { B ...


2

Use the cases environment from \usepackage{amsmath}. \[f(x)= \begin{cases}% 7 & \text{if $x=0$}\\ 3x^2-2 & \text{otherwise} \end{cases} \]


9

You can adjust the dash and gap of the \hdashline by modifying the lengths \dashlinedash and \dashlinegap: \documentclass{article} \usepackage{tabularx} \usepackage{arydshln,leftidx,mathtools} \setlength{\dashlinedash}{.4pt} \setlength{\dashlinegap}{.8pt} \begin{document} \[ \leftidx{_{m-r}^{\phantom{m-r}\llap{$\scriptstyle r$}}}{\left( ...


5

In Unicode, a combining mark is associated with the character that precedes it, so you should use $x⃗$(the content between dollar signs is letter x followed by U+20D7 COMBINING RIGHT ARROW ABOVE). And you should declare a mathematical font that contains the character. But it still won’t work, presumably due to limitations in unicode-math, in fonts, or in ...


4

Define it just like \min is defined: \def\argmin{\mathop{\rm argmin}}


2

I would type the formula as displayed: \documentclass{article} \usepackage{amsmath} \begin{document} \noindent Text before. \begin{align*} P^{1}_{r,s} &= \sum_{i = r}^{n}P(\text{$i$ applicant is selected and is the best})\\ &= \sum_{i = r}^{n}P(\text{$i$ applicant is the best}) \cdot P(\text{$i$ is selected $\mid$ is the best}) \end{align*} ...


3

TeX inserts breakpoints after binary and relational operators with penalties \binoppenalty and \relpenalty. However, subformulas cannot be broken across lines. A pair of curly braces create a subformula as in the example of the question. Therefore the * does not create a breakpoint. If you want breakpoints inside the text part of the formula, then the text ...


7

You can use fancytooltips; one restriction is that this won't work in most PDF viewers; you need Acrobat Reader: Your main document will look something like this: \documentclass{article} \usepackage{xcolor} \usepackage[filename=proofs,mouseover,noextratext]{fancytooltips} \usepackage{amsmath} \usepackage{amsthm} \usepackage{lipsum} ...


5

This can be achieved with Optical Content Groups (OCG). There are some packages that support OCG. A CTAN search revealed the following packages: Package ocg-p Package ocgx Package ocgtools Example for ocgx (randomly choosen): \documentclass{article} \usepackage{ocgx} \begin{document} \noindent My theorem. \begin{ocg}{OCG 1}{ocg1}{0} My proof. \end{ocg} ...


7

The restriction of the AMS alignments that they may not be hidden behind command forms is documented on page 28 of the amsmath guide (texdoc amsmath ) Actually the restriction is better described in the technical notes (texdoc technote) as shown in the other answer. The names chosen here are particularly dangerous as using \def you lose the warning that you ...


10

The technote document explains why this kind of shorthand definitions will fail:


1

The answer from ( http://www.latex-community.org/forum/viewtopic.php?f=5&p=4872 )works for me: =================== Re: Can I have more control over my subscripts? Postby ptoche on Thu Aug 7th, 2008 Great tip. My contribution is absolutely trivial: In preamble, define: \newcommand{\ms}{\scriptscriptstyle} In text, type: {\ms TEXT} where "ms" stands ...


3

Just close math mode and reopen it: \documentclass{article} \usepackage{stmaryrd} \newcommand{\sem}[2][]{% \mbox{$\llbracket$\bfseries #2$\rrbracket^{#1}$}% } \begin{document} Here are \sem{Two words} and here is \sem[1]{One}. \end{document}


1

The parenthesis in the example provided is not really necessary. The problem here was the fact of forgetting to group the superscripts/subscripts in braces. This is a good practice. Hence the right approach is illustrated below: \documentclass[letterpaper]{article} \begin{document} $p= \sqrt{2}^{(\sqrt{2})}$ $p= \sqrt{2}^{\sqrt{2}}$ \end{document}


4

< and > are relational operators ("less than" and "greater than"). They can be used as delimiters, but TeX needs to know it (the traditional way with \langle and \rangle are added for comparison): \documentclass{article} \begin{document} \[ \mathopen< a, b, c \mathclose> \times T = \langle a, b, c \rangle \times T \] \end{document} ...



Top 50 recent answers are included