gsalzer / subfiles

class and package for multi-file projects in LaTeX
LaTeX Project Public License v1.3c
25 stars 1 forks source link

When building HTML only first subfile is processed #20

Open salty-vagrant opened 3 years ago

salty-vagrant commented 3 years ago

This seems to have been introduced between v2.1 and v2.2.

When producing HTML output using make4ht (TeXLive2020 installation) only the first \subfile is processed. The same file processes fine into a PDF (using pdflatex)

My LaTeX-fu is still weak :( otherwise I would fix and submit a pull request.

Minimal Example

%test.tex
\documentclass{article}

\usepackage{subfiles}

\begin{document}

\subfile{file1}
\subfile{file2}

\end{document}
% file1.tex
\documentclass[test]{subfiles}

\begin{document}

File 1 content

\end{document}
% file2.tex
\documentclass[test]{subfiles}

\begin{document}

File 2 content

\end{document}

Using subfiles @v2.2 make4ht test.tex produces incorrect (only file1.tex)

<!DOCTYPE html>
<html lang='en-US' xml:lang='en-US'>
<head><title></title>
<meta charset='utf-8' />
<meta name='generator' content='TeX4ht (https://tug.org/tex4ht/)' />
<meta name='viewport' content='width=device-width,initial-scale=1' />
<link type='text/css' rel='stylesheet' href='test.css' />
<meta name='src' content='test.tex' />
</head><body>
<!-- l. 5 --><p class='noindent'>File 1 content
</p>

</body>
</html>

Using subfiles @v2.1 make4ht test.tex produces correct output

<!DOCTYPE html>
<html xml:lang='en-US' lang='en-US'>
<head><title></title>
<meta charset='utf-8' />
<meta name='generator' content='TeX4ht (https://tug.org/tex4ht/)' />
<meta name='viewport' content='width=device-width,initial-scale=1' />
<link rel='stylesheet' type='text/css' href='test.css' />
<meta name='src' content='test.tex' />
</head><body>
<!-- l. 5 --><p class='noindent'>File 1 content
</p><!-- l. 5 --><p class='indent'>   File 2 content
</p>

</body>
</html>

Full test environment

I'm using a custom profile for my TeXLive 2020 install, all captured in Docker containers. I Used the following for the preceding tests.

docker run -it -v "$(pwd):/tmp/test" saltyvagrant/latex-docker:sf-2.1 /bin/bash

cd /tmp/test
make4ht test.tex
docker run -it -v "$(pwd):/tmp/test" saltyvagrant/latex-docker:sf-2.2 /bin/bash

cd /tmp/test
make4ht test.tex

The only difference between the two containers being the subfiles.cls and subfiles.sty used.

gsalzer commented 3 years ago

Thanks for reporting the issue. This is an incompatibility between make4ht and subfiles, and I'm not yet sure on which side this can be fixed. At the beginning of Oct 2020 there were some fundamental change in the innards of LaTeX, which prompted the changes in subfiles. Not sure that make4ht has already been adapted. I will discuss the issue with the maintainer of make4ht.