
Obrigado ao usuário Eric Domenjoud do meu post anteriorQuebras de linha globais para documentos LaTeXConsigo quebrar o texto em meus relatórios gerados automaticamente. Veja o exemplo do formulário Eric abaixo:
\documentclass{article}
\makeatletter
\newenvironment{wraplines}[1][]{%
% encapsulate hyphenation character in a \hbox so that
% it may be arbitrary restricted horizontal mode material e.g $\rightarrow$
\def\@wrapdiscr{\discretionary{\hbox{#1}}{}{}}%
\@wraplines
}{}
\newcommand\@wraplines{%
\@ifnextchar\end\relax{%
\@ifnextchar\par{%
\par\expandafter\@wraplines\@gobble
}%
\@wraplines@aux
}%
}
\def\@wraplines@aux#1 {\x@wraplines@aux#1\@nnil}
\newcommand*\x@wraplines@aux[1]{#1\y@wraplines@aux}
\newcommand*\y@wraplines@aux[1]{%
\ifx#1\@nnil
\space
\expandafter\@wraplines
\else
\@wrapdiscr#1%
\expandafter\y@wraplines@aux
\fi
}
\makeatother
\begin{document}
\begin{wraplines}
\end{wraplines}
\noindent\verb|\begin{wraplines} ... \end{wraplines}|
\begin{wraplines}
Xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\end{wraplines}
\end{document}
A solução é muito boa e quase resolve o meu problema (muito obrigado ao Eric)! Mas há um pequeno problema: tremas...
Com o seguinte LaTeX:
\begin{wraplines}
äüö
\end{wraplines}
Recebo esta mensagem de erro:
! Package inputenc Error: Unicode char �\y@wraplines@aux (U+67B)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.36 äüö
O uso geral de tremas no meu documento não é problema (eu uso os cabeçalhos necessários). Somente no wraplines
ambiente a conversão para o PDF quebra.
Alguém tem uma ideia para resolver isso?