0

I have a file and I'd like to print it in the log file. The problem is that if I add a new line with ^^J, often two newlines are added when the size of the line to print is exactly the maximum width of the line in the console (which occurs… always since I print the log of a latex file 90% of the times).

MWE: demo.txt

(/nix/store/6z1x24dwqp88qh769isg4y769w47d1x2-texlive-combined-2022/share/texmf/
tex/latex/epstopdf-pkg/epstopdf-base.sty
(/nix/store/6z1x24dwqp88qh769isg4y769w47d1x2-texlive-combined-2022/share/texmf/
tex/latex/latexconfig/epstopdf-sys.cfg))

! Package tikz Error: Giving up on this path. Did you forget a semicolon?.

See the tikz package documentation for explanation.

foo.tex:

\documentclass{article}

\begin{document} Look at the log.

\ExplSyntaxOn \ior_new:N \g__my_read_ior

\cs_new:Nn \robExt_write_file_in_log:n { \ior_open:Nn \g__my_read_ior {#1}% \ior_str_map_inline:Nn \g__my_read_ior {% \message{\tl_to_str:n{##1}^^J}% }% } \message{--------------} \robExt_write_file_in_log:n {demo.txt} \message{--------------} \ExplSyntaxOff

\end{document}

tobiasBora
  • 8,684

0 Answers0