Tag Info

New answers tagged

5

Wouldn't it be the easiest way to use an align or alignat here? I replaced the \ldots by \dots in between the binary operators as they are looking wrong. % arara: pdflatex \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{mathtools} \usepackage{amssymb} \renewcommand\theequation{\arabic{section}.\arabic{equation}} ...


5

EDIT I decided that I didn't really like my first solution (see below) because it requires all of this "extra clutter" in order for it to work. So, I have written a custom enumitem environment equationate (=equation+enumerate) that does the same thing except that it hides the clutter inside the environment. The output is given above, which is exactly the ...


3

The unicodes are U+2ABB and U+2ABC. Here are some examples with the fonts I am having available (in order of increasing uglyness): % arara: lualatex \documentclass{article} \usepackage{unicode-math} \newcommand*{\test}{\ensuremath{\prec\Prec\Succ\succ}} \begin{document} \setmathfont{code2000.ttf}\test \setmathfont{xits-math}\test ...


2

Here's a homemade construction. \documentclass{article} \usepackage{graphicx} \def\pprec{\mathrel{\scalebox{.9}[1]{$\prec$}\mkern-5mu% \scalebox{.4}[1]{$\prec$}\mkern-5.5mu\scalebox{.4}[1]{$\prec$}}} \begin{document} $a \pprec b$ \end{document}


9

