Closed michal-h21 closed 6 years ago
To bring here the relevant elements of the discussion at TeX.SX. My testing of the solution you proposed to deal with file names with spaces led me to raise two issues related to file names.
If non ascii characters are involved, compilation fails (This is actually a different problem I think, it just happened to emerge as I tested).
Second is that file name with spaces.tex
will generate file_name_with_spaces.bcf
thus fooling biber when it needs to run. The same is true for all aux files. make4ht
knows the name substitution, but other programs which may eventually be called in during build, don't (at least as most editors would deal with file names). As far as I can tell, this may well affect any features that involve auxiliary files, my guesses would go for: cross-references, bibliography/citation, index, glossary.
A MWE for the case of non ascii characters in the file name is, for a file named Tést.tex
:
\documentclass{article}
\begin{document}
Hello World!!
Resulting in error:
\begin{verbatim}
! I can't find file `T'.
<to be read again>
\global
<*> ...ther\HCode xhtml,,ooffice.a.b.c.\input "Té
st.tex"
(Press Enter to retry, or Control-D to exit)
Please type another input file name:
\end{verbatim}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
And a MWE for the issue with bibliography for file file name with spaces.tex
:
\documentclass{article}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\nocite{*}
\printbibliography
Resulting in a file .bcf file: \verb|file_name_with_spaces.bcf|
When biber is run:
\begin{verbatim}
Running `Biber' on `file name with spaces' with ``biber file\ name\ with\ spaces''
INFO - This is Biber 2.11
INFO - Logfile is 'file name with spaces.blg'
ERROR - Cannot find control file 'file name with spaces.bcf'! - Did latex run successfully on your .tex file before you ran biber?
INFO - ERRORS: 1
\end{verbatim}
Most editors I know will assume the names of the auxiliary files (.bcf among them)
from the name of the .tex file. Of course, we could run biber on
\verb|file_name_with_spaces|, but that would seriously hinder the workflow
usually assumed by the editors. Notice this example does not produce a
bibliography (I think, because the .bbl file is also not found).
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
I think the issue with spaces has no good solution, respective I don't think I can come with something better than is the actual solution, because spaces break the tex4ht
and t4ht
commands, which cannot generate correct files.
I feared that much, but I thank you very much for the attempt anyway. And, if I may suggest, as it stands, the "space-underscore" substitution would be better left out. It's usefulness exists, but is limited, and it may break things. So, perhaps, a clear and simple "no spaces allowed" policy might be a safer haven, until a full fledged solution can be reached (if it can).
I've added some information about filenames to the Troubleshooting section in README. I think I will use this feature, but will adwise against use of spaces.
Details here: https://tex.stackexchange.com/a/435154/2891