Tag Info

New answers tagged

3

Something too close? The main difficulty is with the "not \mathcal{D}" character. But, we can go too close using the Zapf Chancery characters. For these, we declare the math font: \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it} The rest of the equation can be typeset with mathptmx. \documentclass{article} \usepackage{mathptmx} ...


2

TeX Gyre Termes. There is a difference for the∀` symbol : \documentclass{article} \usepackage{newtxmath, newtxtext} \begin{document} \begin{align*} \max_{\mathbf{x}} & \sum_{i\in \mathcal{D}}w_i \sum_{k = 1}^{K} R_{ik}^{(D)}(\mathbf{x}) \\ \text{s. t.}\quad & \sum_{i\in \mathcal{D}}x_{ik}P_{D_i}g_{ii}(k)\le Q_k, \quad\forall k, \\ ...


1

In order to make the framed box fit its content one needs to measure the contents width first. In this case I simply assigned the content to measure to box register 0, i.e. \setbox0=\hbox{...} and retrieve its width from \wd0. So, your box macro will be defined as \newcommand*\WideFittedFramebox[1]{% \setbox0=\hbox{\hspace{2em}#1\hspace{2em}}% ...


1

The tabstackengine package has a \fixTABwidth{T} macro to force all columns to be equal width (based on the widest column). In addition to that, I just set the intercolumn gap with \setstacktabbedgap{} and the vertical baselineskip with \setstackgap{L}{}, to achieve whatever spacing is preferred, using a \parenMatrixstack macro. \documentclass{article} ...


1

Adding an \hspace before or after the longest align field will shift the whole block 1/2 of the \hspace value. So, in this MWE, after showing the generic align, I add a 2in shift first to the left and then to the right of the longest element. These should result in a net 1" shift of the block. \documentclass{article} \usepackage{mathtools} ...


0

Here is a solution useing parbox \documentclass{article} \usepackage{mathtools} \begin{document}\begin{align*} W&=\frac{4}{3}\cdot\rho_w\cdot L_s\int\displaylimits_1^3(3-x)xdx\\ W&=78480J\int\displaylimits_1^3(3x-x^2)dx\\ W&=261600J \end{align*} \hspace{5cm}\parbox{\textwidth}{% \begin{align*} W&=\frac{4}{3}\cdot\rho_w\cdot ...


5

You should define a set of custom markup commands (see [1], [2]) for those fraction types, where you employ the xcolor package and the \prescript command from mathtools to do the needed formatting: \documentclass{article} \usepackage{mathtools,xcolor} \newcommand{\coloredfrac}[3][red]{% \frac{\color{#1}#2}{\color{#1}#3} } \newcommand{\ampfrac}[3]{% ...


1

Do you perhaps mean something like "highlight" by "amplify"? Anyway, I think \newcommand{\colorfrac}[3][red]{\frac{{\color{#1} #2}}{{\color{#1} #3}}} would suit your purpose. \colorfrac{1}{2} would give a red '1/2' and \colorfrac[green]{1}{3} a green one (needs the color package). Edit As an answer to your comment: Of course you could, ...


2

Here is a solution \documentclass{article} \usepackage{xcolor} \begin{document} \[\raisebox{\baselineskip}{4)}\frac{1}{2}=\frac{\textcolor{red}{1\cdot4}}{\textcolor{red}{2\cdot4}}=\frac{4}{8}\] \[\raisebox{\baselineskip}{4)}\frac{1}{2}=\frac{\textcolor{red}{1\cdot4}}{\textcolor{red}{2\cdot4}}=\frac{4}{8}\] \end{document}


10

I think you wanted to write *{2}{c@{{}\mathrel{<}{}}}l instead of c*{2}{@{{}\mathrel{<}{}}l} which means having the last two columns left-aligned. In fact, the syntax for multiple columns with same alignment is *{<number of columns>}{<column alignment>} Also, since the < symbol is defined as \mathrel by default, you can ...


2

May be you are looking for \documentclass{article} \def\inv{^{-1}} \begin{document} \[ \begin{array}{c*{2}{@{{}\mathrel{<}{}}c}} 1 & |z| & |k|\inv \\[\jot] |k| & |\phi(z)| & \hphantom{|} 1 \end{array} \] \end{document} in your original code c*{2}{@{{}\mathrel{<}{}}l} means first column is center and the two last column ...


4

In addition to the vertical space between the final two rows of your matrix being smaller than that between other rows, the horizontal space between the first two columns (and between the final two columns) is smaller than that between the other columns. The first issue arises because the height of the \ddots glyph is -- assuming you're using the Computer ...


0

Barbara Beeton explains in a comment that this behaviour is intended to give good-looking fractions in typesetting situations where multiple fractions are near to one another, by setting the baselines of text in the numerator and denominator such that the various baselines of nearby fractions are lined up (even though they might contain a variety of ...


1

Old style books (and Bourbaki up to nowadays) used simply \mathbf Z, \mathbf Q, \mathbf R, \mathbf C As explained by @Au101, the use of blackboardbold faces has its origin in the quasi-impossibility to write boldface letters on a blackboard, and their conventional replacement with double-struck letters


1

You can use $\mathbb{R}$ for this and include the amssymb package: \usepackage{amssymb}. Also consider this: Real number symbol (UTF-8: ℝ) in XeTeX


8

In this code I define a \parunderbrace command, with two arguments, which adjusts automatically to the width of the formula: \documentclass{article} \usepackage{mathtools} \usepackage{ragged2e} \newlength\ubwidth \newcommand\parunderbrace[2]{\settowidth\ubwidth{$#1$}\underbrace{#1}_{\parbox{\ubwidth}{\scriptsize\RaggedRight#2}}} \begin{document} \[ ...


12

If you want to change the behaviour of \underbrace globally you could say \documentclass{article} \usepackage{amsmath} \makeatletter \let\ams@underbrace=\underbrace \def\underbrace#1_#2{% \setbox0=\hbox{$\displaystyle#1$}% \ams@underbrace{#1}_{\parbox[t]{\the\wd0}{#2}}% } \makeatother \begin{document} $\underbrace{f(x) = a^2 + 2ab + b^2}_{This is some ...


2

I would use align* which allows to use more lines, if necessary. Also I would use all the textual sentence inside a single \text{} and use $ $ for math contents inside it. \begin{align*} A=\bigl\{\alpha\in \mathbb{Z}G :{}& \text{$\alpha$ is a unit in $\mathbb{Z}G$ with $\varepsilon(\alpha)=1$}\\ & \text{and $\alpha+\Delta(G,G')$ has finite ...


1

Method Insert math macro (from the menu or the "\foo:=" button on the toolbar) a. For Name type say "qp" . b. For TeX type exactly "\mathbb Q ^\scalebox{.5 {#1" The result should look like "Q\scalebox{.5}{#1}". This will be output in the LaTeX. c. For Lyx type say "\mathbb Q ^#1 _\circ". The result should look like "Q°#1". This will be displayed in ...


1

Using amsmath package the code: Method 1: \begin{align*} \int \left( \frac{x+3}{2}\right) \, dx =& \int \frac{1}{2}(x+3) \, dx && \text{Factoring out a constant} \\ =& \frac{1}{2} \int (x+3) \, dx && \text{Factoring the constant outside the integral} \\ =& \frac{1}{2}\left[\frac{1}{2}x^2+3x\right]+C && \text{Applying ...


3

Spaces (including a single carriage return) are gobbled under math mode. From the TeX Book, Chapter 18: Fine Points of Mathematics Typing (p 166): [consider] $$ F_n = F_{n-1} + F_{n-2}, \qquad n \ge 2. $$ It is perhaps worth reiterating that TeX ignores all the spaces in math mode (except, of course, the space after \qquad, which is needed ...


2

I believe that what you want is to transform the numerator into a text style (no italic and no subscript). This should do the trick: \documentclass{article} \begin{document} \begin{equation} \frac{\mathrm{fa\_das\_tat\_C}}{1+0.2 } \end{equation} \end{document}


1

Thanks to Christian Hupfer I found this new list: http://tug.ctan.org/info/symbols/comprehensive/symbols-letter.pdf And found the solution I wanted \ding{55} from table 251


1

The deleted answer of A. Allet was in the right direction, but the xlop package not only can make automatically the multiplication. It can also show the shifted positions, as well as include comments with \oplput and \oprput: \documentclass{article} \usepackage{xlop} \begin{document} \opmul[displayshiftintermediary=all]{123}{456} \oplput(1,3){(this is ...


3

Since the material should be in math mode, I suggest using an array environment instead of a tabular environment. If nothing else, it saves you from having to enter lots of $ characters by hand. Observe that the array has only two explicit columns. The middle column, with all the = symbols, is generated automatically and needn't be typed by you. The ...


6

A picture is worth a thousand words: I have attached a picture alongside its generating code for comparison. You can click on the image for a bigger view (nice feature new to TeX.SX). Paying a close look, you observe a perfect alignment between first and fourth expressions where both come from mathmode. The second nearest is the third, then comes the ...


0

you can use the xlop package http://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/ctan/macros/generic/xlop/doc/xlop-doc.pdf page 15-16


2

Some arrays and the tikzmark library: The code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{tikzmark,shapes.geometric,fit} \newcommand\AddSpa[2][6pt]{\hspace{#1}#2\hspace{#1}} \begin{document} \[ \begin{array}{@{}c@{}} \begin{array}[t]{c|l} 2 & 12 \\ \hline 2 & 6 \\ \hline 3 & 3 \\ \hline & 1 \end{array}\qquad ...


6

This can be done using an array: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \renewcommand\arraystretch{1.2} \begin{array}{c@{}c@{\,}c@{\,}c@{\,}c@{\,}ccl} & \makebox[0pt]{\raisebox{-.5\normalbaselineskip}[0pt][0pt]{$\times$}} & & 1 & 2 & 3 \\ & & & 4 & 5 & 6 \\ \cline{3-6} & & & 7 ...


1

Do you mean something like this? \documentclass[10pt]{article} \usepackage{verbatim, amsmath,stackengine} \stackMath \usepackage{ytableau} \usepackage[enableskew]{youngtab} \usepackage[none]{hyphenat} \begin{document} \section{Cherednik Diagrams n=2,3}\label{MyFirstSection} \[ \stackunder[5pt]{\young(:::\hfill,\hfill)}{% ...


2

One possibility using ytableau and the tikzmark library for TikZ (I couln't make this approach work with youngtab): The code: \documentclass[10pt]{article} \usepackage{verbatim, amsmath} % adds environment for commenting out blocks of text & for better verbatim \usepackage{ytableau} \usepackage[enableskew]{youngtab} \usepackage[none]{hyphenat} ...


3

Better use siunitx and its \num macro, apply the relevant options instead of directly type in the number. \documentclass{beamer} \usepackage{polyglossia} \setdefaultlanguage{french} \usepackage[copy-decimal-marker=true]{siunitx} \begin{document} \num{5,3} \end{document} This works for xelatex and lualatex with no (apparent) difference.


4

As Leucippus implies, subscripts (_{}), superscripts (^{}), \frac, \sqrt, \ln, \vert are commands that can only be used in math mode, so you need to enclose them in dollar signs or \( ... \). As such he has answered your question, this answer is just a suggestion for an alternative way of typesetting that table. Changes: I've added the array package, and ...


4

Using the amsmath package for formulas and enclosing them properly, ie $formula$, will remove the error. \documentclass[12pt]{article} \usepackage{amsmath} \begin{latin} \begin{table}[h!] \centering \begin{tabular}{|c c c|} \hline p & q & $\varphi_q^p(x)$ \\ [0.5ex] \hline p & -1 & ‎$\vert‎ x \vert^p$ \\ 2 & 0 & $\ln(x^2+1)$ ...


5

Here is a slightly different solution, with the alignat environment, and the \mathrlap command from mathtools, an extension of amsmath. I also suggest another layout, using alignat and aligned: \documentclass{article} \usepackage{mathtools,amssymb} \usepackage{lipsum} \usepackage{eqparbox} \def\cdotsfill{\leavevmode \leaders\hbox{$\cdots$}\hfill \kern0pt} ...


2

Perhaps you mean like this? (I used an subsidiary aligned for the inner alignment) The code: \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{multline} A = \lim _{n\rightarrow \infty }\Delta x\left( a^{2}+\left( a^{2}+2a\Delta x +\left( \Delta x\right) ^{2}\right)\right.\\ \begin{aligned} ...


3

Some improvement of the solution proposed bu @Kiraa. \documentclass{article} \usepackage{graphicx} \begin{document} $\forall x \lower .5em \hbox{% \rotatebox[origin=lB]{-30}{$\supseteq A$}% }% \llap{% \lower -.5em \hbox{% \rotatebox[origin=lb]{30}{$\subseteq B$}% }% }% \exists y \in C$ \end{document}


3

\documentclass{article} \usepackage{graphicx} \begin{document} $\forall x_{\rotatebox[origin=c]{-20}{$\ \subseteq B$}}\hspace{-2.5em}^{\rotatebox[origin=c]{20}{$\ \supseteq A$}}\ lalala$ \end{document} This produces result If you don't like the manual space adjusments, look into overlaping. Edited: code that yeilds better result.


0

You could add a suitable amount of math kerning -- 2.5mu seems about right -- in order to center the "accent" below the associated letter. \documentclass{article} \usepackage{mathtools,accents} \renewcommand{\vec}[1]{\mathbf{#1}} \newcommand{\undernum}[2]{% \underaccent{\mkern2.5mu\mathclap{#2}}{#1}} \newcommand{\mvec}[2][n]{\undernum{\vec{#2}}{#1}} ...


4

I find this a very bad idea, but the customer's always right. \documentclass{article} \usepackage{pict2e} \DeclareRobustCommand{\fauxleq}{\mathrel{\mathpalette\dofauxleq\relax}} \newcommand{\dofauxleq}[2]{% \sbox0{$\mathsurround=0pt #1\leq$}% \setlength{\unitlength}{\wd0}% \begin{picture}(1,0.7) \roundcap\roundjoin ...


2

What ever you do: Define a command first which you may redefine later on. The $3.5x$-version is wrong for sure. Here are three versions, I personally think acceptable: % arara: pdflatex \documentclass{article} \usepackage{siunitx} %\newcommand*{\factor}[1]{$\num{#1}\mathrel\times$} %\newcommand*{\factor}[1]{$\num{#1}\times$} ...


1

There's no need for \mathchoice here, just of some arithmetic; however, I'd emphasize that the correct syntax for \mod and \mathfrak is a\equiv b \mod{\mathfrak{p}} It's true that with the standard definition \mod \mathfrak p seems to work, but it's just that: it seems to work. TeX provides \nonscript to specify math glue or kern that's not added in ...


9

If you insist on not changing the body of your source, you could make * math-active \documentclass{article} \mathcode`\*="8000 % {\catcode`\*=\active\gdef*{\cdot}} \begin{document} Here we have some asterisks: * * * * * Now we some some mathematics: $a*b*c$. \end{document}


