-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Referring to other packages when using tcolorbox/documentation #290
Comments
Nice extension! Just to remind that for some LaTeX packages ( |
Thanks :) Perhaps an optional argument: \documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{documentation}
\makeatletter
\NewDocumentCommand \refPkg { o m } {%
\IfValueTF{#1}{%
\href{https://ctan.org/pkg/#1}%
}{%
\href{https://ctan.org/pkg/#2}%
}{%
\refAux{#2}%
\kvtcb@doc@format@page{{\fontfamily{pzd}\fontencoding{U}\fontseries{m}\fontshape{n}\selectfont\char213}% from tcbdocumentation.code.tex line 915
\,CTAN}%
}%
}
\makeatother
\begin{document}
The box can be further configured via \docAuxCommand*{tcbset} as per the \refPkg{tcolorbox} documentation.
Linking to a .sty file in a differently named CTAN distribution: \refPkg[preprint]{fullpage}.
\end{document} e: oh, I guess this one actually has ctan pages for the sub-packages (picked it randomly from the json doc): https://ctan.org/pkg/fullpage |
Tip: In
so the definition of \makeatletter
\NewDocumentCommand \refPkg { O{#2} m } {%
\href{https://ctan.org/pkg/#1}%
{%
\refAux{#2}%
\kvtcb@doc@format@page{{\fontfamily{pzd}\fontencoding{U}\fontseries{m}\fontshape{n}\selectfont\char213}% from tcbdocumentation.code.tex line 915
\,CTAN}%
}%
}
\makeatother |
Oh nice, that's good to know! |
I like this addition very much and I will integrate it as is into the next version. Thank you 👍 |
Thanks to you as well, looking forward to it :) |
It seems to me that the "CTAN" in small size (in Computer Modern/Latin Modern Roman) doesn't look very well (see for instance #302 (comment)), maybe Example used to produce the screenshot above
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{documentation}
\hypersetup{colorlinks}
\makeatletter
\RenewDocumentCommand \refPkg { O{#2} m } {%
\href{https://ctan.org/pkg/#1}%
{%
\refAux{#2}%
\kvtcb@doc@format@page{{\fontfamily{pzd}\fontencoding{U}\fontseries{m}\fontshape{n}\selectfont\char213}%
\,\formatCTAN{CTAN}}%
}%
}
\makeatother
\NewDocumentCommand{\formatCTAN}{m}{#1}
\begin{document}
rmfamily \refPkg{tcolorbox}
\let\formatCTAN=\texttt
ttfamily \refPkg{tcolorbox}
\let\formatCTAN=\textsf
sffamily \refPkg{tcolorbox}
\end{document} |
@muzimuzhi I guess it is in small caps, not in small size. |
@dbitouze It's controlled by |
I'm writing docs for one of my packages & have found a need to refer to other packages. I don't see a standard way of doing this in the
tcolorbox
documentation section, so I cooked up the below by copying the reference format fromtcbdocumentation.code.tex
line 915. Perhaps others find it useful:Example usage:
The box can be further configured via \docAuxCommand*{tcbset} as per the \refPkg{tcolorbox} documentation.
will create a href pointing to https://ctan.org/pkg/tcolorbox that looks like this:The text was updated successfully, but these errors were encountered: