39

请参阅下面的片段并告诉我如何实现与正文中相同的删除效果。我正在使用最新的 Ubuntu 存储库中的 LaTeX 版本。

\documentclass{article}
\usepackage{ulem}
\begin{document}
The sout tag works perfect in the \sout{main text area} but not inside the equations.
$$
list = [1, \sout{2}, 3, \sout{4}, 5, \sout{6}, 7, \sout{8}, 9, \sout{10}]
$$
Any clue?
\end{document}

这是 LaTeX 输出

4

4 回答 4

27

看起来\sout在数学环境中不起作用。你可以尝试做这样的事情,它的工作原理:

\documentclass{article}
\usepackage{ulem}
\begin{document}
The sout tag works perfect in the \sout{main text area} but not inside the equations.

$list = $[1, \sout{2}, 3, \sout{4}, 5, \sout{6}, 7, \sout{8}, 9, \sout{10}$]$

Any clue?
\end{document}
于 2010-04-18T21:16:52.087 回答
27

如果有人仍然感兴趣,我刚刚发现了取消包,它允许你以几种不同的方式在数学模式下敲击你的文本。不过,它不是水平的——只有对角线,在我的情况下要好得多。

于 2010-11-09T15:16:32.780 回答
11

几乎任何非数学模式命令都可以通过将其置于\text{}环境中来在数学模式中使用,例如:

\documentclass{article}
\usepackage{ulem}
\begin{document}
The sout tag works perfect in the \sout{main text area} but not inside the equations.

\[ list = [1, \text{\sout{2}}, 3, \text{\sout{4}}, 5, \text{\sout{6}}, 7, \text{\sout{8}}, 9, \text{\sout{10}}] \]
Any clue?
\end{document}

如果您希望能够在重新ulem定义\emph{}工作方式的情况下使用删除,请使用\usepackage[normalem]{ulem}.

于 2011-04-19T14:14:41.367 回答
11

如果您需要在数学模式下保持删除线(例如,保持数学字体),请尝试:

\newcommand{\msout}[1]{\text{\sout{\ensuremath{#1}}}}

然后

$\msout{\mathsf{stuckout}}$

你需要 amsmath 和 ulem。

(从这里解决。)

于 2011-08-23T02:30:12.543 回答