![有没有办法使用 tcolorbox 文档库获取更改历史记录中的超链接?](https://linux22.com/image/452171/%E6%9C%89%E6%B2%A1%E6%9C%89%E5%8A%9E%E6%B3%95%E4%BD%BF%E7%94%A8%20tcolorbox%20%E6%96%87%E6%A1%A3%E5%BA%93%E8%8E%B7%E5%8F%96%E6%9B%B4%E6%94%B9%E5%8E%86%E5%8F%B2%E8%AE%B0%E5%BD%95%E4%B8%AD%E7%9A%84%E8%B6%85%E9%93%BE%E6%8E%A5%EF%BC%9F.png)
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
但显然还没有办法做到这一点。