Tag Info

New answers tagged

0

As already mentioned, there are two packages to solve this problem: xfrac - typeset fractions in the form n/d generally faktor - especially to typeset factor structures Here is a comparison between the \sfrac{n}{d} and \faktor{n}{d} commands which also demonstrates how they behave in comparison to normal text: \documentclass[12pt,preview, ...


2

The \pdfstrcmp primitive performs expansion: the linked answer does mention that the argument needs to be a 'string'. For comparing arbitrary input, prevent expansion using \unexpanded: \documentclass{article} \usepackage[utf8]{inputenc} \setlength\parindent{0pt} \usepackage{siunitx,microtype,textcomp,textgreek} \newcommand{\evaltest}[2]{% ...


1

Does it have to be pdfstrcmp? If not, you should look into etoolbox. E.g.: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \setlength\parindent{0pt} \usepackage{etoolbox} \usepackage{siunitx,microtype,textcomp,textgreek} \newcommand{\evaltest}[2]{% \ifnum\pdfstrcmp{#1}{#2}=0 #1 equals #2% \else #1 does ...


2

You are mixing math and text modes. You need to bracket the mathematics correctly. \documentclass{article} \begin{document} In-line math 1.The sequence \(\{a_n\}\) converges to \(a\) if for all \(\epsilon > 0\) Display math 1.The sequence \[\{a_n\}\] converges to \[a\] if for all \[\epsilon > 0\] \end{document} You use \( and \) to bracket ...


2

I wouldn't use \limits in this case since it'll end up placing the lower and upper limits of the sequence below and above the right-hand curly brace -- probably not what you intended. If you write \{h_{n}\}_{0}^{\infty}$ (see the middle example below, labelled "not awful"), the upper and lower limits may look like they're too close to each other, especially ...


1

You shouldn't be using \intertext to start the display. And you're better using \shortintertext in the second case, in order to reduce the vertical spacing. \documentclass[12pt,a4paper,twoside]{scrbook} \usepackage{amsmath} \usepackage{mathtools} \usepackage{amssymb} \usepackage{lipsum} \begin{document} \lipsum[1-3] \newpage \lipsum[1-3] \newpage ...


1

Here is another approach which doesn't allocate the new name \etaorig: \edef\eta{\noexpand\ensuremath{\mathchar\the\eta\space}}


2

I suggest the macro \sgchart which generates desired table. The usage is: \sgchart {list of points} {formula: signs, formula: signs, formula: signs etc} for example \sgchart {-4, ~5} {x-5: --+, x+4: -++, (x+4)/(x-5): +-+} If the point value isn't preceded by ~ then it is printed with solid bullet (default) and if the ~ precedes then circle is printed. ...


4

Regardless whether it's useful or not, as a shortcut without $...$ it's possible to redefine \eta, but it's necessary to store the meaning of \eta before (making a copy) using \let. My statements are of general nature, I do not really recommend to use \eta in this way. \documentclass{article} \newcommand{\pt}{\ensuremath{p_T}} \let\etaorig\eta% ...


4

Not a serious answer but just for your information, there is physics package providing this and many other goodies. For details, refer to its documentation. \documentclass[12pt,letterpaper]{article} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{physics} \begin{document} \[\pdv{V}{c_{i}} \quad \pderivative{x} \quad \pdv{x} ...


5

Use an extra pair of braces for the argument with scripts: $\diffp{V}{{c_{i}}}$ A complete example: \documentclass[12pt,letterpaper]{article} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{amsmath} \usepackage{esdiff} \begin{document} $\diffp{V}{{c_{i}}}$ \end{document} The extra pair of braces forms a group thus c_{i} is seen as ...


2

Here's one possibility using tcolorbox. A new hypotheses environment is defined (internally is just a list); inside this environment you use the \Hypo command for each hypothesis; the syntax is \Hypo[<label>]{<text>} The code: \documentclass{article} \usepackage[many]{tcolorbox} \usepackage{enumitem} \usepackage{amsmath,amssymb} ...


9

An empty line in TeX should never be used just to arrange the source. It is an instruction exactly the same as the command \par which ends a paragraph and starts TeX's line breaking algorithm to split a paragraph into lines. So it is not allowed in display math and it should never be used on the line before display math either, in that position it does not ...


1

longtable breaks naturally at the end of the page, as shown here where I have doubled the length of the table, and reduced the length of the page, so it goes on to page 2. \documentclass[a4paper, 10pt]{scrartcl} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[italian]{babel} ...


2

Plain TeX (requires e-TeX, though): \def\crulefill{\leaders\hrule height \dimexpr\fontdimen22\textfont2+0.2pt\relax depth -\dimexpr\fontdimen22\textfont2-0.2pt\relax \hfill } \def\hollow{$\kern-.8pt\circ\kern-.8pt$} \def\filled{$\kern-.8pt\bullet\kern-.8pt$} $$ \vbox{\offinterlineskip\tabskip=0pt \halign{% \strut$#$\hfil\quad& ...


3

Is this enough? \documentclass[12pt]{article} \usepackage[english]{babel} \begin{document} \begin{verbatim} x-5 - | - | + x+4 - | + | + ------------0-------@---------- + -4 - 5 + \end{verbatim} \end{document} If not you could use the (mathematical) array environment.


4

Macro \vv breaks in a \typeout message, because \vv is not robust. \protect helps: \documentclass{article} \usepackage{esvect} \usepackage[outline]{contour} \begin{document} \contour{red}{$\protect\vv{aa}$} \end{document}


1

In this case the tilde should probably be set in such a way that the = sign is not moved with respect to its normal position. \documentclass{article} \usepackage{amsmath} \makeatletter \newcommand{\@ndereq}[2]{% \vtop{ \lineskiplimit\maxdimen \lineskip-.5\p@ \ialign{$\m@th#1\hfil##\hfil$\crcr=\crcr#2\crcr}% }% } ...


2

% arara: pdflatex \documentclass{article} \usepackage{mathtools} \usepackage{tikz-cd} \begin{document} \begin{tikzcd}%[column sep='what-ever-unit'] \arrow[Rightarrow]{r}{r} & \null \end{tikzcd} $\overset{r}{\Longrightarrow}$ $\xRightarrow{r}$ \end{document}


3

You could \unslant the \mu, using Bruno's \slantbox described at Shear transform a "box". I also set the number range as 7--8 in text mode, since the math version of your MWE was typeset as seven minus eight. \documentclass[a4paper]{article} \def\slantvalue{0} \newsavebox{\foobox} \newcommand{\slantbox}[2][\slantvalue]{\mbox{% ...


3

If you can load the siunitx package, \SIrange{} might solve your problem. You can adjust the appearance with \sisetup{}, and the option detect-all will match the appearance to that of the surroundings. \documentclass[a4paper]{article} \usepackage{siunitx} \sisetup{range-phrase=--,range-units=single,detect-all} \title{\bfseries From ...


4

Like this? \documentclass[tikz]{standalone} \usepackage[outline]{contour} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[fill=black]{\textcolor{red}{\contour{white}{This is some text}}}; \node[text = white]at (0,-0.5){\contour{red}{This is some text}}; \end{tikzpicture} \end{document}


1

Inside the algorithmic environment you're in regular text-style when entering math mode. And operators in text-style have their limits displayed in that way rather than underneath/over top. You have to force an explicit \displaystyle to have it set in the same way: \documentclass{article} \usepackage{algorithm,algpseudocode,amsmath} ...


3

Mico has already given some nice ideas which provide a beautiful result. However, I am posting my idea from comment as well, as it is quite short and might serve you here: % arara: pdflatex \documentclass{article} \usepackage{mathtools} \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \begin{document} \[\biggl(\int\limits_{\mathrlap{\abs{x}>R}} ...


5

Since it looks like you're using the mathtools package (good move!), I suggest you do the following: use the \smashoperator[r]{...} directive (provided by the mathtools package) to eliminate the whitespace between the integral symbol and the integrand; define a new macro called \abs using \DeclarePairedDelimiter; define the macro \parens using ...


1

A MetaPost way of doing this: prologues := 3; outputtemplate := "%j-%c.mps"; input latexmp; setupLaTeXMP(options = "12pt", textextlabel = enable, mode = rerun); % t[] values on top, b[] values on bottom % u spacing between columns, v arrows length vardef corresp(suffix t, b)(expr u, v) = save i; numeric i; i = 1; forever: exitif (unknown ...


5

Just tell the package to use \boldmath as well as \textbf: \documentclass{article} \usepackage{hyperref} \usepackage[printonlyused]{acronym} \renewcommand*{\aclabelfont}[1]{\textbf{\boldmath\acsfont{#1}}} \begin{document} Hello, here are the acronyms: \ac{MA} and \ac{$M^{2}_c$} \begin{acronym} \acro{$M^{2}_c$}{My Math Customized Acronym} ...


5

It's better not to use a math formula in the first argument of \acro, but you can have it in the optional argument, as in \acro{M2C}[$\bm{M^{2}_c}$]{My Math Customized Acronym} which uses the \bm command from the same package to have bold math. MWE: \documentclass{article} \usepackage{bm} \usepackage{hyperref} \usepackage[printonlyused]{acronym} ...


0

One more solution with tikz-cd: % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd}[column sep=1.7em, every arrow/.append style={<->}] 1\arrow{d} & 2\arrow{d} & 3\arrow{d} \\ 0 & 1 & 2 \end{tikzcd} \end{document}


3

Latin Modern math doesn't blend with Times New Roman. You're better using NewTX: \documentclass{article} \usepackage{newtxtext,newtxmath} \begin{document} The text is in Times; $\lambda\lambdaup$. \end{document} If you insist in using Latin Modern math symbols, here's how you can do: \documentclass{article} \usepackage{amsmath} \usepackage{lmodern} ...


1

If you are able to use Lua- or XeLaTeX, I would recommend the package unicode-math: % arara: lualatex \documentclass{article} \usepackage{unicode-math} \usepackage{fontspec} \setmainfont{Times New Roman} \usepackage{blindtext} \begin{document} \blindtext $\mathup{\lambda}\lambda$ \end{document}


2

A PSTricks solution: \documentclass{article} \usepackage{multido,pstricks} \def\Map(#1)#2#3{% \psline{<->}(#1,0)(#1,1) \rput(#1,-0.3){#2} \rput(#1,1.3){#3}} % parameter \def\arrows{3} \begin{document} \begin{pspicture}(0.95,-0.4)(\arrows.05,1.4) \multido{\iA = 0+1, \iB = 1+1}{\arrows}{\Map(\iB){$\iA$}{$\iB$}} \end{pspicture} ...


1

Please, consult a good basic LaTeX guide, such as Nicola Talbot's “LaTeX for Complete Novices” In line math formulas should be enclosed between \( and \) (or between a pair of $ characters). Also a single symbol can be a math formula, if it denotes a mathematical object. So your example should be \begin{block}{Definición} Un ADF o autómata determinista ...


9

The four hexadecimal digits "kfab in a \mathchar specify k is the atom type (0 = ordinary, 1 = operator, 2 = binary operation, 3 = relation, 4 = opening, 5 = closing, 6 = punctuation, 7 = variable family); f the math group (font family) where the glyph should be taken from; ab the slot in the font. One can use \mathchar<15 bit number> directly or ...


5

Depending on your intended use, a TABstack may offer certain advantages. \documentclass{article} \usepackage{amsmath,tabstackengine,xcolor} \stackMath \begin{document} While a TABstack can be used in a math environment \[ \tabbedCenterstack[l]{0&1&2\\\updownarrow&\updownarrow&\updownarrow\\2&3&1} \] it can also be used inline: ...


0

As it is unclear to me which symbol you actually mean, here you go: \documentclass{article} \usepackage{amsmath} \begin{document} The generating function $\mathcal{H}(x)$ in \ref{3.15.3} is a rational function whose poles all lie on the unit circle $|x|=1$. In fact, the poles are at various roots of unity. What are multiplicities of poles? The point ...


8

Yet another tikz solution, but here I use a \foreach loop: \documentclass{article} \usepackage{tikz} \newcommand\aestrut{\rule[-0.5ex]{0pt}{2ex}} \begin{document} \begin{tikzpicture}[my node/.style={anchor=base}] \foreach[count=\myi from 0] \mya/\myb in {0/1,1/2,2/3,h/g,e/j,j/k} { \node[my node] (A\myi) at (\myi,1) {\aestrut\mya}; ...


10

This might seem an overkill, but may be a good way of generalization. \documentclass{scrartcl} \usepackage{mathtools,tikz} \usetikzlibrary{matrix} \begin{document} \[ \begin{tikzpicture} \matrix[name=m,matrix of math nodes,column sep=1em,row sep=1em] {0 & 1 & 2 \\ 2 & 3 & 1 \\}; \draw[<->] (m-1-1) -- (m-2-1); ...


13

One option using a matrix; an array could also be used, but with matrix you don't have to specify the number and format of columns: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{matrix} 0 & 1 & 2 \\ \updownarrow & \updownarrow & \updownarrow \\ 2 & 3 & 1 \end{matrix} \] \end{document} As has been ...


6

There is wrong code in italian.ldf: such code is wrong because it relies on the mathcode of the comma being the same as in the standard setting, which is not the case when minionmath is used. Indeed the standard math code for the comma is "613B, which becomes "622C with minionmath. The consequence is that \virgola and \virgoladecimale point to a random ...


2

I had the same initial solution as @Gonzalo Medina, but added a solution using the \medmath command from the nccmath package, that reduces the size of the $n$-tuples by about 30 %: \documentclass{article} \usepackage[overload]{empheq} \usepackage{nccmath} \begin{document} \begin{align*} φ_{σ}\colon E & ―――→ E \\ (x_{1},x_{2},...,x_{n}) & ...


1

You can align at the arrows, but this might look odd since the n-tuple is too wide; another approach is to give up on alignment, be a little wordy and separate the components: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} \varphi_{\sigma}\colon E &\longrightarrow E \\ (x_{1},x_{2},...,x_{n}) &\longmapsto ...


2

$\mathfrak{F}($ and $\mathfrak{G}$


4

I propose a syntax with a *-variant rather than the \not prefix. \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{xparse} \NewDocumentCommand{\newrelation}{mmo}{% % #1 is the command to define % #2 is the relation to be used % #3 (optional) is the alternative \IfNoValueTF{#3} {\NewDocumentCommand{#1}{smm}{% ...


1

Set up work is required, but it can be done. In essence, you have define various macros that perform the desired "A symbol B" for various symbols, and then you must define \negate to know how to negate each of these symbols, in turn. \documentclass{article} \usepackage{stackengine,xcolor,mathtools} \def\eqsym{=} \def\gtsymbol{>} \let\svmid\mid ...


3

\mid causes tex to switch into math mode, and it's still in math mode when it gets to the next \item, hence the unexpected error message. instead of what you have, make the line with \mid an unnumbered math display: \item \textbf{Give a regular expression for the language accepted by the automaton~$A$.} \[ (0 \mid 1)*01)0 \mid 1)* \] \item \textbf{Explain ...


7

Since \mid does not make much sence then you read \Exp{A \mid B} (and cannot be scaled), I suggest hiding the | inside a specially crafted macro giving us a macro that support conditionals including scaling. \documentclass[a4paper]{memoir} % requires 2014 edition of mathtools \usepackage{amsmath,amssymb,mathtools,bm,etoolbox} \providecommand\given{} ...


1

Latex has a \textcircled command for making a fixed size circle around a letter \textcircled{R} and its picture mode has a \circle command for making circles in a range of sizes (or arbitrary size if you use pict2e). You don't mention mathjax but I note you tagged the question mathjax. Mathjax specific questions are off topic, but I'll note that mathjax ...


4

The \Call macro uses \ifthenelse, which has a very handy feature: it allows combining tests with propositional logic connectives (called \AND and \OR) with parentheses for the stating the precedence. Here's the catch! The symbols for these parentheses are \( and \). So the presence of \( and \) in the second argument of \Call (that is used in an ...


1

How about that? I used the aligned and medsize (from nccmath) environments. I also loaded lmodern, which is T1-encoded and has accented letters, for a correct hyphenation. Also, you can typeset accented letters directly (ä instead of {\"a}). \listfiles \documentclass[oneside,12pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} ...



Top 50 recent answers are included