26

\cdot is defined by \DeclareMathSymbol{\cdot}{\mathbin}{symbols}{"01} So you just need to put this in your preamble \DeclareMathSymbol{*}{\mathbin}{symbols}{"01}


2

To mimic the amsmath definition you should move the argument outside the \mathchoice. You can move the 6mu spacing and the typing of the word mod too this is the same in all cases. As @egreg points out, the \allowbreak should be moved out of the \mathchoice; inside it has no effect. \documentclass{article} \usepackage{amsmath,amssymb} \makeatletter ...


1

Just to slightly correct Thomas Weise's answer - if you compile a straightforward LaTeX document without loading any extra packages, then the fonts used will be Computer Modern (not AMS fonts). The Computer Modern fonts are not TrueType fonts, and they're distributed through the "Knuth license". TrueType versions exist as part of Bakoma, but they have a ...


0

I think the font LaTeX uses depends on the documentclass and other settings, but by default, it should be using the Computer Modern family of fonts. These can be downloaded from http://www.ctan.org/tex-archive/fonts/amsfonts/. I think cmsy-name like fonts contain math symbols, cmbsy-name like fonts contain bold math symbols, cmex-name like fonts even more ...


3

Besides the solutions above, I have recently come across the isomath package and found that page 6 of its manual provides a fairly good summary for available ways to get upright small greek letters. (One of) the link to the manual itself is: http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/isomath/isomath.pdf And I take the liberty of taking ...


4

Each ampersand & provides a right-and-left alignment around it. Here's what you're looking for in your align construction: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} a &= 144 & & & b &= 51666 \\ & & c &= d \end{align*} \end{document}


2

Just change gather into align: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} \begin{split} a &=b \\ &=c \end{split} \\ \begin{split} k &=l+55 \\ &=d+401 \end{split} \end{align} \end{document} If you pass the tbtags option to amsmath, you get the equation numbers aligned with the bottom line ...



Top 50 recent answers are included