1

the question results from this thread minilot and minilof with tex4ht . when compiling with tex4ebook, there seems to be a problem with the hyperref package when generating the minilot and minilof:

enter image description here

MWE:

\documentclass{book}

\usepackage{mwe}

\usepackage[ngerman]{babel}


\usepackage{hyperref}
\hypersetup{%
    linktocpage=true,
    breaklinks=true,
    colorlinks=true,
    citecolor=black,
    linkcolor=black,
    urlcolor=black,
    pdfpagemode=UseThumbs,
    pdftitle={thetitle},
    pdfauthor={theAuthor},  
    pdfsubject={thetitle}, 
    pdfkeywords={thekeywords},
}

\makeatletter
\g@addto@macro\UrlBreaks{\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i%
\do\j\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w%
\do\x\do\y\do\z\do\&\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9\do\0}
\def\do@url@hyp{\do\-}
\makeatother

\addto\extrasngerman{
\def\subsectionautorefname{Kap.}
\def\figureautorefname{Abb.}
\def\tableautorefname{Tab.}
\def\chapterautorefname{Kap.}
\def\sectionautorefname{Kap.}
\def\subsectionautorefname{Kap.}
}

\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
    \ifdefined\HCode\else
      \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{table}[ht!]
    \centering
    \caption{a table2}
    \label{a table}
    \begin{tabular}{ll}
    test & test
    \end{tabular}
\end{table}

\begin{table}[ht!]
    \centering
    \caption{a table3}
    \label{a table}
    \begin{tabular}{ll}
    test & test
    \end{tabular}
\end{table}

\begin{figure}
  \caption{Sample figure}
\end{figure}

\begin{figure}
  \caption{Sample figure2}
\end{figure}

\begin{figure}
  \caption{Sample figure3}
\end{figure}

\section{LOT}
\minilot

\section{LOF}
\minilof

\end{document} 

if i uncomment the package, i get an error when compiling with pdflatex cause of several bib-files needing the package. is there a way to make hyperref work with tex4ebook/minitoc or do you have an idea of a workaround?

  • Do you get some compilation error? It compiles without errors for me. – michal.h21 Feb 2 at 19:39
  • sorry, forgot to mention the problem.. it does compile for me, but the list of tables and list of figures seem to get messed up a bit, as you can see in the attached graphic. In front of every entry there's "table 1.1, table1.2 ..." – Jonas Feb 5 at 12:06
  • ah, I see. I will look at that soon – michal.h21 Feb 5 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.