The mathb font (from mathabx) has \llcurly and a \ggcurly symbols. Here is how to use them without loading the whole package: \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \DeclareFontFamily{U}{mathb}{\hyphenchar\font45} \DeclareFontShape{U}{mathb}{m}{n}{ <-6> mathab <6-7> mathb6 <7-8> mathb7 <8-9> mathb8 <9-10> ...


3

The Unicode symbol for a sailboat is U+26F5, so \char"26F5 should work in LuaLaTeX or XeLaTeX. If you have an emoji font that contains this glyph, you might want to make an alias for that font with \newfontface from fontspec. MWE (if you have Symbola): \documentclass{article} \usepackage{fontspec} \newfontface\emojifont{Symbola} % Or another font ...


10

Just found a dugout: % arara: lualatex \documentclass{article} \usepackage{fontawesome} \usepackage{graphicx} \begin{document} \rotatebox[origin=c]{45}{\faPhone} \end{document} % arara: lualatex \documentclass{article} \usepackage{fontawesome} \usepackage{graphicx} \begin{document} \[ \begin{array}{c} \rotatebox[origin=c]{45}{\faPhone}\\[-14.5pt] ...


13

Can we cheat? \documentclass{article} \usepackage{tikz} \newcommand*{\myboat}{% \protect\raisebox{-0.0000165em}{% \protect\begin{tikzpicture}[x=0.08em, y=0.08em, xscale=0.25, yscale=-0.25, inner sep=0pt, outer sep=0pt] \protect\path[fill=cyan!40] (99.9880,49.1240) .. controls (97.9470,49.1240) and (95.9760,48.6600) .. ...


1

It is working in LaTeX, http://www.ctan.org/pkg/lcd . For 10, \DefineLCDchar{10}{00000000000000010111101011010110111} For small caps shape {E}, \DefineLCDchar{12}{00000000000111101000011100100001111} It may be necessary, http://latexcolor.com/ Thanks a lot, Mike Kaufmann.


1

You can raise them with the help of an invisible rule: \documentclass{beamer} \usepackage{amsmath} \begin{document} \begin{frame} \[\skew{4} \hat{\textrm{\emph{\rule{0ex}{1.7ex}I}}}\] \[\skew{4} \hat{\textrm{\emph{\rule{0ex}{2ex}I}}}\] \end{frame} \end{document} To lower them, you need to \smash the variable I and adjust the height of the ...


3

\documentclass{beamer} \usepackage[T1]{fontenc} \usefonttheme[onlymath]{serif} \renewcommand\sfdefault{cmbr} \begin{document} \begin{frame} Some text, $x^2 + y^2 = r^2$ \end{frame} \end{document}


1

To define a hyphen for use as part of a hyphenated name in a macro, I used the command \def\mymathhyphen{{\hbox{-}}}. This gives the usual en-dash.


1

\usepackage{amsmath} \usepackage{amssymb} ... $r\sim[0,1]$ or $r\thicksim[0,1]$


8

The mathtools package already has the necessary tool to do that (don't load amsmath: mathtools already does it): \documentclass[12pt]{article} \usepackage{mathtools} \newcommand\logeq{\mathrel{\vcentcolon\Leftrightarrow}} \begin{document} \[ A \logeq A \] \end{document}


11

Package colonequals provides a vertically centered colon: \ratio. Both \ratio and \Leftrightarrow are of kind \mathrel, therefore TeX will not put additional space between them: \documentclass{article} \usepackage{colonequals} \newcommand*{\logeq}{\ratio\Leftrightarrow} \begin{document} \[ A \logeq B \] \end{document} P.S. It does not matter ...


3

Maybe this? \documentclass[12pt]{article} \usepackage{amsmath} \newcommand\logeq{\mathrel{\raisebox{.66pt}{:}}\Leftrightarrow} \begin{document} \[ A \logeq A \] \end{document}


0

You can use flalign* environment for getting the desired result Code: \documentclass[11pt,a4paper,oneside]{report} \usepackage[T1]{fontenc} \usepackage{fouriernc} \usepackage{mathtools} \usepackage{amsthm} \usepackage{amsfonts} \usepackage{amssymb} \begin{document} \begin{flalign*} N &=\frac{\theta _{1}-\theta _{2}}{f}\left( \left( \theta ...


4

Another solution using low level functions: \documentclass{article} \usepackage{amsmath,siunitx,xparse} \NewDocumentCommand{\mySI}{O{}mom}{% \IfNoValueTF{#3} {\SI[#1]{#2}{#4}} {\SI[parse-numbers=false,#1]{\num[parse-numbers=true]{#2}\douncert{#3}}{#4}}% } \NewDocumentCommand{\douncert}{m}{% ^{% \vbox{ \def\myrow##1{\num{##1}} ...


2

If you want something that produces the same vertical spacing as the O.P.'s example, you can try the stackengine package: \documentclass[12pt,preview,border=3mm]{standalone} \usepackage{amsmath} \usepackage{stackengine} \setstackEOL{\\} \begin{document} \[\text{shaft} = ...


6

Sometimes the low-level commands are just nicer in my opinion: \documentclass{article} \begin{document} \[ \mathrm{shaft = 20^{+0.080\atop +0.005} mm} \] \end{document} If you use amsmath, it will nag but does compile. However, it has been said it's better to use the higher-level macros with LaTeX, and so borrowing from Gonzalo's answer from a previous ...


3

I agree with tohecz that you may need to do some basic reading regarding how to work with LaTeX. I hope this is what you want: \documentclass{article} \usepackage{mathtools} \begin{document} \begin{equation} A=\begin{bmatrix} X_{t_{k}} & Y_{t_{k}} & \dot{X}_{t_{k}} & \dot{Y}_{t_{k}} \end{bmatrix}^{T} ...


5

Without any package: \documentclass{article} \begin{document} $\mathrm{shaft}=20^{\begin{array}{@{}c@{}} \scriptscriptstyle +0.080\\[-7pt] \scriptscriptstyle +0.005 \end{array}}\mathrm{mm}$ \end{document}


4

Try \documentclass[12pt,preview,border=3mm]{standalone} \usepackage{amsmath} %---------------------------------------------------------------% \begin{document} \[\text{shaft} = 20^{\substack{+0.080\\+0.005}}\,\text{mm}\] \end{document} But this is not standard notation for tolerance. For it see siunitx package. Edit: As mentioned Mico, ...


3

The problem is not only in using \sum in subscripts, as the following example shows. The version without exscale has a clearly wrong output. Without exscale \documentclass{article} \usepackage{lmodern} \textheight=2cm % just for the example \begin{document} Some text\footnote{Because $\sum_{k=1}^{n}=n(n+1)/2$.} \end{document} With exscale ...


2

\bm{x_y} with bm package would work


1

mathspec is basically a collection of hacks; using a real Unicode Math font is better, if your document deals with mathematics. However, here's a way to get bold digits: \documentclass{article} \usepackage{amsmath,bm} \usepackage{mathspec} \setmathsfont(Digits,Latin,Greek){FreeSerif} \setmathrm{FreeSerif} \setmainfont{FreeSerif} \makeatletter ...


1

You can make TeX decide for the line breaks: \documentclass{article} \usepackage{amsmath} \usepackage{lipsum} % just for the example \newcommand{\lrand}{\mathrel{\land}} % a relation, while \wedge=\land is an operation \newenvironment{mrule} {\relpenalty=0 \flushleft$\displaystyle} {$\endflushleft} \newenvironment{mruleA} {\relpenalty=0 \quote ...


3

This look, maybe? \documentclass{article} \begin{document} $\scriptstyle \begin{array}{l@{\quad}r} XXXXXXX(XXXX(A,B,C),XXXX(D,E,F)) &\leftarrow \\ XXXXXX(A,B,C) \quad \wedge \quad XXXXXX(D,E,F) &\wedge\\ XXXXX(XX(A,B),XX(D,E)) & \wedge \\ XXXXX(XX(B,C),XX(E,F)) & \wedge \\ XXXXXX(XXX(A,B,C),XXX(D,E,F)).\\ \end{array}$ \end{document} If ...


1

For R users, an easy option is a file.Rnw file like that: <<echo=F>>= a <- 100 rounddown <- function(x){format(floor(x/a)*a, big.mark = ",")} @ \documentclass{article} \begin{document} Rounded down 2,326 is \Sexpr{rounddown(2326)}. \end{document} That with R CMD Sweave file.Rnw is converted to a true file.tex like that: ...


4

As far as I know (unless there are several Heaviside functions) the most common notation is simply H, others include u (unit step function) or θ (\theta). Never seen Θ (\Theta). For partial derivatives, I would recommend the esdiff package, which has handy macros for typesetting partial derivatives of any order. Here is an example with the esdiff package: ...


9

Here's a LuaLaTeX-based solution to the problem of truncating a number to the closest multiple of 100. Positive and negative numbers are both truncated toward zero. The \ensuremath macro, provided by the amsmath package, is used to make it unnecessary to keep track of whether the \mytrunc macro is used inside or outside of one of TeX's math mode ...


1

I should have read the survey link I provided more carefully. The author was so nice to not only provide the comparison as pdf, but also as tex for each font combination. He explains how to combine the math font of Arev with text font of Heros, which is a Helvetica clone. So with a slight change from tgheros to helvet, my working example becomes: ...


3

You need to add the directive \displaystyle at the start of both the numerator and denominator. I would also add \, (thinspace) between the two main terms in the numerator. \documentclass{report} \usepackage{amsmath, amsfonts, amssymb} \begin{document} \[ \frac{\displaystyle\sum_{\begin{subarray}{l}\forall x \\ ...


2

Just reset \rmdefault to the definition it had before mathpazo was loaded. \documentclass{article} \let\temp\rmdefault \usepackage{mathpazo} \let\rmdefault\temp \begin{document} The quick brown fox jumps over the lazy dog. \[ \int_a^b f(x) dx \] \end{document}


13

Use siunitx and expl3. \documentclass{article} \usepackage{xparse,siunitx} \ExplSyntaxOn \NewDocumentCommand{\hundreds}{O{}m} { \num[#1]{\fp_eval:n { trunc(#2,-2) }} } \ExplSyntaxOff \begin{document} \hundreds{2348} \hundreds[group-four-digits,group-separator={,}]{2348} \sisetup{group-four-digits,group-separator={,}} \hundreds{2348} ...


4

Just for fun with fp. Rounding \documentclass[preview,border=12pt,12pt,varwidth]{standalone} \usepackage[nomessages]{fp} \usepackage{pgffor} \newcommand\rounder[2]{\FPeval\x{round(round(#1*pow(-#2,10):0)*pow(#2,10):0)}\x} \begin{document} \begin{itemize} \foreach \i in {2440,2441,..., 2460}{\item \i\ is rounded to \rounder{\i}{2}.} \end{itemize} ...


4

\documentclass{article} \makeatletter \def\twodec#1{\expandafter\twodecB#1,,,\@nil} \def\twodecB#1,#2#3#4\@nil{\ifx,#2 #1,000\else#1,#200\fi} \makeatother \begin{document} \twodec{2}\par \twodec{2,3}\par \twodec{2,38}\par \twodec{2,386} \end{document}


5

Divide it by 100 then multiply the result by 100. \documentclass{article} \newcount\mycount \mycount = 2386 \divide\mycount by 100 \multiply\mycount by 100 \begin{document} \number\mycount \end{document}


2

The manual of sansmath states the following: The actual sans fonts are OT1 encodings of those indicated by the meaning of \sfdefault WHEN THE PACKAGE WAS LOADED, not the meaning at each maths environment! We can exploit this fact by first loading the desired math font, then sansmath, and finally helvet for the text font. This is straightforward ...


2

Here is one solution to this question: Essentially I added \vcenter{\hbox{\rule{0pt}{16pt}}} at the end of the command definitions. The disadvantige of this solution is its dependence on the font size. For example, if one uses \Huge to enlarge the font size, the height of \rule needs to be adjusted to 40pt. The whole code of this solution is: ...


2

The following answer is not a solution, but an easy trick suitable for some purposes (and not for all purposes). The \overbracket{} command in package mathtools has two arguments (rule thickness and bracket height): \overbracket[〈rule thickness〉] [〈bracket height〉]{〈arg〉} Suppose you set a rule thickness smaller than x pt. If you set the bracket height at ...


4

Here's a way with a new math symbol font: \documentclass{article} \usepackage[LGR,T1]{fontenc} \usepackage{bm} \DeclareSymbolFont{upgreek}{LGR}{cmr}{m}{n} \SetSymbolFont{upgreek}{bold}{LGR}{cmr}{bx}{n} \DeclareMathSymbol{\upalpha}{\mathord}{upgreek}{`a} \DeclareMathSymbol{\upbeta}{\mathord}{upgreek}{`b} \DeclareMathSymbol{\upgamma}{\mathord}{upgreek}{`g} ...


4

You can try Hendrik Vogt's solution (thanks, Hendrik!), which I have adopted in the form of a small .sty file, widebar.sty: %%%%%%%%%%%%%%%%%%%%%%%% % IDENTIFICATION \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{widebar} %%%%%%%%%%%%%%%%%%%%%%%% %%% Defines a \widebar command, similar to\widehat. %%% May have problems with indices %%% Comes from Hendrik ...


2

\documentclass{article} \usepackage{amsmath} \makeatletter \newsavebox\myboxA \newsavebox\myboxB \newlength\mylenA \newcommand*\xoverline[2][0.75]{% \sbox{\myboxA}{$\m@th#2$}% \setbox\myboxB\null% Phantom box \ht\myboxB=\ht\myboxA% \dp\myboxB=\dp\myboxA% \wd\myboxB=#1\wd\myboxA% Scale phantom ...


1

For anyone else who might be struggling with a similar problem, I managed to plumb some other font files and discovered the problem. It appears that I had everything right, except that in the ligtables for the OMX font I did not instruct Metafont to associate the appropriate symbols together. So the relevant ligtable entries now look like this: charlist ...


2

In short, the explanation is that in several contexts: \def\foo{\ifmmode alpha\else beta\fi} ...$\foo ...$ ... it won't yet be visible that we're in math mode when \foo is invoked. But after \relax, then \ifmmode will then be able to see that we are in math mode. Knowing the explanation, I was then able to find these further discussions of it on this ...


6

There seem to be few advantages in doing this. Unless you take more precautions the \ifmmode will take the wrong choice at the start of any array or alignment cell, that could be fixed using a suitable \protected\def or \DeclareRobustCommand or simply starting the definition with \relax but even then there are few if any cases where the text character ...


11

You are already using amssymb I hope. Why not look in to the amsmath manual (texdoc amsldoc from command prompt/line). It provides many environments for typing mathematics. For these two equations, you can use gather* (no number). \documentclass[11pt,openany]{book} \usepackage{amsmath,amssymb,showframe} %% showframe for demo only \begin{document} ...


3

How much contrast exists between the bold and medium font is an aspect of the font design. You haven't given an example document. the default Computer modern has reasonable contrast between the bold and medium weight (which is easy as the medium weight cm is very light) \documentclass{article} \usepackage{amsmath} \begin{document} ...


4

\documentclass{article} \usepackage{amssymb} \begin{document} The package \verb|amssymb| provides following: \verb|\lesssim| $\rightarrow \quad \lesssim$ \verb|\gtrsim| $\rightarrow \quad \gtrsim$ \verb|\lessapprox| $\rightarrow \quad \lessapprox$ \verb|\gtrapprox| $\rightarrow \quad \gtrapprox$ \end{document}



Top 50 recent answers are included