michal-h21 / make4ht

Build system for tex4ht
137 stars 15 forks source link

Add support for spaces in filenames #13

Closed michal-h21 closed 6 years ago

michal-h21 commented 6 years ago

Details here: https://tex.stackexchange.com/a/435154/2891

gusbrs commented 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.

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:
michal-h21 commented 6 years ago

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.

gusbrs commented 6 years ago

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).

michal-h21 commented 6 years ago

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.