近くの単語と重なる単語を消す

近くの単語と重なる単語を消す

私はクロスオーバーワードを追加する方法を見つけましたtcolorbox

\documentclass{article}\usepackage{xcolor} \usepackage[most]{tcolorbox}

\begin{document}

Of course, presenting this solution would be cheating. And, no, it won't work in all cases, due to strict limitations on the pairs 
\tcbox[tcbox raise base,
breakable,nobeforeafter, enhanced jigsaw, opacityback=0, sharp corners, parbox=false, boxrule=0pt, top=0pt,bottom=0pt,left=0pt,right=0pt, boxsep=0pt, frame hidden, parbox=false, 
  finish={\draw[thick,red] (frame.south west)--(frame.north east);\draw[thick,red] (frame.south east)--(frame.north west);}]{
  accepted
  }
  by \textbackslash{}line. Your professor surely knows that TeX doesn't draw oblique lines. With the standard package pict2e it's easier and it will work in any case.

\end{document}

ここに画像の説明を入力してください

ここで、「accept」という単語を消します。ただし、この十字を少し、たとえば 1cm ほど伸ばしたいので、私のイラストを参照してください。

ここに画像の説明を入力してください

どうすればそれを達成できるでしょうか?

答え1

あなたはshorten自分のセリフを言うことができます。

短縮

\documentclass{article}\usepackage{xcolor} \usepackage[most]{tcolorbox}

\tikzset{crossout/.style={thick,red,shorten >=-.5cm,shorten <=-.5cm}}

\begin{document}

Of course, presenting this solution would be cheating. And, no, it won't work in all cases, due to strict limitations on the pairs 
\tcbox[tcbox raise base,
breakable,nobeforeafter, enhanced jigsaw, opacityback=0, sharp corners, parbox=false, boxrule=0pt, top=0pt,bottom=0pt,left=0pt,right=0pt, boxsep=0pt, frame hidden, parbox=false, 
  finish={\draw[crossout] (frame.south west)--(frame.north east);\draw[crossout] (frame.south east)--(frame.north west);}]{
  accepted
  }
  by \textbackslash{}line. Your professor surely knows that TeX doesn't draw oblique lines. With the standard package pict2e it's easier and it will work in any case.

\end{document}

答え2

代替の TikZ ソリューション (TeXnician のものほどエレガントではありません)。

スペースを占有せずに何かの上に書き込むことができますoverlay

shift線を拡大するために使用しました(shortenここでも使用できますが、TeXnician がすでに実行しているため使用していません。そのため、代替案を示したいと思います)。

TikZ ノードを通常のテキストに揃えるには、ここを参照してください。通常のテキスト内のTikZノード

\documentclass{article}\usepackage{xcolor} \usepackage{tikz}
\newcommand{\mycrossed}[1]{%
    \tikz[remember picture, baseline=(A.base)]{
        \node[inner sep=0pt](A){#1};
        }%
    \tikz[overlay, remember picture]{
        \draw[red, very thick] ([shift={(-.5,.2)}]A.north west) -- ([shift={(.5,-.2)}]A.south east);
        \draw[red, very thick] ([shift={(-.5,-.2)}]A.south west) -- ([shift={(.5,.2)}]A.north east);
        }%
    }
\begin{document}

Of course, presenting this solution would be cheating. And, no, it won't work in all cases, due to strict limitations on the pairs 
\mycrossed{accepted}
  by \textbackslash{}line. Your professor surely knows that TeX doesn't draw oblique lines. With the standard package pict2e it's easier and it will work in any case.
\end{document}

ここに画像の説明を入力してください

答え3

2019年5月(pgf バージョン 3.1.3shapes.misc) tikz のライブラリにはすでに取り消し線の形状が含まれています。

次のコードと図は、マニュアルのセクション 71.8 から抜粋したものです。

\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
\node [cross out,draw=red] at (1.5,1) {cross out};
\end{tikzpicture}

ここに画像の説明を入力してください

関連情報