
파일이 있는데 이를 로그 파일에 인쇄하고 싶습니다. 문제는 를 사용하여 새 줄을 추가하면 ^^J
인쇄할 줄의 크기가 콘솔에 있는 줄의 최대 너비와 정확히 일치할 때 종종 두 개의 줄바꿈이 추가된다는 것입니다. (이런 현상이 발생합니다... 라텍스 파일의 로그를 인쇄한 이후로 항상 발생합니다. 90%의 경우).
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}