
답변1
크로스아웃 명령은 각각 1, 2, 3, 4 스트로크에 대한 \crossout
, \dcrossout
, \tcrossout
, 입니다.\qcrossout
\documentclass{article}
\usepackage{stackengine}
\newcommand\rawcrossout[2]{\stackengine{0pt}{#1}{#2}{O}{c}{F}{T}{L}}
\def\XX{\kern-3pt/}
\newcommand\crossout[1]{\rawcrossout{#1}{/}}
\newcommand\dcrossout[1]{\rawcrossout{#1}{/\XX}}
\newcommand\tcrossout[1]{\rawcrossout{#1}{/\XX\XX}}
\newcommand\qcrossout[1]{\rawcrossout{#1}{/\XX\XX\XX}}
\newcommand\shadowbox[1]{\setbox0=\hbox{#1}\makebox[\wd0]{\fbox{#1}}}
\begin{document}
\shadowbox{2} \crossout{4} \dcrossout{6} \tcrossout{70} \qcrossout{86}
2 4 6 70 86
\end{document}
은 \fbox
일반적으로 박스형 수량에 사용되지만 응용 프로그램에서는 원래 숫자와 동일한 너비를 원할 수도 있는 것으로 보이므로 도 제공합니다 \shadowbox{}
.
답변2
다음을 사용할 수 있습니다 \ooalign
(내가 가장 좋아하는 도구 중 하나).
\documentclass{article}
\newcommand{\crossout}[2][1]{%
\vphantom{\rslash}%
{\ooalign{\hidewidth$\crosses{#1}$\hidewidth\cr$#2$\cr}}%
}
\newcommand{\crosses}[1]{%
\ifcase#1\relax
\or
\rslash\or
\rslash\mskip-5.5mu\rslash\or
\rslash\mskip-5.5mu\rslash\mskip-5.5mu\rslash%
\fi
}
\newcommand{\rslash}{\raisebox{.15ex}{/}}
\begin{document}
\fbox{$2$} \fbox{$3$} \crossout{4} \fbox{$5$} \crossout[2]{6}
\fbox{$7$} \crossout{8} \crossout{9} \crossout[3]{90}
\end{document}