[Tex/LaTex] Different symbol for g
symbols
Related Solutions
The manfnt
package offers \mancube
and \manimpossiblecube
:
\documentclass{article}
\usepackage{manfnt}
\begin{document}
\mancube
\manimpossiblecube
\end{document}
Those commands won't directly work in math mode, but you can use a \mbox
; something like this:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{euler}
\usepackage{manfnt}
\begin{document}
\[
\mbox{\mancube}_{n} +(n+1)^{3}
\]
\end{document}
Of course, you could define a command if you are going to use the cube several times:
\newcommand*\cube{\mbox{\mancube}}
2017 Update: Since \mid
is a relation, under normal circumstances the spaces manually inserted around \middle|
should be thick \;
instead of thin \,
. See table on p.170 of the TEXbook.
Instead of \mid
, you can use \middle
command to enlarge vertical delimiter and insert spaces manually, here is an example:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[S=\left(\frac{\sum_{i=1}^{n}X_i}{n}\;\middle|\;X_i\sim\chi^2(k)\right)\]
\[\left.\frac{\sum_{i=1}^{n}X_i+Y_i}{n}\;\middle|\;X\sim\chi^2_k\;\middle|\;Y\sim\mathcal{N}(\mu,\sigma^2)\right.\]
\end{document}
Result:
Better yet, we can make a custom command for our conveniences:
\makeatletter
\newcommand{\@giventhatstar}[2]{\left(#1\;\middle|\;#2\right)}
\newcommand{\@giventhatnostar}[3][]{#1(#2\;#1|\;#3#1)}
\newcommand{\giventhat}{\@ifstar\@giventhatstar\@giventhatnostar}
\makeatother
It works sorta like \DeclarePairedDelimiter
in mathtools
, for example:
\[\giventhat{f(x)=\frac{x^2}{2}}{x=1,2,3,\dotsc}\]
\[\giventhat[\big]{f(x)=\frac{x^2}{2}}{x=1,2,3,\dotsc}\]
\[\giventhat[\Big]{f(x)=\frac{x^2}{2}}{x=1,2,3,\dotsc}\]
\[\giventhat*{f(x)=\frac{x^2}{2}}{x=1,2,3,\dotsc}\]
will give you:
Best Answer
As noted in the comments the standard slanted font has a
g
of this form. You can use it as\textsl{g}
:The package
amstext
is automatically loaded if you useamsmath
ormathtools
. In the above example the package is not needed, but without it you will not get good results if you use the symbol as a superscript or subscript.Another caveat is that in the above code the symbol
\textsl{g}
will change with the surrounding text, for example\textbf{A bold sentence containing $\textsl{g}$
will have the symbol bold. That may or may not be what you want. If you need the symbol to be exactly the same regardless define a macroand use
\cg
instead.