我想在 latex 中的单词上画一条对角线(这意味着我现在忽略该单词)这怎么可能?对角箭头呢?
答案1
\documentclass{article}
\usepackage{cancel}
\begin{document}
Happy New Year! Good bye \cancel{2017}!
\end{document}
至于箭头:
\documentclass{article}
\usepackage{cancel}
\begin{document}
Happy New Year! Good bye \cancel{2017}!
Forget about $\cancelto{~}{2016}$, and don't even mention \xcancel{2015}!
\end{document}
要将单词放在划掉的单词上方,你可以使用:
\documentclass{article}
\usepackage{cancel}
\usepackage{amsmath}
\usepackage{tikz}
\newcommand{\StrikeAndReplace}[2]{\tikz[baseline=(old.base)]{\node(old){#1};
\draw[-] (old.south west)--(old.north east);
\node[above of=old,node distance=4mm] {#2};}}
\begin{document}
Happy New Year! Good bye \cancel{2017}!
Forget about $\cancelto{~}{2016}$, and don't even mention \xcancel{2015}!
New Year's resolution: No more $\stackrel{\displaystyle\text{vegetables}}{\cancel{\text{junk food}}}$!
With Ti\emph{k}Z: \StrikeAndReplace{SUV car}{bike}
\end{document}
毫无疑问,还有更多选择,和/或 Ti钾Z 命令可以根据需要进行调整。