minilot and minilof with tex4ht
up vote
2
down vote
favorite
I'm working on an ebook and i'd like to have a list of figures/tables at the end of every chapter and only for that chapter (so just like minilot and minilof, but unfortunately minitoc doesn't work with tex4ht). The config.cfg for the TOC looks like this so far:
letorigincludegraphicsincludegraphics
Preamble{xhtml,pic-tabular}
TocAt{chapter,section,subsection}
Configure{tableofcontents*}{chapter,section}
Configure{NavSection}{%
booltrue{tocnoempty}
HCode{<li>}}{HCode{<ol>Hnewline}}{}{Tg</ol>Tg</li>}
Css{nav#toc ol{list-style: none;}}
begin{document}
CssFile[custom.css]
/* css.sty */
EndCssFile
Configure{CoverMimeType}{image/jpg}
DeclareGraphicsExtensions{.eps,.png,.jpg,.gif,}
EndPreamble
MWE:
documentclass{book}
usepackage{mwe}
ifdefinedHCode
else
usepackage[nohints]{minitoc}
mtcselectlanguage{german}
mtcsettitle{minitoc}{}
mtcsettitle{minilof}{}
mtcsettitle{minilot}{}
mtcsetfeature{minitoc}{open}{vspace{1cm}}
nomtcrule
nomlfrule
nomltrule
tightmtctrue
fi
begin{document}
ifdefinedHCode
else
dominitoc
dominilof
dominilot
doparttoc
fakelistoffigures
fakelistoftables
tableofcontents
fi
chapter{chapter 1}
ifdefinedHCode
else
minitoc
fi
section{Table}
begin{table}[ht!]
centering
caption{a table}
label{a table}
begin{tabular}{ll}
test & test
end{tabular}
end{table}
section{LOT}
ifdefinedHCode
%here i'd like to have a list of tables for the ebook as well
else
minilot
fi
end{document}
Is there a way to accomplish what i described above?
table-of-contents tex4ht
add a comment |
up vote
2
down vote
favorite
I'm working on an ebook and i'd like to have a list of figures/tables at the end of every chapter and only for that chapter (so just like minilot and minilof, but unfortunately minitoc doesn't work with tex4ht). The config.cfg for the TOC looks like this so far:
letorigincludegraphicsincludegraphics
Preamble{xhtml,pic-tabular}
TocAt{chapter,section,subsection}
Configure{tableofcontents*}{chapter,section}
Configure{NavSection}{%
booltrue{tocnoempty}
HCode{<li>}}{HCode{<ol>Hnewline}}{}{Tg</ol>Tg</li>}
Css{nav#toc ol{list-style: none;}}
begin{document}
CssFile[custom.css]
/* css.sty */
EndCssFile
Configure{CoverMimeType}{image/jpg}
DeclareGraphicsExtensions{.eps,.png,.jpg,.gif,}
EndPreamble
MWE:
documentclass{book}
usepackage{mwe}
ifdefinedHCode
else
usepackage[nohints]{minitoc}
mtcselectlanguage{german}
mtcsettitle{minitoc}{}
mtcsettitle{minilof}{}
mtcsettitle{minilot}{}
mtcsetfeature{minitoc}{open}{vspace{1cm}}
nomtcrule
nomlfrule
nomltrule
tightmtctrue
fi
begin{document}
ifdefinedHCode
else
dominitoc
dominilof
dominilot
doparttoc
fakelistoffigures
fakelistoftables
tableofcontents
fi
chapter{chapter 1}
ifdefinedHCode
else
minitoc
fi
section{Table}
begin{table}[ht!]
centering
caption{a table}
label{a table}
begin{tabular}{ll}
test & test
end{tabular}
end{table}
section{LOT}
ifdefinedHCode
%here i'd like to have a list of tables for the ebook as well
else
minilot
fi
end{document}
Is there a way to accomplish what i described above?
table-of-contents tex4ht
Could you also post a TeX sample?
– michal.h21
yesterday
i've added an MWE
– Jonas
yesterday
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm working on an ebook and i'd like to have a list of figures/tables at the end of every chapter and only for that chapter (so just like minilot and minilof, but unfortunately minitoc doesn't work with tex4ht). The config.cfg for the TOC looks like this so far:
letorigincludegraphicsincludegraphics
Preamble{xhtml,pic-tabular}
TocAt{chapter,section,subsection}
Configure{tableofcontents*}{chapter,section}
Configure{NavSection}{%
booltrue{tocnoempty}
HCode{<li>}}{HCode{<ol>Hnewline}}{}{Tg</ol>Tg</li>}
Css{nav#toc ol{list-style: none;}}
begin{document}
CssFile[custom.css]
/* css.sty */
EndCssFile
Configure{CoverMimeType}{image/jpg}
DeclareGraphicsExtensions{.eps,.png,.jpg,.gif,}
EndPreamble
MWE:
documentclass{book}
usepackage{mwe}
ifdefinedHCode
else
usepackage[nohints]{minitoc}
mtcselectlanguage{german}
mtcsettitle{minitoc}{}
mtcsettitle{minilof}{}
mtcsettitle{minilot}{}
mtcsetfeature{minitoc}{open}{vspace{1cm}}
nomtcrule
nomlfrule
nomltrule
tightmtctrue
fi
begin{document}
ifdefinedHCode
else
dominitoc
dominilof
dominilot
doparttoc
fakelistoffigures
fakelistoftables
tableofcontents
fi
chapter{chapter 1}
ifdefinedHCode
else
minitoc
fi
section{Table}
begin{table}[ht!]
centering
caption{a table}
label{a table}
begin{tabular}{ll}
test & test
end{tabular}
end{table}
section{LOT}
ifdefinedHCode
%here i'd like to have a list of tables for the ebook as well
else
minilot
fi
end{document}
Is there a way to accomplish what i described above?
table-of-contents tex4ht
I'm working on an ebook and i'd like to have a list of figures/tables at the end of every chapter and only for that chapter (so just like minilot and minilof, but unfortunately minitoc doesn't work with tex4ht). The config.cfg for the TOC looks like this so far:
letorigincludegraphicsincludegraphics
Preamble{xhtml,pic-tabular}
TocAt{chapter,section,subsection}
Configure{tableofcontents*}{chapter,section}
Configure{NavSection}{%
booltrue{tocnoempty}
HCode{<li>}}{HCode{<ol>Hnewline}}{}{Tg</ol>Tg</li>}
Css{nav#toc ol{list-style: none;}}
begin{document}
CssFile[custom.css]
/* css.sty */
EndCssFile
Configure{CoverMimeType}{image/jpg}
DeclareGraphicsExtensions{.eps,.png,.jpg,.gif,}
EndPreamble
MWE:
documentclass{book}
usepackage{mwe}
ifdefinedHCode
else
usepackage[nohints]{minitoc}
mtcselectlanguage{german}
mtcsettitle{minitoc}{}
mtcsettitle{minilof}{}
mtcsettitle{minilot}{}
mtcsetfeature{minitoc}{open}{vspace{1cm}}
nomtcrule
nomlfrule
nomltrule
tightmtctrue
fi
begin{document}
ifdefinedHCode
else
dominitoc
dominilof
dominilot
doparttoc
fakelistoffigures
fakelistoftables
tableofcontents
fi
chapter{chapter 1}
ifdefinedHCode
else
minitoc
fi
section{Table}
begin{table}[ht!]
centering
caption{a table}
label{a table}
begin{tabular}{ll}
test & test
end{tabular}
end{table}
section{LOT}
ifdefinedHCode
%here i'd like to have a list of tables for the ebook as well
else
minilot
fi
end{document}
Is there a way to accomplish what i described above?
table-of-contents tex4ht
table-of-contents tex4ht
edited yesterday
asked yesterday
Jonas
764
764
Could you also post a TeX sample?
– michal.h21
yesterday
i've added an MWE
– Jonas
yesterday
add a comment |
Could you also post a TeX sample?
– michal.h21
yesterday
i've added an MWE
– Jonas
yesterday
Could you also post a TeX sample?
– michal.h21
yesterday
Could you also post a TeX sample?
– michal.h21
yesterday
i've added an MWE
– Jonas
yesterday
i've added an MWE
– Jonas
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
The issue with the minitoc package is that it redefines lot of internal LaTeX commands, which interferes with tex4ht, which redefines them as well. In particular, it seems that table and figure information isn't saved. Fortunately, it works if the information had been saved in the normal LaTeX run. So before tex4ebook compile the document with normal LaTeX when tables or figures changed.
There is also one more issue.minilot and minilof commands use tabular environment internally and it causes a problem because you use the pic-tabular option, which instructs tex4ht to convert tables to images. To fix this, we need to provide alternative version of these commands, which don't use tabular. They also don't use spacing and page breaking commands that were originally uses, as these don't have any sense in the HTML code. It is generally better to just add some code to the commands redefined by tex4ht, but in this case we need to alter them heavily, as the original definition causes too much trouble.
Save this code as minitoc.4ht:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% minitoc.4ht 2009-05-21-09:32 %
% Copyright (C) 1997--2009 Eitan M. Gurari %
% %
% 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".%
% %
% This Current Maintainer of this work %
% is Eitan M. Gurari. %
% %
% If you modify this program your changing its signature %
% with a directive of the following form will be %
% appreciated. %
% message{signature} %
% %
% gurari@cse.ohio-state.edu %
% http://www.cse.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
immediatewrite-1{version 2009-05-21-09:32}
NewConfigure{minitoc}{4}
NewConfigure{parttoc}{4}
NewConfigure{secttoc}{4}
NewConfigure{minilof}{4}
NewConfigure{partlof}{4}
NewConfigure{sectlof}{4}
NewConfigure{minilot}{4}
NewConfigure{partlot}{4}
NewConfigure{sectlot}{4}
letminitoc:minitoc@
defminitoc@[#1]{%
a:minitoc@
minitoc:[#1]
b:minitoc@
}
NewConfigure{minitoc@}{2}
defminilot@[#1]{%
global@minilot@used@true
if@mtc@longext@%
def@tocfile{mltThe@mtc}%
else
def@tocfile{TThe@mtc}%
fi
mtc@CkFile{jobname.@tocfile}
if@mtc@FE
mtcPackageInfo[I0006]{minitoc}%
{jobname.@tocfilespace is empty}
@mtc@empty@minilot@true
else
beforeminilot
begingroup
makeatletter
@ifundefined{mlt@pgno}%
{let@dottedtocline@undottedtocline}{}
@fileswfalsemtc@hook@beforeinputfile
mlt@setform
globalopenminilotinminilottrue
@input{jobname.@tocfile}%
globalinminilotfalsecloseminilot
global@nobreakfalseendgroup
parafterminilotfi}%
NewConfigure{minilot@}{2}
letminilot:minilot@
defminilot@[#1]{%
a:minilot@
minilot:[#1]
b:minilot@
}
defminilof@[#1]{%
global@minilof@used@true
if@mtc@longext@%
def@tocfile{mlfThe@mtc}%
else
def@tocfile{FThe@mtc}%
fi
mtc@CkFile{jobname.@tocfile}
if@mtc@FE
mtcPackageInfo[I0006]{minitoc}%
{jobname.@tocfilespace is empty}
@mtc@empty@minilof@true
else
beforeminilof
begingroup
makeatletter
@ifundefined{mlf@pgno}%
{let@dottedtocline@undottedtocline}{}
@fileswfalsemtc@hook@beforeinputfile
mlf@setform
globalopenminilofinminiloftrue
@input{jobname.@tocfile}%
globalinminiloffalsecloseminilof
leavevmodemtc@strut
global@nobreakfalseendgroup
parafterminiloffi}%
Hinput{minitoc}
endinput
The TeX file doesn't need all the conditional code, just disable the tableofcontents, which is handled by tex4ebook:
documentclass{book}
usepackage{mwe}
usepackage[nohints]{minitoc}
mtcselectlanguage{german}
mtcsettitle{minitoc}{}
mtcsettitle{minilof}{}
mtcsettitle{minilot}{}
mtcsetfeature{minitoc}{open}{vspace{1cm}}
nomtcrule
nomlfrule
nomltrule
tightmtctrue
begin{document}
dominitoc
dominilof
dominilot
doparttoc
fakelistoffigures
fakelistoftables
ifdefinedHCodeelse
tableofcontents
fi
chapter{chapter 1}
minitoc
section{Table}
begin{table}[ht!]
centering
caption{a table}
label{a table}
begin{tabular}{ll}
test & test
end{tabular}
end{table}
begin{figure}
caption{Sample figure}
end{figure}
section{LOT}
minilot
section{LOF}
minilof
end{document}
The minitoc can be disabled in the .cfg file, just redefine it to relax:
letminitocrelax
This is the result:

add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
The issue with the minitoc package is that it redefines lot of internal LaTeX commands, which interferes with tex4ht, which redefines them as well. In particular, it seems that table and figure information isn't saved. Fortunately, it works if the information had been saved in the normal LaTeX run. So before tex4ebook compile the document with normal LaTeX when tables or figures changed.
There is also one more issue.minilot and minilof commands use tabular environment internally and it causes a problem because you use the pic-tabular option, which instructs tex4ht to convert tables to images. To fix this, we need to provide alternative version of these commands, which don't use tabular. They also don't use spacing and page breaking commands that were originally uses, as these don't have any sense in the HTML code. It is generally better to just add some code to the commands redefined by tex4ht, but in this case we need to alter them heavily, as the original definition causes too much trouble.
Save this code as minitoc.4ht:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% minitoc.4ht 2009-05-21-09:32 %
% Copyright (C) 1997--2009 Eitan M. Gurari %
% %
% 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".%
% %
% This Current Maintainer of this work %
% is Eitan M. Gurari. %
% %
% If you modify this program your changing its signature %
% with a directive of the following form will be %
% appreciated. %
% message{signature} %
% %
% gurari@cse.ohio-state.edu %
% http://www.cse.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
immediatewrite-1{version 2009-05-21-09:32}
NewConfigure{minitoc}{4}
NewConfigure{parttoc}{4}
NewConfigure{secttoc}{4}
NewConfigure{minilof}{4}
NewConfigure{partlof}{4}
NewConfigure{sectlof}{4}
NewConfigure{minilot}{4}
NewConfigure{partlot}{4}
NewConfigure{sectlot}{4}
letminitoc:minitoc@
defminitoc@[#1]{%
a:minitoc@
minitoc:[#1]
b:minitoc@
}
NewConfigure{minitoc@}{2}
defminilot@[#1]{%
global@minilot@used@true
if@mtc@longext@%
def@tocfile{mltThe@mtc}%
else
def@tocfile{TThe@mtc}%
fi
mtc@CkFile{jobname.@tocfile}
if@mtc@FE
mtcPackageInfo[I0006]{minitoc}%
{jobname.@tocfilespace is empty}
@mtc@empty@minilot@true
else
beforeminilot
begingroup
makeatletter
@ifundefined{mlt@pgno}%
{let@dottedtocline@undottedtocline}{}
@fileswfalsemtc@hook@beforeinputfile
mlt@setform
globalopenminilotinminilottrue
@input{jobname.@tocfile}%
globalinminilotfalsecloseminilot
global@nobreakfalseendgroup
parafterminilotfi}%
NewConfigure{minilot@}{2}
letminilot:minilot@
defminilot@[#1]{%
a:minilot@
minilot:[#1]
b:minilot@
}
defminilof@[#1]{%
global@minilof@used@true
if@mtc@longext@%
def@tocfile{mlfThe@mtc}%
else
def@tocfile{FThe@mtc}%
fi
mtc@CkFile{jobname.@tocfile}
if@mtc@FE
mtcPackageInfo[I0006]{minitoc}%
{jobname.@tocfilespace is empty}
@mtc@empty@minilof@true
else
beforeminilof
begingroup
makeatletter
@ifundefined{mlf@pgno}%
{let@dottedtocline@undottedtocline}{}
@fileswfalsemtc@hook@beforeinputfile
mlf@setform
globalopenminilofinminiloftrue
@input{jobname.@tocfile}%
globalinminiloffalsecloseminilof
leavevmodemtc@strut
global@nobreakfalseendgroup
parafterminiloffi}%
Hinput{minitoc}
endinput
The TeX file doesn't need all the conditional code, just disable the tableofcontents, which is handled by tex4ebook:
documentclass{book}
usepackage{mwe}
usepackage[nohints]{minitoc}
mtcselectlanguage{german}
mtcsettitle{minitoc}{}
mtcsettitle{minilof}{}
mtcsettitle{minilot}{}
mtcsetfeature{minitoc}{open}{vspace{1cm}}
nomtcrule
nomlfrule
nomltrule
tightmtctrue
begin{document}
dominitoc
dominilof
dominilot
doparttoc
fakelistoffigures
fakelistoftables
ifdefinedHCodeelse
tableofcontents
fi
chapter{chapter 1}
minitoc
section{Table}
begin{table}[ht!]
centering
caption{a table}
label{a table}
begin{tabular}{ll}
test & test
end{tabular}
end{table}
begin{figure}
caption{Sample figure}
end{figure}
section{LOT}
minilot
section{LOF}
minilof
end{document}
The minitoc can be disabled in the .cfg file, just redefine it to relax:
letminitocrelax
This is the result:

add a comment |
up vote
1
down vote
The issue with the minitoc package is that it redefines lot of internal LaTeX commands, which interferes with tex4ht, which redefines them as well. In particular, it seems that table and figure information isn't saved. Fortunately, it works if the information had been saved in the normal LaTeX run. So before tex4ebook compile the document with normal LaTeX when tables or figures changed.
There is also one more issue.minilot and minilof commands use tabular environment internally and it causes a problem because you use the pic-tabular option, which instructs tex4ht to convert tables to images. To fix this, we need to provide alternative version of these commands, which don't use tabular. They also don't use spacing and page breaking commands that were originally uses, as these don't have any sense in the HTML code. It is generally better to just add some code to the commands redefined by tex4ht, but in this case we need to alter them heavily, as the original definition causes too much trouble.
Save this code as minitoc.4ht:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% minitoc.4ht 2009-05-21-09:32 %
% Copyright (C) 1997--2009 Eitan M. Gurari %
% %
% 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".%
% %
% This Current Maintainer of this work %
% is Eitan M. Gurari. %
% %
% If you modify this program your changing its signature %
% with a directive of the following form will be %
% appreciated. %
% message{signature} %
% %
% gurari@cse.ohio-state.edu %
% http://www.cse.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
immediatewrite-1{version 2009-05-21-09:32}
NewConfigure{minitoc}{4}
NewConfigure{parttoc}{4}
NewConfigure{secttoc}{4}
NewConfigure{minilof}{4}
NewConfigure{partlof}{4}
NewConfigure{sectlof}{4}
NewConfigure{minilot}{4}
NewConfigure{partlot}{4}
NewConfigure{sectlot}{4}
letminitoc:minitoc@
defminitoc@[#1]{%
a:minitoc@
minitoc:[#1]
b:minitoc@
}
NewConfigure{minitoc@}{2}
defminilot@[#1]{%
global@minilot@used@true
if@mtc@longext@%
def@tocfile{mltThe@mtc}%
else
def@tocfile{TThe@mtc}%
fi
mtc@CkFile{jobname.@tocfile}
if@mtc@FE
mtcPackageInfo[I0006]{minitoc}%
{jobname.@tocfilespace is empty}
@mtc@empty@minilot@true
else
beforeminilot
begingroup
makeatletter
@ifundefined{mlt@pgno}%
{let@dottedtocline@undottedtocline}{}
@fileswfalsemtc@hook@beforeinputfile
mlt@setform
globalopenminilotinminilottrue
@input{jobname.@tocfile}%
globalinminilotfalsecloseminilot
global@nobreakfalseendgroup
parafterminilotfi}%
NewConfigure{minilot@}{2}
letminilot:minilot@
defminilot@[#1]{%
a:minilot@
minilot:[#1]
b:minilot@
}
defminilof@[#1]{%
global@minilof@used@true
if@mtc@longext@%
def@tocfile{mlfThe@mtc}%
else
def@tocfile{FThe@mtc}%
fi
mtc@CkFile{jobname.@tocfile}
if@mtc@FE
mtcPackageInfo[I0006]{minitoc}%
{jobname.@tocfilespace is empty}
@mtc@empty@minilof@true
else
beforeminilof
begingroup
makeatletter
@ifundefined{mlf@pgno}%
{let@dottedtocline@undottedtocline}{}
@fileswfalsemtc@hook@beforeinputfile
mlf@setform
globalopenminilofinminiloftrue
@input{jobname.@tocfile}%
globalinminiloffalsecloseminilof
leavevmodemtc@strut
global@nobreakfalseendgroup
parafterminiloffi}%
Hinput{minitoc}
endinput
The TeX file doesn't need all the conditional code, just disable the tableofcontents, which is handled by tex4ebook:
documentclass{book}
usepackage{mwe}
usepackage[nohints]{minitoc}
mtcselectlanguage{german}
mtcsettitle{minitoc}{}
mtcsettitle{minilof}{}
mtcsettitle{minilot}{}
mtcsetfeature{minitoc}{open}{vspace{1cm}}
nomtcrule
nomlfrule
nomltrule
tightmtctrue
begin{document}
dominitoc
dominilof
dominilot
doparttoc
fakelistoffigures
fakelistoftables
ifdefinedHCodeelse
tableofcontents
fi
chapter{chapter 1}
minitoc
section{Table}
begin{table}[ht!]
centering
caption{a table}
label{a table}
begin{tabular}{ll}
test & test
end{tabular}
end{table}
begin{figure}
caption{Sample figure}
end{figure}
section{LOT}
minilot
section{LOF}
minilof
end{document}
The minitoc can be disabled in the .cfg file, just redefine it to relax:
letminitocrelax
This is the result:

add a comment |
up vote
1
down vote
up vote
1
down vote
The issue with the minitoc package is that it redefines lot of internal LaTeX commands, which interferes with tex4ht, which redefines them as well. In particular, it seems that table and figure information isn't saved. Fortunately, it works if the information had been saved in the normal LaTeX run. So before tex4ebook compile the document with normal LaTeX when tables or figures changed.
There is also one more issue.minilot and minilof commands use tabular environment internally and it causes a problem because you use the pic-tabular option, which instructs tex4ht to convert tables to images. To fix this, we need to provide alternative version of these commands, which don't use tabular. They also don't use spacing and page breaking commands that were originally uses, as these don't have any sense in the HTML code. It is generally better to just add some code to the commands redefined by tex4ht, but in this case we need to alter them heavily, as the original definition causes too much trouble.
Save this code as minitoc.4ht:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% minitoc.4ht 2009-05-21-09:32 %
% Copyright (C) 1997--2009 Eitan M. Gurari %
% %
% 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".%
% %
% This Current Maintainer of this work %
% is Eitan M. Gurari. %
% %
% If you modify this program your changing its signature %
% with a directive of the following form will be %
% appreciated. %
% message{signature} %
% %
% gurari@cse.ohio-state.edu %
% http://www.cse.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
immediatewrite-1{version 2009-05-21-09:32}
NewConfigure{minitoc}{4}
NewConfigure{parttoc}{4}
NewConfigure{secttoc}{4}
NewConfigure{minilof}{4}
NewConfigure{partlof}{4}
NewConfigure{sectlof}{4}
NewConfigure{minilot}{4}
NewConfigure{partlot}{4}
NewConfigure{sectlot}{4}
letminitoc:minitoc@
defminitoc@[#1]{%
a:minitoc@
minitoc:[#1]
b:minitoc@
}
NewConfigure{minitoc@}{2}
defminilot@[#1]{%
global@minilot@used@true
if@mtc@longext@%
def@tocfile{mltThe@mtc}%
else
def@tocfile{TThe@mtc}%
fi
mtc@CkFile{jobname.@tocfile}
if@mtc@FE
mtcPackageInfo[I0006]{minitoc}%
{jobname.@tocfilespace is empty}
@mtc@empty@minilot@true
else
beforeminilot
begingroup
makeatletter
@ifundefined{mlt@pgno}%
{let@dottedtocline@undottedtocline}{}
@fileswfalsemtc@hook@beforeinputfile
mlt@setform
globalopenminilotinminilottrue
@input{jobname.@tocfile}%
globalinminilotfalsecloseminilot
global@nobreakfalseendgroup
parafterminilotfi}%
NewConfigure{minilot@}{2}
letminilot:minilot@
defminilot@[#1]{%
a:minilot@
minilot:[#1]
b:minilot@
}
defminilof@[#1]{%
global@minilof@used@true
if@mtc@longext@%
def@tocfile{mlfThe@mtc}%
else
def@tocfile{FThe@mtc}%
fi
mtc@CkFile{jobname.@tocfile}
if@mtc@FE
mtcPackageInfo[I0006]{minitoc}%
{jobname.@tocfilespace is empty}
@mtc@empty@minilof@true
else
beforeminilof
begingroup
makeatletter
@ifundefined{mlf@pgno}%
{let@dottedtocline@undottedtocline}{}
@fileswfalsemtc@hook@beforeinputfile
mlf@setform
globalopenminilofinminiloftrue
@input{jobname.@tocfile}%
globalinminiloffalsecloseminilof
leavevmodemtc@strut
global@nobreakfalseendgroup
parafterminiloffi}%
Hinput{minitoc}
endinput
The TeX file doesn't need all the conditional code, just disable the tableofcontents, which is handled by tex4ebook:
documentclass{book}
usepackage{mwe}
usepackage[nohints]{minitoc}
mtcselectlanguage{german}
mtcsettitle{minitoc}{}
mtcsettitle{minilof}{}
mtcsettitle{minilot}{}
mtcsetfeature{minitoc}{open}{vspace{1cm}}
nomtcrule
nomlfrule
nomltrule
tightmtctrue
begin{document}
dominitoc
dominilof
dominilot
doparttoc
fakelistoffigures
fakelistoftables
ifdefinedHCodeelse
tableofcontents
fi
chapter{chapter 1}
minitoc
section{Table}
begin{table}[ht!]
centering
caption{a table}
label{a table}
begin{tabular}{ll}
test & test
end{tabular}
end{table}
begin{figure}
caption{Sample figure}
end{figure}
section{LOT}
minilot
section{LOF}
minilof
end{document}
The minitoc can be disabled in the .cfg file, just redefine it to relax:
letminitocrelax
This is the result:

The issue with the minitoc package is that it redefines lot of internal LaTeX commands, which interferes with tex4ht, which redefines them as well. In particular, it seems that table and figure information isn't saved. Fortunately, it works if the information had been saved in the normal LaTeX run. So before tex4ebook compile the document with normal LaTeX when tables or figures changed.
There is also one more issue.minilot and minilof commands use tabular environment internally and it causes a problem because you use the pic-tabular option, which instructs tex4ht to convert tables to images. To fix this, we need to provide alternative version of these commands, which don't use tabular. They also don't use spacing and page breaking commands that were originally uses, as these don't have any sense in the HTML code. It is generally better to just add some code to the commands redefined by tex4ht, but in this case we need to alter them heavily, as the original definition causes too much trouble.
Save this code as minitoc.4ht:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% minitoc.4ht 2009-05-21-09:32 %
% Copyright (C) 1997--2009 Eitan M. Gurari %
% %
% 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".%
% %
% This Current Maintainer of this work %
% is Eitan M. Gurari. %
% %
% If you modify this program your changing its signature %
% with a directive of the following form will be %
% appreciated. %
% message{signature} %
% %
% gurari@cse.ohio-state.edu %
% http://www.cse.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
immediatewrite-1{version 2009-05-21-09:32}
NewConfigure{minitoc}{4}
NewConfigure{parttoc}{4}
NewConfigure{secttoc}{4}
NewConfigure{minilof}{4}
NewConfigure{partlof}{4}
NewConfigure{sectlof}{4}
NewConfigure{minilot}{4}
NewConfigure{partlot}{4}
NewConfigure{sectlot}{4}
letminitoc:minitoc@
defminitoc@[#1]{%
a:minitoc@
minitoc:[#1]
b:minitoc@
}
NewConfigure{minitoc@}{2}
defminilot@[#1]{%
global@minilot@used@true
if@mtc@longext@%
def@tocfile{mltThe@mtc}%
else
def@tocfile{TThe@mtc}%
fi
mtc@CkFile{jobname.@tocfile}
if@mtc@FE
mtcPackageInfo[I0006]{minitoc}%
{jobname.@tocfilespace is empty}
@mtc@empty@minilot@true
else
beforeminilot
begingroup
makeatletter
@ifundefined{mlt@pgno}%
{let@dottedtocline@undottedtocline}{}
@fileswfalsemtc@hook@beforeinputfile
mlt@setform
globalopenminilotinminilottrue
@input{jobname.@tocfile}%
globalinminilotfalsecloseminilot
global@nobreakfalseendgroup
parafterminilotfi}%
NewConfigure{minilot@}{2}
letminilot:minilot@
defminilot@[#1]{%
a:minilot@
minilot:[#1]
b:minilot@
}
defminilof@[#1]{%
global@minilof@used@true
if@mtc@longext@%
def@tocfile{mlfThe@mtc}%
else
def@tocfile{FThe@mtc}%
fi
mtc@CkFile{jobname.@tocfile}
if@mtc@FE
mtcPackageInfo[I0006]{minitoc}%
{jobname.@tocfilespace is empty}
@mtc@empty@minilof@true
else
beforeminilof
begingroup
makeatletter
@ifundefined{mlf@pgno}%
{let@dottedtocline@undottedtocline}{}
@fileswfalsemtc@hook@beforeinputfile
mlf@setform
globalopenminilofinminiloftrue
@input{jobname.@tocfile}%
globalinminiloffalsecloseminilof
leavevmodemtc@strut
global@nobreakfalseendgroup
parafterminiloffi}%
Hinput{minitoc}
endinput
The TeX file doesn't need all the conditional code, just disable the tableofcontents, which is handled by tex4ebook:
documentclass{book}
usepackage{mwe}
usepackage[nohints]{minitoc}
mtcselectlanguage{german}
mtcsettitle{minitoc}{}
mtcsettitle{minilof}{}
mtcsettitle{minilot}{}
mtcsetfeature{minitoc}{open}{vspace{1cm}}
nomtcrule
nomlfrule
nomltrule
tightmtctrue
begin{document}
dominitoc
dominilof
dominilot
doparttoc
fakelistoffigures
fakelistoftables
ifdefinedHCodeelse
tableofcontents
fi
chapter{chapter 1}
minitoc
section{Table}
begin{table}[ht!]
centering
caption{a table}
label{a table}
begin{tabular}{ll}
test & test
end{tabular}
end{table}
begin{figure}
caption{Sample figure}
end{figure}
section{LOT}
minilot
section{LOF}
minilof
end{document}
The minitoc can be disabled in the .cfg file, just redefine it to relax:
letminitocrelax
This is the result:

answered yesterday
michal.h21
28.7k445103
28.7k445103
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461284%2fminilot-and-minilof-with-tex4ht%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you also post a TeX sample?
– michal.h21
yesterday
i've added an MWE
– Jonas
yesterday