Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Komascript and include #110

Closed
cedounet opened this issue Jul 8, 2023 · 4 comments
Closed

Problem with Komascript and include #110

cedounet opened this issue Jul 8, 2023 · 4 comments

Comments

@cedounet
Copy link

cedounet commented Jul 8, 2023

Hello,

I am having a weird issue with the following

`❯ cat book.tex
\documentclass{scrbook}
\begin{document}
\chapter{Preface}
\end{document}

❯ cat ko.tex
\input{book.tex`

Both compile fine with pdflatex, but only book.tex works with tex4ebook/make4ht

`tex4ht/unicode.4ht))
(/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
(./ko.aux) [1] [2]
! TeX capacity exceeded, sorry [grouping levels=255].
\adv:c #1->\bgroup
\def :temp {#1}\tmp:cnt #1\afterassignment :gplus \mth:...
l.3 \chapter{Preface}

Output written on ko.dvi (2 pages, 14552 bytes).
Transcript written on ko.log.
[FATAL] make4ht-lib: Fatal error. Command htlatex returned exit code 1`

Not using komascript is fine, removing the \chapter{} also is ok.

❯ make4ht -version make4ht version v0.3m

❯ tex4ebook -version tex4ebook v0.3i

@michal-h21
Copy link
Owner

I think the problem in this case is with \input{book}. When you include any file, not even with \usepackage, but also with input, TeX4ht looks if a configuration file exists. In this case, it finds book.4ht and loads it before scrbook.4ht, which is requested later. These two configuration files clash each other, as both of them are meant for classes.

I was able to fix this particular issue with the following configuration file:

\Preamble{xhtml}
\makeatletter
\renewcommand\no@chapter{\scr@@startchapter{chapter}}
\makeatother
\begin{document}
\EndPreamble

But problems appear as soon as you use other commands that both scrbook.4ht and book.4ht modifies, for example \section. So, it is probably better to rename the book.tex file to something what wouldn't lead to the name clash, like xbook.tex.

@cedounet
Copy link
Author

cedounet commented Jul 9, 2023

Thanks @michal-h21 , I used a symlink and it worked... as you say a lot clashed, tabelofcontents etc...

cedounet added a commit to cedounet/the-sourdough-framework that referenced this issue Jul 13, 2023
hendricius pushed a commit to hendricius/the-sourdough-framework that referenced this issue Jul 13, 2023
* Add chemfig package

Somhow forgot it in chemical equation commit 8004497b

* Change links colors to codeblue

Closes #142

* Use KOMA-Script and twosided printing

Because it looks better.  Also gets rid of headers/footers on empty
pages

* Fix tex4ebook and komascript clash

See michal-h21/tex4ebook#110

* Factor out packages into a sty file

Separates style details out of the main file, now that we start having
more and more style-related settings.

* Remove parskip

Not needed with Koma-script

* Remove tocloft package

Not needed with koma-script

* Use tocbasics instead of floats

to please kpmascript internal algorithm

* Add a bit more breathing space in ToC

so they are not stuck together at 11.11 onwards...
@cedounet
Copy link
Author

I am happy to close it, although I naively think it should compile with htlatex if it compiles with pdf/lualtatex. Probably not realistic 😄

Thanks for all your work.

@michal-h21
Copy link
Owner

Ideally it should compile, but clashes like this are hard to resolve automatically. Or maybe even impossible :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants