![如何在数学符号上画垂直线?](https://linux22.com/image/336158/%E5%A6%82%E4%BD%95%E5%9C%A8%E6%95%B0%E5%AD%A6%E7%AC%A6%E5%8F%B7%E4%B8%8A%E7%94%BB%E5%9E%82%E7%9B%B4%E7%BA%BF%EF%BC%9F.png)
答案1
答案2
如果竖线应该是一种数学重音,则可以使用以下想法:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\DeclareRobustCommand{\vbar}[1]{{\vbar@accent{#1}}}
\newcommand\vbar@accent[1]{%
\overset{%
\text{\smash[b]{\rule[-0.4ex]{0.4pt}{0.8ex}}}% <-- customize 0.8ex
}{#1}%
}
\makeatother
\begin{document}
$X+\vbar{\tau}_{\vbar{\tau}}$
\end{document}