
Antwort1
Die Streichbefehle lauten \crossout
, \dcrossout
, \tcrossout
, und \qcrossout
, für 1, 2, 3 und 4 Striche.
\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}
Während \fbox
für eine in einer Box angegebene Menge normalerweise ein verwendet würde, schien es aus der Anwendung, dass Sie möglicherweise eins wünschen, das die gleiche Breite wie die ursprüngliche Zahl hat, daher gebe ich auch an \shadowbox{}
.
Antwort2
Sie können \ooalign
(eines meiner Lieblingstools zum Spielen) Folgendes verwenden:
\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}