如何删除 LaTeX 方程内部的内容?

发布于 2024-08-29 11:44:40 字数 1459 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

↘人皮目录ツ 2024-09-05 11:44:40

看起来 \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}

It looks like the \sout doesn't work inside a math env.
You can try doing something like this, which works:

\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}
辞慾 2024-09-05 11:44:40

如果有人仍然感兴趣,我刚刚发现了取消套餐 ,它允许您以几种不同的方式在数学模式下删除文本。不过,它不是水平的——只是对角线,就我而言,这要好得多。

If anyone's still interested, I just found out about the cancel package, which allows you to strike your text in math mode in a few different ways. It's not horizontal, though -- only diagonal, which in my case is much better.

背叛残局 2024-09-05 11:44:40

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

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

那么

$\msout{\mathsf{stuckout}}$

您需要 amsmath 和 ulem。

(来自此处的解决方案。)

If you need to keep the strikeout in Math mode (e.g., to keep Math fonts) try:

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

then

$\msout{\mathsf{stuckout}}$

you need amsmath and ulem.

(Solution from here.)

浅唱ヾ落雨殇 2024-09-05 11:44:40

几乎任何非数学模式命令都可以在数学模式中使用,只需将其放入 \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}

Pretty much any non-math-mode command can be used inside mathmode by putting it within a \text{} environment, e.g.:

\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}

And if you'd like to be able to use strike-out without having ulem redefine how \emph{} works, use \usepackage[normalem]{ulem}.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文