![如何排版合适的“不涉及”符号?](https://linux22.com/image/376530/%E5%A6%82%E4%BD%95%E6%8E%92%E7%89%88%E5%90%88%E9%80%82%E7%9A%84%E2%80%9C%E4%B8%8D%E6%B6%89%E5%8F%8A%E2%80%9D%E7%AC%A6%E5%8F%B7%EF%BC%9F.png)
我正在寻找一个 LaTeX 符号,意思是“A 不必然导致 B”。我找到的数学符号是⊬
,但我还没有找到任何正确显示它的方法。
我怎样才能传达所期望的意思?
答案1
\documentclass{article}
\usepackage{amssymb}
\newcommand\doesnotentail{\mkern-2mu\not\mkern2mu\vdash}
\begin{document}
$A\doesnotentail B$
$A\vdash B$
\end{document}
还有其他一些方法:
\documentclass{article}
\usepackage{amssymb,stackengine}
\newcommand\doesnotentail{\mathrel{\ensurestackMath{%
\stackengine{.175em}{\vdash}{\scriptstyle/}{O}{c}{F}{F}{L}}}}
\begin{document}
$A\doesnotentail B$ via stackengine
$A\vdash B$ \textbackslash vdash
$A\nvdash B$ \textbackslash nvdash
\end{document}
答案2
字体mathabx
定义了大量此类符号。以下是无需加载整个字体即可使用它们的代码:
\documentclass[11pt]{article}%[14pt]
\usepackage{amsmath}
\DeclareFontFamily{U}{matha}{\hyphenchar\font45}
\DeclareFontShape{U}{matha}{m}{n}{%
<-6> matha5
<6-7> matha6
<7-8> matha7
<8-9> matha8
<9-10> matha9
<10-12> matha10
<12-> matha12
} {}%
\DeclareSymbolFont{matha}{U}{matha}{m}{n}
\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{%
<-6> matha5
<6-7> matha6
<7-8> mathb7
<8-9> mathb8
<9-10> mathb9
<10-12> mathb10
<12-> mathb12
}{}%
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}%
\DeclareMathSymbol{\nvdash}{\mathrel}{matha}{"26}
\DeclareMathSymbol{\ndashv}{\mathrel}{matha}{"27}
\DeclareMathSymbol{\nvDash}{\mathrel}{matha}{"2E}
\DeclareMathSymbol{\nDashv}{\mathrel}{matha}{"2F}
\DeclareMathSymbol{\nVdash}{\mathrel}{matha}{"2A}
\DeclareMathSymbol{\ndashV}{\mathrel}{matha}{"2B}
\DeclareMathSymbol{\nVDash}{\mathrel}{mathb}{"2A}
\DeclareMathSymbol{\nDashV}{\mathrel}{mathb}{"2B}
\DeclareMathSymbol{\nVvdash}{\mathrel}{mathb}{"2E}
\DeclareMathSymbol{\ndashVv}{\mathrel}{mathb}{"2F}
\begin{document}
\begin{alignat*}{4}
\texttt{\textbackslash nvdash} &\quad & \nvdash &\hspace{4em} & \texttt{\textbackslash ndashv} &\quad & \ndashv \\
\texttt{\textbackslash nvDash} &\quad & \nvDash &\hspace{4em} & \texttt{\textbackslash nDashv} &\quad & \nDashv \\
\texttt{\textbackslash nVdash} &\quad & \nvDash &\hspace{4em} & \texttt{\textbackslash ndashV} &\quad & \nDashv \\\\
\texttt{\textbackslash nVDash} &\quad & \nVDash &\hspace{4em} & \texttt{\textbackslash nDashV} &\quad & \nDashV \\
\texttt{\textbackslash nVvdash} &\quad & \nVDash &\hspace{4em} & \texttt{\textbackslash nDashV} &\quad & \ndashVv
\end{alignat*}
\end{document}
答案3
⊬ 为 U+ 22AC (无法证明)。这在\nvdash
许多amssymb
其他软件包中都有,包括unicode-math
、、、、、等等。pxfonts
MnSymbol
fdsymbol
mathabx
stix
\documentclass[varwidth, preview]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amssymb} % Or your font package of choice.
\DeclareUnicodeCharacter{22AC}{\ensuremath{\nvdash}}
\begin{document}
\( p ⊬ q \) and \(q \nvdash p\).
\end{document}
这全面的 LaTeX 符号列表显示符号在许多这些字体中的样子。
更简单:
\documentclass[varwidth, preview]{standalone}
\usepackage{unicode-math}
% You can \setmainfont and \setmathfont here.
\begin{document}
\( p ⊬ q \) and \(q \nvdash p\).
\end{document}
这符号列表定义unicode-math
显示此符号在几种 OpenType 字体中的外观(第 58 页)。
但是,如果您想让事情变得更加复杂,其他答案会提供一些非常聪明的方法来伪造它。
答案4
这是一个将否定斜线保持在“蕴涵”符号的高度的可能解决方案。
\documentclass{article}
\usepackage{amsmath,graphicx}
\DeclareRobustCommand{\notvdash}{%
\mathrel{\mathpalette\vdashnot\vdash}%
}
\makeatletter
\newcommand{\vdashnot}[2]{%
\sbox0{$\m@th#1#2$}%
\sbox2{\raisebox{\depth}{$\m@th#1/$}}%
\ooalign{%
\hidewidth$\m@th#1\mkern2mu$\resizebox{1.1\width}{\ht0}{\box2}\hidewidth\cr
\box0\cr
}%
}
\makeatother
\begin{document}
$A\notvdash B$
\end{document}