subfiles icon indicating copy to clipboard operation
subfiles copied to clipboard

When building HTML only first subfile is processed

Open salty-vagrant opened this issue 4 years ago • 1 comments

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.

salty-vagrant avatar Dec 17 '20 17:12 salty-vagrant