-
Notifications
You must be signed in to change notification settings - Fork 15
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
Why does pdfLaTeX fail in combination with make4ht #148
Comments
I can confirm that there is an issue even in the HTML output. I probably won't have a time to look into this during the weekend, hopefully I will be able to investigate it next week. |
Thanks for the quick reply. Next week would be more than quick. That was my very first attempt to see if any usable HTML would come out. Unfortunately this is not quite the case. Apparently pdfLaTeX does not seem to be bothered by the thing in line 26 if you use -f html5. In the end, the HTML output is somehow unclean. For odt's everything seems to collapse on the way. Presumably because something doesn't fit with the XML (I think odt, like docx, is ultimately just XML). However, I suspected that this was only because it could not find the control sequences. In principle, it seems that it somehow no longer works from \subthreesection onwards. I was hoping that this was just some minor problem with the pdfLaTeX call. |
I've fixed the main issues that were causing compilation errors – special sectioning commands provided by Jurabook and footnotes. The fixes are already in TeX4ht sources, so they should be included in TeX Live soon. In the meantime, you can use following configuration files:
% jurabook.4ht (2024-05-28-13:39), generated from tex4ht-4ht.tex
% Copyright 2024 TeX Users Group
% Copyright 2009-2024 TeX Users Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any
% later version. The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions
% of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
% is the TeX4ht Project <http://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.
\immediate\write-1{version 2024-05-28-13:39}
\let\no@subthreesection\subthreesection
\Def:Section\subthreesection{\ifnum \c:secnumdepth>\c@secnumdepth \else
\thesubthreesection \fi}{#1}
\let\no:subthreesection\subthreesection
\def\subthreesection{\rdef:sec{subthreesection}}
\let\no@subfoursection\subfoursection
\Def:Section\subfoursection{\ifnum \c:secnumdepth>\c@secnumdepth \else
\thesubfoursection \fi}{#1}
\let\no:subfoursection\subfoursection
\def\subfoursection{\rdef:sec{subfoursection}}
\let\no@subfivesection\subfivesection
\Def:Section\subfivesection{\ifnum \c:secnumdepth>\c@secnumdepth \else
\thesubfivesection \fi}{#1}
\let\no:subfivesection\subfivesection
\def\subfivesection{\rdef:sec{subfivesection}}
\let\no@subsixsection\subsixsection
\Def:Section\subsixsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
\thesubsixsection \fi}{#1}
\let\no:subsixsection\subsixsection
\def\subsixsection{\rdef:sec{subsixsection}}
\let\no@subsevensection\subsevensection
\Def:Section\subsevensection{\ifnum \c:secnumdepth>\c@secnumdepth \else
\thesubsevensection \fi}{#1}
\let\no:subsevensection\subsevensection
\def\subsevensection{\rdef:sec{subsevensection}}
\let\no@subeightsection\subeightsection
\Def:Section\subeightsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
\thesubeightsection \fi}{#1}
\let\no:subeightsection\subeightsection
\def\subeightsection{\rdef:sec{subeightsection}}
\NewConfigure{tableofcontents*}[1]{%
\def\:tempa{#1}\ifx\empty\:tempa
\ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
\else
\edef\auto:toc{#1}%
\ifx \au:StartSec\:UnDef
\let\au:StartSec\:StartSec
\def\:StartSec{\:tableofcontents
\global\let\auto:toc\:UnDef \global\let\:StartSec\au:StartSec\:StartSec}%
\append:def\tableofcontents{\gdef\:StartSec{\au:StartSec}}%
\fi \fi
}
\Configure{tableofcontents*}{part,chapter,section,subsection,subsubsection,subthreesection,subfoursection,subfivesection,subsixsection,subsevensection,subeightsection}
\renewcommand{\@makefntext}[1]{%
\stepcounter{totalfootnotes}%
\renewcommand{\baselinestretch}{\@ne}% (nur) dieses hinzugefuegt fuer einzeilige Ausgabe
\parindent 1em%
\noindent%
\@infootnotetrue%
\hb@xt@1.8em{\hss\@makefnmark}#1%
\@infootnotefalse}
\Hinput{jurabook}
and \Preamble{xhtml}
\makeatletter
\catcode`\:=11
\ConfigureMark{subthreesection}
{\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
\else \@seccntformat{subthreesection}\fi }
\Configure{subthreesection}
{\IgnorePar\EndP \HCode{<!--start of subthreesection-->}}
{\IgnorePar\EndP \HCode{<!--end of subthreesection-->}}
{\HCode{<text:h
text:style-name="\csname a:Heading-4\if@rl-rtl\fi
\endcsname"
\text:outlinelevel="4" ><text:span
text:style-name="subthreesection" >}\TitleMark\space
\HCode{</text:span>}\IgnoreIndent}
{\HCode{</text:h>\Hnewline}\par\ShowPar}
\ConfigureMark{subfoursection}
{\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
\else \@seccntformat{subfoursection}\fi }
\Configure{subfoursection}
{\IgnorePar\EndP \HCode{<!--start of subfoursection-->}}
{\IgnorePar\EndP \HCode{<!--end of subfoursection-->}}
{\HCode{<text:h
text:style-name="\csname a:Heading-4\if@rl-rtl\fi
\endcsname"
\text:outlinelevel="4" ><text:span
text:style-name="subfoursection" >}\TitleMark\space
\HCode{</text:span>}\IgnoreIndent}
{\HCode{</text:h>\Hnewline}\par\ShowPar}
\ConfigureMark{subfivesection}
{\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
\else \@seccntformat{subfivesection}\fi }
\Configure{subfivesection}
{\IgnorePar\EndP \HCode{<!--start of subfivesection-->}}
{\IgnorePar\EndP \HCode{<!--end of subfivesection-->}}
{\HCode{<text:h
text:style-name="\csname a:Heading-4\if@rl-rtl\fi
\endcsname"
\text:outlinelevel="4" ><text:span
text:style-name="subfivesection" >}\TitleMark\space
\HCode{</text:span>}\IgnoreIndent}
{\HCode{</text:h>\Hnewline}\par\ShowPar}
\ConfigureMark{subsixsection}
{\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
\else \@seccntformat{subsixsection}\fi }
\Configure{subsixsection}
{\IgnorePar\EndP \HCode{<!--start of subsixsection-->}}
{\IgnorePar\EndP \HCode{<!--end of subsixsection-->}}
{\HCode{<text:h
text:style-name="\csname a:Heading-4\if@rl-rtl\fi
\endcsname"
\text:outlinelevel="4" ><text:span
text:style-name="subsixsection" >}\TitleMark\space
\HCode{</text:span>}\IgnoreIndent}
{\HCode{</text:h>\Hnewline}\par\ShowPar}
\ConfigureMark{subsevensection}
{\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
\else \@seccntformat{subsevensection}\fi }
\Configure{subsevensection}
{\IgnorePar\EndP \HCode{<!--start of subsevensection-->}}
{\IgnorePar\EndP \HCode{<!--end of subsevensection-->}}
{\HCode{<text:h
text:style-name="\csname a:Heading-4\if@rl-rtl\fi
\endcsname"
\text:outlinelevel="4" ><text:span
text:style-name="subsevensection" >}\TitleMark\space
\HCode{</text:span>}\IgnoreIndent}
{\HCode{</text:h>\Hnewline}\par\ShowPar}
\ConfigureMark{subeightsection}
{\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
\else \@seccntformat{subeightsection}\fi }
\Configure{subeightsection}
{\IgnorePar\EndP \HCode{<!--start of subeightsection-->}}
{\IgnorePar\EndP \HCode{<!--end of subeightsection-->}}
{\HCode{<text:h
text:style-name="\csname a:Heading-4\if@rl-rtl\fi
\endcsname"
\text:outlinelevel="4" ><text:span
text:style-name="subeightsection" >}\TitleMark\space
\HCode{</text:span>}\IgnoreIndent}
{\HCode{</text:h>\Hnewline}\par\ShowPar}
\ConfigureToc{subthreesection}
{\HCode{<text:p text:style-name="P3" ><text:span
text:style-name="toc-mark" >}}
{ \HCode{</text:span>}}
{}
{\HCode{</text:p>}}
\ConfigureToc{subfoursection}
{\HCode{<text:p text:style-name="P3" ><text:span
text:style-name="toc-mark" >}}
{ \HCode{</text:span>}}
{}
{\HCode{</text:p>}}
\ConfigureToc{subfivesection}
{\HCode{<text:p text:style-name="P3" ><text:span
text:style-name="toc-mark" >}}
{ \HCode{</text:span>}}
{}
{\HCode{</text:p>}}
\ConfigureToc{subsixsection}
{\HCode{<text:p text:style-name="P3" ><text:span
text:style-name="toc-mark" >}}
{ \HCode{</text:span>}}
{}
{\HCode{</text:p>}}
\ConfigureToc{subsevensection}
{\HCode{<text:p text:style-name="P3" ><text:span
text:style-name="toc-mark" >}}
{ \HCode{</text:span>}}
{}
{\HCode{</text:p>}}
\ConfigureToc{subeightsection}
{\HCode{<text:p text:style-name="P3" ><text:span
text:style-name="toc-mark" >}}
{ \HCode{</text:span>}}
{}
{\HCode{</text:p>}}
\catcode`\:=12
\makeatother
\begin{document}
\EndPreamble Compile using:
|
Thank you very much! That works. Two strange things continue to happen: The above command comes with this warning:
If this is supplemented by -B ./build/ and -d ./odt/ this error also occurs:
Do I assume correctly that the above configuration and the - I guess - template only work for odt? |
I cannot reproduce these errors. The The configuration file works only for HTML, this one should work for HTML: \Preamble{xhtml}
\Configure{subthreesection}
{}{}
{\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subthreesection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
\ConfigureMark{subthreesection}{\HCode{<span class="titlemark">}\thesubthreesection\HCode{</span>}}
\Configure{subfoursection}
{}{}
{\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subfoursection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
\ConfigureMark{subfoursection}{\HCode{<span class="titlemark">}\thesubfoursection\HCode{</span>}}
\Configure{subfivesection}
{}{}
{\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subfivesection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
\ConfigureMark{subfivesection}{\HCode{<span class="titlemark">}\thesubfivesection\HCode{</span>}}
\Configure{subsixsection}
{}{}
{\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subsixsection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
\ConfigureMark{subsixsection}{\HCode{<span class="titlemark">}\thesubsixsection\HCode{</span>}}
\Configure{subsevensection}
{}{}
{\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subsevensection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
\ConfigureMark{subsevensection}{\HCode{<span class="titlemark">}\thesubsevensection\HCode{</span>}}
\Configure{subeightsection}
{}{}
{\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subeightsection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
\ConfigureMark{subeightsection}{\HCode{<span class="titlemark">}\thesubeightsection\HCode{</span>}}
\catcode`\:=11
\def\tocsubthreesection#1#2#3{\par\toc:num{subthreesection}{#1}{#2}\par}
\def\tocsubfoursection#1#2#3{\par\toc:num{subfoursection}{#1}{#2}\par}
\def\tocsubfivesection#1#2#3{\par\toc:num{subfivesection}{#1}{#2}\par}
\def\tocsubsixsection#1#2#3{\par\toc:num{subsixsection}{#1}{#2}\par}
\def\tocsubsevensection#1#2#3{\par\toc:num{subsevensection}{#1}{#2}\par}
\def\tocsubeightsection#1#2#3{\par\toc:num{subeightsection}{#1}{#2}\par}
\catcode`\:=12
\begin{document}
\EndPreamble
|
Hm..... Cleanup
Run build:
Content of ./build/:
Content of ./odt/:
Type of .tmp in ./build/:
The XML looks like a odt. They are not the same:
I'm confused. I don't know whats happening. But Only happens with -B and -d. |
Can you post the terminal output that follows |
Ater a cleanup and a new build run:
I only notice the error that was already mentioned. Apparently coming from xtpipes. macOS Monterey with MacTeX installed with Homebrew. |
It seems like a bug in |
Yes, the document works. Both in LibreOffice and in Word. That is very helpful. Even if you have to fix something in the formatting. But the result is much more than I had hoped for. The rest would certainly require extensive optimization. |
I hopefully fixed the handling of the build dir in the development version of |
I am trying to translate this LaTeX document into an odt using make4ht.
Strangely enough, pdfLaTeX succeeds in building a PDF in TeXShop, but pdfLaTeX fails when called via make4ht.
Apparently because it does not find control sequences defined by \renewcommand in the document class.
I have done the following:
There also seems to be something wrong with the footnote in line 26. pdfLaTeX doesn't even bother if it runs via TeXShop.
I use the latest version of MacTeX.
It would be very helpful if I could make odt's out of it.
I suspect the problem is simple and only has something to do with the call or with the environment that TeX4ht creates.
I have attached a log.
Any advice will certainly help me. Thank you in advance.
Best Regards
hausarbeit-demo.log
The text was updated successfully, but these errors were encountered: