
Tenho 2 nós TikZ com largura de texto fixa:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{cancel}
\begin{document}
\begin{tikzpicture}
\node[text width = 3cm] (1){text text text text text text text text text text text text};
\node[text width = 3cm, below = of 1.south]{\cancel{text text text text text text text text text text text text}};
\end{tikzpicture}
\end{document}
Pelo que entendi, \cancel
o texto está dentro \hbox
e o LaTeX não entende como dividi-lo em palavras.
É possível definir a largura também?
Responder1
Você poderia usar TikZ para desenhar a linha, dando um nome ao nó e usando as âncoras <nodename>.south west
e <nodename>.north east
.
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{cancel}
\begin{document}
\begin{tikzpicture}
\node[text width = 3cm] (1){text text text text text text text text text text text text};
\node (canceled) [text width = 3cm, below = of 1.south]{text text text text text text text text text text text text};
\draw (canceled.south west) -- (canceled.north east);
\end{tikzpicture}
\end{document}
Responder2
Que tal agora:
\node[text width = 3cm, below = of 1.south]{\cancel{%
\begin{minipage}{3cm}
text text text text text text text text text text text text
\end{minipage}%
}};