When I create documentation using doc
the page numbers in my Change History become hyperlinks. That doesn't happen when I use tcolorbox
's documentation
library. Is there a way to get page numbers to become hyperlinks using tcolorbox
's documentation
library? I have experimented with various options and settings in the tcolorbox
documentation and thus far nothing has worked.
I can easily place hyperlinks in the text I use in the change history entries, but I would prefer hyperlinked page numbers.
Here is my working (except for the issue described above) MWE:
% \iffalse meta-comment
% !TEX program = lualatexmk
% \fi
%
% \iffalse
%
%<*internal>
\iffalse
%</internal>
%
%<*internal>
\fi
\def\nameofplainTeX{plain}
\ifx\fmtname\nameofplainTeX\else
\expandafter\begingroup
\fi
%</internal>
%
%<*install>
\input docstrip.tex
\keepsilent
\askforoverwritefalse
\usedir{tex/latex/sample}
\preamble
PREAMBLE
\endpreamble
\generate{\file{\jobname.sty}{\from{\jobname.dtx}{package}}}
%</install>
%<install>\endbatchfile
%
%<*internal>
\usedir{tex/latex/sample}
\generate{\file{\jobname.sty}{\from{\jobname.dtx}{package}}}
\ifx\fmtname\nameofplainTeX
\expandafter\endbatchfile
\else
\expandafter\endgroup
\fi
%</internal>
%
%<*driver>
\documentclass[10pt,letterpaper,nohyperref]{ltxdoc} % let tcolorbox load hyperref
%\documentclass[10pt,letterpaper]{article}
\SetupDoc{reportchangedates}
\usepackage{\jobname}
\PassOptionsToPackage{listings,documentation}{tcolorbox}
\usepackage[listings,documentation]{tcolorbox}
\hypersetup{colorlinks=true}
\tcbset{%
%index format = doc,%
index german settings,%
index gather none,%
}%
\usepackage[left = 1.00in,%
right = 1.00in,%
marginparwidth = 0.70in]{geometry}
\newcommand*{\pkg}{\textsf}
\newcommand*{\sample}{\pkg{sample}}
%\OnlyDescription
\DisableCrossrefs
\PageIndex
\CodelineNumbered
\RecordChanges
\begin{document}
\DocInput{\jobname.dtx}
\newpage
\PrintIndex
\PrintChanges
\end{document}
%</driver>
% \fi
%
% \IndexPrologue{\section{Index}Page numbers refer to page where the
% corresponding entry is documented and/or referenced.}
% \GlossaryPrologue{\section{Change History}}
%
% \changes{v1.0.0}{2022-07-03}{Initial release}
% \newgeometry{left=1.50in,right=1.00in,top=0.50in,bottom=0.50in}
% \section{Introduction}
% The \sample{} package is silly and does absolutely nothing useful.
%
% \subsection{Nothing Much}
% There's not much to say here.
%
% \subsection{The first command}
%\iffalse
%<*example>
%\fi
\begin{docCommand}{sampleversion}{}
Typesets the current version and build date.
\end{docCommand}
\begin{dispExample*}{sidebyside = false}
The version is \sampleversion{} and is a stable build.
\end{dispExample*}
%\iffalse
%</example>
%\fi
%
% \restoregeometry
% \MaybeStop{}
%
% \newgeometry{left=1.50in,right=0.50in,top=1.00in,bottom=1.00in}
% \section{\sample\ Source Code}
% This is the complete source code to the \sample{} package.
%
% \iffalse ^^A comment out to typeset the guard; put inside macrocode to typeset
% \begin{macrocode}
%<*package>
% \end{macrocode}
% \fi
%
% \begin{macrocode}
\def\sample@version{1.0.0}
\def\sample@date{2022-07-03}
\NeedsTeXFormat{LaTeX2e}[2020-02-02]
\DeclareRelease{v1.0.0}{2022-07-03}{sample.sty}
\DeclareCurrentRelease{v\sample@version}{\sample@date}
\ProvidesPackage{sample}
[\sample@date\space v\sample@version\space A silly sample]
% \end{macrocode}
%
% Define a convenient package version command.
% \changes{v1.0.0}{2022-07-03}{Added a macro}
% \begin{macrocode}
\newcommand*{\sampleversion}{v\sample@version\space dated \sample@date}
% \end{macrocode}
%
% \begin{macrocode}
\RequirePackage{iftex} % needed for requiring LuaLaTeX
\RequirePackage{unicode-math} % needed for Unicode support
\RequireLuaTeX % require this engine
% \end{macrocode}
%
% \iffalse ^^A comment out to typeset the guard; put inside macrocode to typeset
% \begin{macrocode}
%</package>
% \end{macrocode}
% \fi
% \restoregeometry
% \Finale
nohyperref
fromltxdoc
is not feasible, then you need to manually loadhypdoc
package.