scrlayer-notecolumn with lualatex and space in filename
KOMA-Script is a bundle of versatile LaTeX classes and packages
Brought to you by:
kohm
If the LaTeX document's file name contains spaces scrlayer-notecolumn fails with an error. For example:
% This is file `lua test.tex'.
\documentclass{scrbook}
\usepackage{scrlayer-scrpage}
\usepackage{scrlayer-notecolumn}
\begin{document}
Hallo.
\end{document}
fails with error:
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrlayer-notecolumn.s
ty[\directlua]:1: ')' expected near 'lua'.
<argument> ...m {\directlua {slncmdfivesum("\jobname .slnc")}
}\fi
l.930 }
%
?
The problem is, that
\jobnamein this case is"lua test". So the expansion of\jobnamealready contains"and"\jobname .slnc"expands to""lua test".slnc", which is indeed wrong.But only filenames with spaces have such a quotes. So removing the quotes in the lua code would fix the space case but break the non-space case.
And
\directlua {slncmdfivesum(tex.jobname .. ".slnc")}also fails, iftex.jobnameis"lua test", because in this case, indeed a file"lua test".slncwould be opened and that would fail. So it seems we need to remove the outer quote characters if they are there. Any better suggestion?BTW: Function
slncmdfivesumshould be renamed toscrlayer.notecolumn.slncmdfivesum. And, because the argument is always the same, it could be defined without argument.Last edit: Markus Kohm 2021-03-10
fixed → [r3591]
Related
Commit: [r3591]