Use case: an HTML version of a developer guide written in LaTeX and knowledge base articles in HTML which should be able to link to a certain section, figure, code snippet, ... in the HTML version of the developer guide.
When the developer guide gets updated (e.g. a new section is inserted), the links in the knowledge base articles should still point to the correct entry.
To be more concrete, consider the following input
\documentclass{book}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{First}\label{sec:first}
A first section \autoref{sec:first}.
\section{Second}\label{sec:second}
A second section \autoref{sec:second}.
\end{document}
Converting this to HTML using the htlatex test.tex "xhtml,3,frames"
command results in files:
- First section: testse1.html
- Second section: testse2.html
If I now insert a section
\documentclass{book}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{First}\label{sec:first}
A first section \autoref{sec:first}.
\section{Inserted}\label{sec:inserted}
An inserted section \autoref{sec:inserted}
\section{Second}\label{sec:second}
A second section \autoref{sec:second}.
\end{document}
and process that again using the same command, the file testse2.html
suddenly contains the "Inserted" section and no longer the "Second" section. Links to the "Second" section must suddenly point to testse3.html
.
This problem not only applies to pages, but also to anchors in existing pages (e.g. to link to a specific figure or code snippet).
- Is there a way to configure the file name to match e.g. the
\label
which is used in the source file - Is there a way to somehow dump some output with matches the generated files and anchors to the
\label
s used in the input files. I could then probably use this output to introduce intermediate links which can act as "permalink", or any other post-processing steps. - Is there another mechanism available to solve this problem ?