doc
当我使用更改历史记录中的页码创建文档时,它们会变成超链接。当我使用tcolorbox
的documentation
库时不会发生这种情况。有没有办法使用 的库将页码变成超链接tcolorbox
?documentation
我尝试了文档中的各种选项和设置tcolorbox
,但到目前为止没有任何效果。
我可以轻松地在更改历史记录条目中使用的文本中放置超链接,但我更喜欢超链接的页码。
这是我的工作(除了上面描述的问题)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
答案1
我不喜欢回答自己的问题,但在这种情况下我决定这样做。正如@muzimuzhi所说,解决方案是加载hypdoc
。我正在寻找一种完成任务的方法,不会引发hypdoc
有关加载的警告问题,hyperref
但显然还没有办法做到这一点。