Posts

Showing posts with the label Math Mode

1.5e-10 Style Scientific Notation Looks Ugly In LaTeX Math Mode. How Can I Format It (kerning, Etc) More Nicely?

Image
Answer : It's not ugly, but exactly what's expected. If you type $2x-10$ then you expect that there is some space around the minus sign, because it denotes an operation. When you type $1e-10$ , TeX interprets it in exactly the same way, because it can't read your mind: the two expressions are formally the same, only two symbols are different. If you want that an expression that's normally interpreted as a polynomial should be treated in a different way, then you have to properly mark it. One solution might be $1\mathrm{e}{-10}$ because in this case the braces around -10 tell TeX to enter a subformula and so the minus sign is initial, so not interpreted as a binary operation, but as a unary operator. You could make a definition, such as \newcommand{\expnumber}[2]{{#1}\mathrm{e}{#2}} and input the number as $\expnumber{1}{-10}$ but there's a much better alternative, the package siunitx . \documentclass{article} \usepackage{siunitx} \sisetu...

Blackboard Bold I

Image
Answer : If you're free to use LuaLaTeX and the unicode-math package and its \setmathfont macro, there are quite a few math fonts to choose from that provide a "double-struck" lowercase-i character. Hopefully, one of the following eight choices will appeal to you. :-) \documentclass{article} \usepackage{unicode-math} \setmainfont{Stix Two Text} % choose the text font... % Setting up eight [8!] math fonts \setmathfont{Latin Modern Math}[version=lm] \setmathfont{Cambria Math}[version=cambria] \setmathfont{Asana Math}[version=asana] \setmathfont{Stix Two Math}[version=stix2] \setmathfont{XITS Math}[version=xits] \setmathfont{TeX Gyre Termes Math}[version=termes] \setmathfont{TeX Gyre Pagella Math}[version=pagella] \setmathfont{TeX Gyre DejaVu Math}[version=dejavu] \newcommand\blurb{$\mathbb{123}\quad\mathbb{hij}\quad e^{\phi_i\mathbb{i}}$} \begin{document} \begin{tabular}{ll} Latin Modern & \mathversion{lm} \blurb\\ Cambria & \mathversio...

Braket Notation In LaTeX

Image
Answer : There is the physics package: \documentclass{article} \usepackage{physics} \begin{document} $\bra{\Psi}\ket{\Psi}$ $\expval{A}{\Psi}$ \end{document} It offers many other goodies for typsetting physics things. Details can be found in the manul ( texdoc physics from command prompt/terminal). Use \braket{0|0} : \documentclass{standalone} \usepackage{braket} \begin{document} $\braket{0|0}$ \end{document} A solution using the mathtools package: \documentclass{article} \usepackage{mathtools} \DeclarePairedDelimiter\bra{\langle}{\rvert} \DeclarePairedDelimiter\ket{\lvert}{\rangle} \DeclarePairedDelimiterX\braket[2]{\langle}{\rangle}{#1 \delimsize\vert #2} \begin{document} \begin{align*} \bra{a} &= \bra*{\frac{a}{1}} \\ \ket{a} &= \ket*{\frac{a}{1}} \\ \braket{a}{b} &= \braket*{\frac{a}{1}}{\frac{b}{1}} \end{align*} \end{document} Notice that the starred versions of the macros scale automatically.

A Symbol For The Quotient Of Two Objects

Image
Answer : How about using \left , \right , and \raisebox ? \newcommand{\bigslant}[2]{{\raisebox{.2em}{$#1$}\left/\raisebox{-.2em}{$#2$}\right.}} \begin{equation} \bigslant{\mathcal{O}_{(V',0)}}{\mathcal{O}_{(V,0)}} \end{equation} which gives The only problem is that I need to re-enter mathmode inside the \raisebox es. Anyone know how to avoid that? If you want to invoke the Someone Else's Problem principle, there's also the faktor package, which ostensibly was designed to do what you want, and which implements using the AMS symbol \diagup . But IMHO the slash is a bit small. For in-line expressions, you can also consider the nicefrac package, which makes both the "denominator" and "numerator" small. 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} ...

Closer Slanted Parallel Symbol

Image
Answer : Raise and scale. \documentclass{article} \usepackage{amsmath,graphicx} \makeatletter \newcommand{\newparallel}{\mathrel{\mathpalette\new@parallel\relax}} \newcommand{\new@parallel}[2]{% \begingroup \sbox\z@{$#1T$}% get the height of an uppercase letter \resizebox{!}{\ht\z@}{\raisebox{\depth}{$\m@th#1/\mkern-5mu/$}}% \endgroup } \makeatother \begin{document} $AB\newparallel CD$ $\scriptstyle AB\newparallel CD$ \end{document} A different implementation with picture mode. One can easily vary the slope by acting on the second argument to \mathpalette . \documentclass{article} \usepackage{amsmath,pict2e} \makeatletter \newcommand{\newparallel}{\mathrel{\mathpalette\new@parallel{0.3}}} \newcommand{\new@parallel}[2]{% \begingroup \settoheight{\unitlength}{$#1T$}% get the height of an uppercase letter \sbox\z@{\new@parallel@slash{#1}{#2}}% \mkern0.5mu\copy\z@\mkern-0.5mu\copy\z@\mkern0.5mu \endgroup } \newcommand{\new@parallel@slash}[2]{% \begin{p...

Calligraphic E (not \mathcal)

Image
Answer : Try doing: \documentclass[12pt]{article} \usepackage{mathrsfs} \pagestyle{empty} \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it} \begin{document} The sample space is $\mathpzc{E}$. \end{document} See The Comprehensive LaTeX Symbol, page 68 for a pretty complete list of math fonts available and how to get to typeset them. You can also check A comprehensive review of mathematics in (La)TeX, page 95 onwards. There's also The LaTeX Font Catalogue - Calligraphic and Handwritten Fonts. You can try rsfs: The code \documentclass[12pt]{article} \usepackage{mathrsfs} \pagestyle{empty} \begin{document} The sample space is $\mathscr E$. \end{document} produces