Cross out words with TikZ: line opacity
It is enough to draw the cross in a single path instead of two:
\draw[red,draw opacity=0.5, line width=1.5pt] (A.north west) -- (A.south east) (A.south west) -- (A.north east);
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\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,draw opacity=0.5, line width=1.5pt] (A.north west) -- (A.south east) (A.south west) -- (A.north east);
}%
}
\begin{document}
Antonio Vivaldi was \mycrossed{an Italian} a Venitian Baroque musical composer, virtuoso violinist, teacher, and priest.
\end{document}
You can use the cross out
shape node like that:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{shapes.misc}
\newcommand{\txtcross}[1]{%
\tikz[remember picture, baseline=(A.base)]{
\node[cross out,
draw= red,
line width=1.5pt,
draw opacity=0.5,
inner sep=0pt](A){#1};
}
}
\begin{document}
Jean-Baptiste Lully was \txtcross{a French} an Italian-born French composer, instrumentalist, and dancer
\end{document}
Based on @Hafid Boukhoulda answer, with some simplification (without remember picture
option, slightly different node style definition):
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.misc}
\newcommand\mycrossed[1]{\tikz[baseline=(A.base)]
\node[cross out, draw= red, draw opacity=0.5, line width=1.5pt,
inner sep=0pt, outer sep=0pt] (A) {#1};%
}
\begin{document}
Antonio Vivaldi was \mycrossed{an Italian} a Venitian Baroque musical composer, virtuoso violinist, teacher, and priest. Antonio Vivaldi was \mycrossed{an Italian} a Venitian Baroque musical composer, virtuoso violinist, teacher, and priest.
\end{document}