条件独立性有标准符号吗?

条件独立性有标准符号吗?

我发现这个符号的定义是:

    \def\ci{\perp\!\!\!\perp}

在维基百科页面上条件独立。这是来自综合 LaTex 符号列表第 106 页的内容:

Donald Arseneau posted the following \mathpalette-based definition of a probabilistic-independence symbol ⊥⊥ to comp.text.tex in June 2000:

    \newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}}
    \def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}}

The \independent macro uses \mathpalette to pass the \independenT helper 
macro both the current math style and the \perp symbol. \independenT 
typesets \perp in the current math style, moves two math units to the 
right, and finally typesets a second—overlapping—copy of \perp, again 
in the current math style. \rlap, which enables text overlap, is described 
later on this page.

坦率地说,我更喜欢第一个版本,尽管它在我的计算机上排版不正确。

还有其他更好的选择吗?

答案1

综合 LaTeX 符号列表的常用位置有包\upmodels中的符号mnsymbol,它看起来更像维基百科文章中使用的第一个符号。不过,条之间的水平距离比第一个版本要小一点。自己看看吧:

\documentclass{article}
\usepackage{MnSymbol}

\begin{document}

\def\ci{\perp\!\!\!\perp} % from Wikipedia
\newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}} % symbols-a4, p.106
\def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}} 

$\upmodels$ % mnsymbol
$\independent$
$\ci$
\end{document}

答案2

在 Unicode 中为:

⫫ U+2AEB 双线向上

如果您有一个可运行的unicode-math安装,您可以直接使用该符号,或者使用它的别名\Vbar

答案3

虽然这个答案也从 MnSymbol 字体导入了符号,但它提供了两个显著的​​改进。

第一的正如许多人在本网站的其他答案中所指出的那样,使用MnSymbol包更改许多字形,这通常是不想要的。因此经常提到的方法是导入只需要想要的字形MnSymbol,其他的都保持原样。

由于这种方法似乎经常使用,因此我在这里提供的“附加值”是引入三个宏

\ImportFromMnSymbol{<family>}
\DeclareMnSymbol{<macro-name>}{<type>}{<family>}{<glyph-slot>}
\MnSymbolGlyphs{<family>}% EXECUTED IN THE PREAMBLE

\DeclareMnSymbol宏与宏类似\DeclareMathSymbol,只是第三个参数仅仅是MnSymbol系列,例如AB等。字形槽可以以十进制、八进制或十六进制给出。

\MnSymbolGlyphs在序言中执行的宏将所需系列的字体表显示为MnSymbol文档中的第一项。这允许定位特定字形及其槽位号。

因此,在这个例子中,一旦定义了上述宏,如果我想MnSymbol直接使用字形,用法将是

\ImportFromMnSymbol{A}
\DeclareMnSymbol{\ConIndep}{\mathrel}{A}{225}

通过重复调用 ,可以从一个家族导入多个字形\DeclareMnSymbol。当然,\ImportFromMnSymbol在声明该家族的符号之前,必须为该家族调用该宏。

但这是第二改进。MnSymbol表示所需的字形在垂直方向上太小。因此,我使用该scalerel包将所需的字形缩放到合适的大小,同时保持其与当前数学样式兼容。

在下面的 MWE 中,我包含了使用的注释行\MnSymbolGlyphs,可以取消注释/编辑它以探索 MnSymbol 的可用字形。

\documentclass{article}
\usepackage{scalerel}
\def\MnSymbolGlyphs#1{% IF ONE NEEDS TO LOCATE GLYPHS
  \usepackage{MnSymbol,fonttable}%
  \AtBeginDocument{\fonttable{MnSymbol#110}}%
}
\def\ImportFromMnSymbol#1{%
  \DeclareFontFamily{U} {MnSymbol#1}{}
  \DeclareFontShape{U}{MnSymbol#1}{m}{n}{
   <-6> MnSymbol#15
   <6-7> MnSymbol#16
   <7-8> MnSymbol#17
   <8-9> MnSymbol#18
   <9-10> MnSymbol#19
   <10-12> MnSymbol#110
   <12-> MnSymbol#112}{}
  \DeclareFontShape{U}{MnSymbol#1}{b}{n}{
   <-6> MnSymbol#1-Bold5
   <6-7> MnSymbol#1-Bold6
   <7-8> MnSymbol#1-Bold7
   <8-9> MnSymbol#1-Bold8
   <9-10> MnSymbol#1-Bold9
   <10-12> MnSymbol#1-Bold10
   <12-> MnSymbol#1-Bold12}{}
  \DeclareSymbolFont{MnSy#1} {U} {MnSymbol#1}{m}{n}
}
\newcommand\DeclareMnSymbol[4]{\DeclareMathSymbol{#1}{#2}{MnSy#3}{#4}}
\ImportFromMnSymbol{A}
\DeclareMnSymbol{\ConIndepNat}{\mathrel}{A}{225}
\def\ConIndep{\mathrel{\scalerel*{\ConIndepNat}{X}}}
%\MnSymbolGlyphs{A}
\begin{document}
$A \ConIndepNat B$ as imported from MnSymbol\par
$A \ConIndep B$ scaled to height of X\par
$A \ConIndep B\quad\scriptstyle A \ConIndep B\quad\scriptscriptstyle A \ConIndep B$
autoscaling to math style
\end{document}

在此处输入图片描述

相关内容