我在大学学习理论,讲师使用这个符号表示初等概率:
我想在数学模式下使用它,但我从http://detexify.kirelabs.org/classify.html曾是:
\usepackage[T1]{fontenc}
\TH
textmode
和
\usepackage{ tipa }
\textthorn
textmode
我需要的是数学模式下的这个符号,无衬线,斜体。
我怎样才能到达那里?
答案1
这综合列表显示一组不同的\thorn
符号,取决于不同的包。
下表给出了一些命令的示例。
可能会有一些警告,特别是对于\itshape
字体形状,因为这种形状并不适用于所有字体/符号
\documentclass{article}
\usepackage{mathtools}
\usepackage[T1]{fontenc}
\usepackage{tipa}
\usepackage{tipx}
\usepackage{wasysym}
\newcommand{\mythorntable}[1]{%
\begin{tabular}{ll}
\multicolumn{2}{c}{#1} \tabularnewline
fontenc & \TH~\th \tabularnewline
tipa & \textthorn \tabularnewline
tipx & \textthornvari~\textthornvarii~\textthornvariii~\textthornvariv \tabularnewline
wasysym & \thorn~\Thorn \tabularnewline
\end{tabular}
}
\begin{document}
\huge
\begin{tabular}{ll}
\mythorntable{Normal font}
&
\slshape
\mythorntable{Slanted}
\tabularnewline
& \tabularnewline
\sffamily
\mythorntable{Sans serif}
&
\itshape
\mythorntable{Italic}
\tabularnewline
& \tabularnewline
\begin{tabular}{ll}
\multicolumn{2}{c}{Math} \tabularnewline
fontenc & $\text{\sffamily\itshape\TH~\th}$ \tabularnewline
tipa & $\text{\sffamily\itshape\textthorn}$ \tabularnewline
\tabularnewline
\end{tabular} &
\end{tabular}
\end{document}
答案2
使用无衬线斜体!;-)
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\newcommand{\pTH}{\text{\normalfont\sffamily\itshape\TH\/}}
\newcommand{\pth}{\text{\normalfont\sffamily\itshape\th\/}}
\begin{document}
$a\pTH b\ne a\pth b$
\end{document}
答案3
答案4
用于 pdflatex。
\documentclass{article}
\usepackage{tabstackengine}
\newsavebox\foobox
\newcommand{\slantbox}[2][.5]{\mbox{%
\sbox{\foobox}{#2}%
\hskip\wd\foobox
\pdfsave
\pdfsetmatrix{1 0 #1 1}%
\llap{\usebox{\foobox}}%
\pdfrestore
}}
\setstacktabbedgap{.5ex}
\setstackgap{L}{8pt}
\newcommand\prob{\mkern-1mu%
\slantbox[.3]{\stackengine{0pt}{$\mathsf{p}$}{$\mathsf{l}$}{O}{l}{F}{F}{L}}%
\mkern1mu}
\begin{document}
$(\prob(x) = .3)$
\end{document}
如果在较小的数学样式中需要它:
\documentclass{article}
\usepackage{tabstackengine,scalerel}
\newsavebox\foobox
\newcommand{\slantbox}[2][.5]{\mbox{%
\sbox{\foobox}{#2}%
\hskip\wd\foobox
\pdfsave
\pdfsetmatrix{1 0 #1 1}%
\llap{\usebox{\foobox}}%
\pdfrestore
}}
\setstacktabbedgap{.5ex}
\setstackgap{L}{8pt}
\newcommand\prob{\ThisStyle{\mkern-1mu%
\slantbox[.3]{\stackengine{0pt}{$\SavedStyle\mathsf{p}$}{$\SavedStyle\mathsf{l}$}{O}{l}{F}{F}{L}}%
\mkern1mu}}
\begin{document}
$(\prob(x) = .3)$
$\scriptstyle(\prob(x) = .3)$
$\scriptscriptstyle(\prob(x) = .3)$
\end{document}