\NeedsTeXFormat{LaTeX2e}[1994/12/01] %% \newcommand* etc. \ProvidesPackage{texlinks}[2015/07/20 v0.83 TeX-related links (UL)] %% copyright (C) 2011 2012 2013 2015 Uwe Lueck, %% http://www.contact-ednotes.sty.de.vu %% -- author-maintained in the sense of LPPL below. %% %% This file can be redistributed and/or modified under %% the terms of the LaTeX Project Public License; either %% version 1.3c of the License, or any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% We did our best to help you, but there is NO WARRANTY. %% %% Please report bugs, problems, and suggestions via %% %% http://www.contact-ednotes.sty.de.vu %% %% === \cs{newlet} === %% 2013/01/21 %% |\newlet| is a guarded `\let': \providecommand*{\newlet}[2]{\@ifdefinable#1{\let#1#2}} %% %% == Links in General == %% 2012/12/15 %% === Outline === %% % Almost %% 2011/07/23 %% % all the %% including https 2011/08/27 %% The link macros of 'texlinks' are based on macros %% |\httpref| and |\httpsref|. For use of 'texlinks' with 'blog.sty', %% the latter provides definitions of `\httpref' and `\httpsref' %% suitable for \HTML, where a choice of opening a new %% tab or window---or not---is relevant. %% %% For use with 'hyperref' (or ...?), 'texlinks' may %% provide definitions of `\httpref' and `\httpsref' %% based on `\href'. The decision to do so or not may happen at %% `\begin{document}'. 'blog.sty' generates \HTML\ without %% using the `{document}' environment, so we might assume %% that when `\begin{document}' is found, we are running %% 'hyperref', or just \emph{something} that provides a %% useful `\href'. We might then execute a definition of %% `\httpref' in terms of `\href'. Well, not sure ... %% %% Moreover, a \acro{PDF} file with links may be \emph{printed}, %% and klicking the links on the paper may fail. %% \URL s in main text, on the other hand, sometimes are %% troublesome. I consider it a good idea to present %% links with their \URL\ as the displayed text in \emph{footnotes} %% (or endnotes). It may even be useful with \HTML\ to present %% the \URL s displayed in some %% %% 2011/01/27: %% rm. 2011/10/20 %% ``appendix."---This idea has been resumed in v0.2 only, |\urlfoot| %% (\secref{urlfoot}). %% 2012/12/15 %% % %% % I tend to introduce something for this ... and there might be a %% % package option forcing `\httpref' to use this style. %% % Well, better \emph{not today} ... [2011/01/24, TODO] %% %% === Package Options === %% \label{sec:opt} %% 2013/01/21 %% Somebody may want to suppress a definition of `\httpref' %% at `\begin{document}' ... [2011/01/24, TODO] %% %% 2011/02/10: %% %% v0.3: Package option |[blog]| suppresses \emph{any} %% `\AtBeginDocument' actions---fine for use with 'blog.sty'. \DeclareOption{blog}{\let\AtBeginDocument\@gobble} %% This option may be improved, and another option may be %% useful for different purposes than running 'blog.sty'. \ProcessOptions %% %% === Obvious Shorthands === %% |\htm|, |\html|, and |\pdf| for typical filename extensions %% save a few tokens in macro definitions (v0.83): \newcommand*{\htm}{.htm} \newcommand*{\html}{\htm l} %% 2012/12/08 below previously \newcommand*{\pdf}{.pdf} %% |\DoubleArg{}{}| (v0.83) works like %% \[`{}{}'\] %% It replaces `\@double@first@arg' from v0.8; %% it may also be useful as a user command. %% It differs from \LaTeX's `\@dblarg' that adds %% a missing optional argument: \newcommand*{\DoubleArg}[2]{#1{#2}{#2}} %% %% === Formatting \URL s and File/Package Names === %% %% <- was "Fonts for" 2013/02/20 %% \label{sec:fonts} %% 2012/12/19 %% %% ** Fonts for \URL s, File Names, and Package Names ** %% %% new 2011/10/19, TODO: `meansltx'? vgl. `makedoc.cfg' %% This section ``provides" markup for displaying \URL s (|\urlfmt|), %% file names (|\filenamefmt|---thinking of single files %% that may be found in the internet or on your computer---, %% and ``packages" (|\pkgnamefmt|). %% For the latter two, in certain files I use shorthands %% |\file| and |\pkg|, resp., ... %% `\providecommand' will be used so that the user may choose %% 2012/12/28 %% the style before loading 'texlinks'. %% (Once I may provide a variant of `\providecommand' %% 2012/12/28 %% that postpones the ``provision" to the ``beginning" of the %% ``document", even with 'blog.sty' TODO) %% %% It is usual to use %% the same font as with %% 2012/12/28 %% `\texttt' for formatting \TeX\ code %% (``verbatim", `\verb' etc.). It may also be common to use %% `\texttt' for file names, perhaps even for \URL s. %% Therefore we provide |\urlfmt{}| as follows: \providecommand*{\urlfmt}{\texttt} %% The user may (later) choose a more advanced treatment by %% loading \ctanpkgstyref{url} and %% \[`\renewcommand{\urlfmt}{\url}'\] %% %% The file name format |\filenamefmt{}| %% may differ from the format for \URL s---if somebody %% wants/adjusts it, \emph{here} it is the \emph{same:} \providecommand*{\filenamefmt}{\texttt} %% ... %% I favor `\code' over `\texttt' as ``logical markup," %% inspired by the \xmltagcode{code} element in \HTML, %% but it is too difficult to provide this right now here ... %% %% (TODO 2012/12/29: This section seems to be relevant for %% \secref{url-text} only and might move there.) %% %% %% Instead of |\pkgnamefmt{}|, %% %% 'blog.sty' had `\pkg{}', %% was `prg' 2011/10/20 %% %% without a proper implementation. %% |\pkgnamefmt{}| displays the name of a ``package". %% Using `\textsf' for `\pkgnamefmt' %% seems to conform to common practice today---implemented here. %% The following code may later be suppressed at some package options, %% as with the choice for `\httpref': %% TODO 2011/01/24 % \@ifdefinable\pkgnamefmt {\let\pkgnamefmt\@firstofone} % \AtBeginDocument {\let\pkgnamefmt\textsf} %% <- This was here until v0.7, makes a difference for \acro{PDF} %% vs.\ 'blog'/\HTML. %% / 2012/12/28 %% [Cf.~\secref{opt}!? TODO]---%% 2013/01/21 %% Now we choose the same as with `\urlfmt': \providecommand*{\pkgnamefmt}{\textsf} %% Indeed, the same day we are providing `\textsf' in 'blog.sty'. %% However, the rationale of the earlier solution was %% that web pages use sans-serif as the \emph{normal} font ... %% %% %% moving \httpsref 2011/08/27: %% === Providing &\httpref\ and &\httpsref === %% %% rm. \kern-\baselineskip 2011/10/10 %% \[|\httpref{}{}|\] %% should display %% as a link to `http://'; %% \[|\httpsref{}{}|\] %% is the obvious analogue for `https:' \URL s. %% In case `\begin{document}' is found with a definition of %% `\href' present, we provide definitions of `\httpref' %% and `\httpsref' in terms of `\href' there: \AtBeginDocument{% \@ifundefined{href}{% % \PackageError ... TODO!? 2011/01/24 }{\newcommand*{\httpref} [1]{\href {http://#1}}% \newcommand*{\httpsref}[1]{\href{https://#1}}}} %% %% === Variants of &\httpref\ and &\httpsref === %% |\NormalHTTPref| may be used as an alias for `\httpref' %% in situations where the latter has been redefined %% v0.2 %% (as in \secref{urlfoot}): \AtBeginDocument{\newlet\NormalHTTPref\httpref} %% TODO: sec:opt %% |\ithttpref{}{}| displays in italics: % \newcommand*{\ithttpref}[2]{\NormalHTTPref{#1}{\textit{#2}}} %% However, I seem never to have used it. And I would now %% prefer |\metahttpref| TODO ... %% %% ==== Protocol Prefix ==== %% 2012/12/15 %% |\httpprefix| is an idea that was missing in 'blog.sty' up to v0.3. %% It may be used to determine generally whether a display of an %% \URL\ should include `http://'. I choose as default what was default %% in 'blog.sty' %% (i.e., ``don't include"): %% add. 2011/01/27 \newlet\httpprefix\@empty %% \newlet 2015/05/25 %% `\let\httpprefix\relax' would be bad for 'blog.sty' %% (would display `\relax'), %% while it would be somewhat more efficient.%%%---%%% %% %% Now you may customize `\httpprefix' by %% \[`\renewcommand{\httpprefix}{http://}'\] %% %% v0.2: %% ---or by `\let\httpprefix'|\theHTTPprefix|: \newcommand*{\theHTTPprefix}{http://} %% With |\urlhttpsref{}|, we \emph{force} displaying \qtd{`https://'}: \newcommand*{\urlhttpsref}[1]{\httpsref{#1}{\urlfmt{https://#1}}} %% %% ==== The \URL\ (or a Part) as the Link Text Phrase ==== %% (...) 2012/12/28 %% \label{sec:url-text} %% With |\urlhttpref{}|, that \URL\ is displayed: \newcommand*{\urlhttpref}[1]{% \NormalHTTPref{#1}{\urlfmt{\httpprefix#1}}} %% %% moved up here 2011/10/20 %% In 'blog.sty' (as of 2010/05/26), there was a command %% `\urlref' instead of `\urlhttpref'. It did not provide `\urlfmt'. %% %% |\domainref{}{}| is similar, but is intended %% to show the domain part of the \URL\ %% `/' only. %% This may be useful when the entire \URL\ does not look %% nice, while the domain name is a kind of logo, %% and when comparing what different web portals have %% to say about the same matter, such as the web versions %% of newspapers or magazines. So you may compare how %% %% v0.83 new example, \tugctanorg gone: %% % \domainref{www.ctan.org}{pkg/morehype} and %% % \domainref {\tugctanorg}{pkg/morehype} inform about %% \tugc... 2012/12/29 %% % the 'morehype' bundle (v0.8). %% \domainref{www.ctan.org}{tex-archive/macros} and %% \domainref{tug.ctan.org}{tex-archive/macros} %% display the top-level `macros' directory of the \TeX\ archive. %% % The command is also used in \secref{wiki-stack} %% % for `tex.stackexchange.com'. %% why? rm. 2015/05/24 -- see below %% %% texblog 2012/06/08; v0.8 here \newcommand*{\domainref}[2]{\httpref{#1/#2}{\urlfmt{#1}}} %% Note that on some domains %% only domain, an article \acro{ID} and maybe the `.html' %% suffix and/or a ``category" between domain and \acro{ID} %% is required for a working \URL, as opposed to an \URL %% that is displayed in the browser's address line %% and contains a kind of transcription of the article's title---e.g., %% \urlhttpref{tex.stackexchange.com/questions/84878}. %% %% v0.83 adds \ |\prefixref{}{}{}| \ %% just as an alias for `\domainref' because the same function %% may be useful in some cases when `/', %% for some code strings and , %% is the same as `' and `' %% for some , %% is the same as `/': \newlet\prefixref\domainref %% Then you may compair how %% \[\prefixref{www.ctan.org/tex-archive}{macros}\] %% and \[\prefixref{tug.ctan.org/tex-archive}{macros}\] %% display the `generic' subdirectory of the `macros' directory. %% %% ==== Linking \URL s in Footnotes ==== %% 2011/08/27 %% \label{sec:urlfoot} %% |\foothttpurlref{}| just is like %% `\footnote{\urlhttpref{}}': \newcommand*{\foothttpurlref}[1]{\footnote{\urlhttpref{#1}}} %% |\urlfoot{}{}| %% redefines `\httpref' so that you can use all the shorthand %% macros based on `\httpref' to get the according \URL\ %% display (as provided by `\urlhttpref') %% in a footnote without the need to include the %% entire \URL\ in your source code. `\urlfoot' is available %% with and %% when a shorthand |\{}{}| has been defined %% where `\' is the macro name and is the target %% identifier (usually part of the \URL\ generated from ) %% according to the syntax declaration of `\'. \newcommand*{\urlfoot}[2]{{% \let\httpref\foothttpurlref \let\httpprefix\theHTTPprefix %% TODO customizable!? \csname #1\endcsname{#2}{}}} %% \begin{example}\leavevmode %% \[`\CtanPkgRef{morehype}{MoreHype}' %% \mbox{\quad and\quad } `\ctanpkgref{morehype}'\] %% are provided in \secref{sing-pkgs} for linking to %% `http://ctan.org/pkg/morehype'. %% \begin{itemize} %% \item %% % Try `CtanPkgRef' \emph{here}: %% % \CtanPkgRef{morehype}{MoreHype},\\ %% % for the \emph{footnote} try %% % `\urlfoot{CtanPkgRef}{morehype}';%%% %% % \urlfoot{CtanPkgRef}{morehype} %% \simpleyields{\CtanPkgRef{morehype}{MoreHype}} %% etc. 2012/12/30 %% \item %% \simplecodefbox{\urlfoot{CtanPkgRef}{morehype}} %% yields \urlfoot{CtanPkgRef}{morehype} %% \item %% % try `ctanpkgref' \emph{here}: \ctanpkgref{morehype},\\ %% \simpleyields{\ctanpkgref{morehype}} %% \item %% % for the \emph{footnote} try %% % `\urlfoot{ctanpkgref}{morehype}'.%%% %% % \urlfoot{ctanpkgref}{morehype} %% \simplecodefbox{\urlfoot{ctanpkgref}{morehype}} %% yields \urlfoot{ctanpkgref}{morehype} %% \end{itemize} %% The lonely \qtd{\pkgnamefmt{morehype}} you see there above %% demonstrates that it doesn't work with `ctanpkgref' because %% `\ctanpkgref' doesn't have separate arguments for %% and , it actually doubles . %% A local `\let\ctanpkgref\CtanPkgRef' could help, %% but right now I prefer waiting for a better idea. %% [TODO] %% 2011/01/27 %% \end{example} %% %% v0.3: Now that using `\urlfoot' and `ctanpkgref' together %% is so clumsy, while I use it quite often, %% 2011/02/10 %% we get |\urlpkgfoot{}|, abbreviating %% `\urlfoot{CtanPkgRef}{}': \newcommand* {\urlpkgfoot} {\urlfoot{CtanPkgRef}} %% ==== \URL\ Bases ==== %% 2012/03/09 %% \label{sec:bases} %% We typically refer to many web pages under a certain domain, %% or in certain subdirectories there. Before v0.6, %% I made many definitions like %% \[`\newcommand*{\myref}[1]{\httpref{/#1}}'\] %% for this purpose. %% Storing the definition of such a `\myref' uses 8 tokens %% %% including parameter ... %% todo done 2012/12/17 %% in addition to those from . %% With %% \[`\newcommand*{\myref}{\httpbaseref{}}'\] %% } 2012/12/17 %% we need 5 %% was 3 2012/12/17 %% tokens instead, using \ |\httpbaseref{}{}{}| \ %% %% <- added text 2013/01/21 %% defined as follows: \newcommand*{\httpbaseref}[2]{\httpref{#1/#2}} %% Then `\myref{}{}' will work like %% 2013/01/21 %% \[`\httpref{/}{}'\] %% We change many definitions in ensuing sections accordingly---and %% with v0.82 we add a shorthand for definitions like the avove one %% for `\myref'. \[|\MakeBasedHref{}{}|\] may be applied %% as \[`\MakeBasedHref{\myref}{}'\] above. In the general %% situation, `{}{}' will work like %% \[`\httpref{/}{}'\] %% own line 2015/03/27 %% v0.83 extends this to `https' %% (has been tested in `texblog.fdf' for more than a year): \newcommand*{\httpsbaseref}[2]{\httpsref{#1/#2}} %% 2014/03/21 %% provides |\httpsbaseref{}{}{}|. \newcommand*{\MakeBasedHref}[3][http]{% %% 2014/03/21 \ifx#2\@undefined \else \ifx#2\relax %% was \ifx#1 2014/12/23 \PackageWarning{texlinks}{Redefining \string#2.}% \fi \fi \expandafter\def\expandafter#2\expandafter{% %% ... or `\DefExpandStart' from \ctanpkgstyref{dowith} TODO ... \csname#1baseref\endcsname{#3}}% } %% This also provides an optional argument for choosing `https' %% instead of `http': %% \[|\MakeBasedHref[https]{}{}|\] %% Now `\newcommand*{\mysecureref}{\httpsbaseref{}}' %% may be replaced by %% \[`\MakeBasedHref{\mysecureref}{}'\] -- %% However, `\MakeBasedHref' does not act like `\newcommand' %% when has been defined earlier, it rather resembles %% `\DeclareRobustCommand', in that it just \emph{warns} in such a case. %% I don't actually make robust because I guess it is anyway: %% The reason for allowing redefinitions has been application %% to cases where the user should be able to customize commands %% (\secref{custom-ref})---well, %% I could have `\NewBasedHref' and `\RenewBasedHref' some time %% TODO\footnote{And for sections \ref{sec:wiki-back} and %% \ref{sec:wikibooks}, an optional argument %% would have been nice.}; %% TODO: `\@onlypreamble'? %% %% The situation is similar with (many) anchors of a (large) web page. %% With v0.6, we introduce %% \[|\httpancref{}{}|\]---\emph{perhaps}, %% with `\mirrorctanref' (\secref{texcat}) etc.? TODO % \newcommand*{\httpancref}[2]{\httpref{#1\##2}} %% %% %% == Google == %% 2012/12/17 %% |\googleref{}{}| \ generates a \Wikiref{Google} %% search page with keywords from in which they %% are separated by \qtdcode{+}, as in %% \[`\googleref{tex+friends}{\TeX~\& friends}'\] %% which results in (I'm curious ...) %% \googleref{tex+friends}{\TeX~\& friends:} \newcommand*{\googlecom}{google.com/} % \newcommand*{\googleref}[1]{\httpref{\googlecom\#q=#1}} %% ... correct link has been very different since 2012: %% 2014/05/25 \newcommand*{\googleref}[1]{\httpref{\googlecom/search?q=#1}} %% |\googlemapsref{}{}| \ generates a %% \wikiref{Google Maps}{Google map} from the . %% may compose an address for a \TeX\ users' meeting, %% so Google may show them their way. %% \[=\mbox{\qtdcode{munich+offenbachstrasse+21}}\] %% results in \googlemapsref{munich+offenbachstrasse+21} %% {where this has been written.} \newcommand*{\googlemapsref}[1]{\httpref{maps.\googlecom maps?q=#1}} %% %% == Wikipedia == %% === Overview === %% \label{sec:wiki-stack} %% The present section on links to Wikipedia articles %% starts with the rather obvious %% \[|\wikilangref{}{}{}|\] %% but then gets somewhat technical. \secref{langcode} %% may please the user again by %% \[|\Wikiref{}|\] %% where the language version of the Wikipedia is chosen %% according to a macro `\langcode' expanding to \qtdcode{en} %% by default. On %% \domainref{tex.stackexchange.com}{/questions/84878}, %% I have posted the following ``minimal working example:" %% \begin{verbatim} %% \documentclass{minimal} %% \usepackage{hyperref,texlinks} %% \begin{document} %% Look up \wikiref{Charlie Bucket}{Wikipedia} %% for \Wikiref{Charlie Bucket}. %% \end{document} %% \end{verbatim} %% You may find it as `wiki_mwe.tex' with outcome `wiki_mwe.pdf'. %% See \secref{langcode} for more examples. %% 2012/12/30 %% %% Apart from `\langcode', more advanced things are %% \emph{disambiguation} (\secref{wiki-back}), %% ``piped links" (\secref{wiki-pipe}), and %% special characters in \URL s (\secref{wiki-urls}). %% %% %% 2015/05/19: %% Starting in spring 2015, the 'morehype' bundle offers %% an additional package 'wikimed.sty' that includes %% Wikipedias ``sister projects" like Wiktionary and %% provides a variant of \wikienref{URL encoding}{\URL\ encoding}, %% converting punctuation and things like umlauts for valid \URL s. %% %% === Backbones === %% \label{sec:wiki-back} %% As of v0.6, we have a \dqtd{backbone} macro %% \[|\wikilangref{}{}{}|\] %% for links to Wikipedia. %% (It was |\wikiref| before, starting with v0.4---sorry!) %% consists of %% two characters like \lq`de'\rq\ for German Wikipedia articles %% or \lq`en'\rq\ for English ones. is the identifier of %% the article, and is displayed as the link: % \newcommand*{\wikilangref}[2]{\httpref{#1.wikipedia.org/wiki/#2}} %% <- 2012/03/09 etc. with \secref{bases} -> \newcommand*{\wikilangref}[1]{\httpbaseref{#1.wikipedia.org/wiki}} %% There is |\Wikilangref{}{}| %% for the case that and are the same. %% With v0.7 however, this command becomes more powerful, %% see \secref{wiki-pipe}. % \newcommand*{\Wikilangref}[2]{\wikilangref{#1}{#2}{#2}} %% `\wikilangref{}[]{}' would be nicer; %% %% <- shortened 2012/01/06 -> %% however, the present code is to work with 'blog.sty' %% which does not support optional arguments.%%%--- %% %% Quite often, programs share their names with movies, %% biological species, etc., then lemma disambiguation is required. %% Usually, we don't want to display the disambiguation. %% \[|\Wikilangdisambref{}{}{}|\] %% will link to %% \[`http://.wikipedia.org/wiki/_()'\] \newcommand*{\Wikilangdisambref}[3]{\wikilangref{#1}{#2 (#3)}{#2}} %% There %% was `Their' 2011/07/23 %% was something like a more general variant |\wikidisambref|, %% now I doubt its usefulness and \textcolor{blue}{omit} it %% in order to see where it occurs (2011/05/13). %% %% For \strong{anchors}, \qtd{&#} can be used with 'blog.sty'---and %% even with 'hyperref'. %% \simpleexample{\wikilangref{en}{TeX#History}{history}} %% %% === Piped Links === %% \label{sec:wiki-pipe} %% v0.7 emulates Wikipedia's %% \wikiref{Help:Links\#Piped_link}{piped links} %% was "Piped links" 2012/12/01 %% as with Wikipedia source code \[`[[Pipeline|Pipe]]'\] %% to get a link to article \qtd{\Wikiref{Pipeline}} %% \Wikiref 2012/12/01 %% with displayed text %% \qtd{\wikiref{Pipeline}{Pipe}}. The same syntax %% (double brackets) is actually supported by %% 'blog.sty' with 'markblog.sty', %% was `blogexec' 2012/12/06 %% while otherwise only %% \[\GenCmdBox+\Wikilangref{}{|}+\] %% works---with settings more below something like %% \GenCmdBox+\Wikiref{|}+---which %% admittedly is not much better than the equivalent %% \[`\wikiref{}{}'\] %% %% Even Wikipedia's feature that empty removes %% the disambiguation term as with `[[Pipe (computing)|]]' %% resulting in \qtd{\wikiref{Pipe (computing)}{Pipe}} %% is supported. \newcommand*{\Wikilangref}[2]{% \@wikilpref{#1}#2\BiteSep|\@nnil\BiteSep\@nil{#2}} %% I have introduced `\BiteSep' and this kind of parsing %% in the \ctanpkgdref{bitelist} package. \def\@wikilpref#1#2|#3\BiteSep#4\@nil#5{% \ifx\@nnil#3\@empty \wikilangref{#1}{#5}{#5}% \else \wikilangref{#1}{#2}{% \ifx\@three#3\@three \wiki@noparen#2\@nil% \else #3% \fi}% \fi} \def\wiki@noparen#1 (#2\@nil{#1} %% (Removing 'bitelist' considerations 2015/05/22 ... %% % I have thought about improving 'bitelist.sty', resulting %% % in the following code. In the present application, %% % I do not consider it superior. It uses %% % the same number of tokens but new one has additional %% % expansion step. The situation is different to the general case %% % because doing everything before `\fi' is okay here. %% % \newcommand*{\Wikilangref}[2]{% %% % \@wikilPref{#1}#2\BiteSep\@secondoftwo %% % |\BiteSep\@firstoftwo\@nil{#2}} %% % \def\@wikilPref#1#2|#3\BiteSep#4#5\@nil#6{% %% % #4{\wikilangref{#1}{#6}{#6}}% %% % {\wikilangref{#1}{#2}{% %% % \ifx\@three#3\@three %% % \wiki@noparen#2\@nil% %% % \else %% % #3% %% % \fi}}} %% %% === English and German === %% The next macros just save you from typing braces around %% the language codes for English and German: %% |\wikienref{}{}| refers to the English Wikipedia, %% |\wikideref{}{}| refers to the German one. \newcommand*{\wikideref}{\wikilangref{de}} \newcommand*{\wikienref}{\wikilangref{en}} %% |\Wikideref{}| refers to article in the German %% Wikipedia and displays as : \newcommand*{\Wikideref}{\Wikilangref{de}} %% |\Wikienref{}| is `\Wikideref''s analogue for English: \newcommand*{\Wikienref}{\Wikilangref{en}} %% |\Wikidedisambref{}{}| chooses a disambiguation %% according to for the German Wikipedia, %% |\Wikiendisambref{}{}| for the English one: \newcommand*{\Wikidedisambref}{\Wikilangdisambref{de}} \newcommand*{\Wikiendisambref}{\Wikilangdisambref{en}} %% %% === ``Implicit" Choice of Language === %% 2012/01/06 %% \label{sec:langcode} %% With v0.6, |\wikiref{}{}| works like %% \[`\wikilangref{}{}{}'\] %% ref 2012/10/24 %% when |\langcode| expands to %% (the two-letter language code according to \Wikiref{ISO 639-1}). %% The default for is \qtdcode{en} for English. %% It can be overridden even before loading 'texlinks' %% (e.g., by an earlier `\newcommand\langcode{de}'): \providecommand*{\langcode}{en} %% %% mod. 2012/10/24: %% For the German versions, use \ `\renewcommand{\langcode}{de}'. \ %% The \ctanpkgref{langcode} package provides a command \ %% |\uselangcode{}| \ that works like %% \ `\renewcommand*{\langcode}{}' \ %% and adjusts a number of other settings. \newcommand*{\wikiref}{\wikilangref\langcode} %% %% adding args 2012/12/17: %% |\Wikiref{}| and |\Wikidisambref{}{}| %% second \ 2012/12/29 %% are the obvious analogues (cf. \secref{wiki-back}): \newcommand*{\Wikiref}{\Wikilangref\langcode} \newcommand*{\Wikidisambref}{\Wikilangdisambref\langcode} %% \begin{simpleexamples} %% \simpleexample{\Wikiref{LaTeX}} %% \simpleexample{\wikiref{LaTeX}{&\LaTeX}} %% \simpleexample{\Wikidisambref{Latex}{disambiguation}} %% \end{simpleexamples} %% %% === Blanks and Umlauts in \URL s and Anchors === %% \label{sec:wiki-urls} %% %% <- renamed 2011/05/17 reworked: %% |\underscorechar| seemed to be useful in macro %% definitions. The name was inspired by \LaTeX's %% `\@backslashchar' and `\@percentchar'. %% However, I am now trying what happens without it. %% It occurred in `blog.tex' for the documentation of %% the 'blog' package, but `\string_' seems to be a good %% replacement. % \newcommand \underscorechar {} % {\@makeother\_ \gdef\underscorechar{_}} %% Anyway, in my notes I have a more elegant macro for %% providing ``other" versions of special characters. %% %% Guessing what `\underscorechar' was good for (2011-05-17): %% Wikipedia lemmas and anchors often or even \emph{typically} %% contain \emph{blank spaces}. %% The Wikipedia software usually converts them into %% underscore characters. Blank spaces in \emph{lemmas} %% seem \emph{not} to need treatment here in 'texlinks'. %% However, Wikipedia also creates \emph{anchors} from %% \emph{section headings}, which typically contain blank spaces. %% This has been more difficult ... %% %% Likewise with umlauts: text encoding suffices for \emph{lemmas} %% (my `\urluml' is not needed for this purpose). %% But umlauts in \emph{anchors} %% generated from \emph{section headings} are different. %% While umlauts in \emph{lemmas} are represented by sequences %% starting with a \emph{percent} character, the anchors %% use a \emph{dot} instead of the percent character. %% Therefore now |\ancuml{}| is provided: \newcommand*{\ancuml}[1]{\csname ancuml:#1\endcsname} \@namedef{ancuml:a}{.C3.A4} \@namedef{ancuml:o}{.C3.B6} \@namedef{ancuml:u}{.C3.BC} \@namedef{ancuml:s}{.C3.9F} %% %% comments removed 2012/01/11: %% % What you read in the rest of the section is %% % \textcolor{blue}{wrong}, the commands are %% % \textcolor{blue}{dropped} for testing as of 2011/05/13. %% % |\itwikideref| is an italic variant of `\wikideref': % \newcommand*{\itwikideref}[2]{\wikideref{#1}{\textit{#2}}} %% % By analogy to `\Wikideref', %% % The following macros save you from typing the underscore %% % (didn't spaces suffice sometimes?) %% TODO 2011/01/24 %% % and the round parantheses. %% % Italic variant |\itwikienref| of `\wikienref' %% % ('blog.sty' had `\emwikienref' instead): % \newcommand*{\itwikienref}[2]{\wikienref{#1}{\textit{#2}}} %% % |\urluml{}| as of 2010/05/25 %% % (not sure if it ever worked or was actually needed): % \newcommand*{\urluml}[1]{\csname urluml:#1\endcsname} % \@namedef{urluml:a}{\#C3\#A4} % \@namedef{urluml:o}{\#C3\#B6} % \@namedef{urluml:u}{\#C3\#BC} % \@namedef{urluml:s}{\#C3\#9F} %% 2010/08/09 %% %% == \TeX-related == %% 2010/08/24 %% === \CTAN === %% \label{sec:ctan} %% %% new from scratch 2015/05/16f.: %% ==== Personal motivation ==== %% When I created `texlinks.sty' originally, referring to %% \CTAN\ material seemed simple to me. Well, what is \CTAN? %% Please don't ask me, see the \wikiref{CTAN}{Wikipedia article} %% and/or its major ``home page" \urlhttpref{www.ctan.org}---or %% \CTAN\ introducing itself on \urlhttpref{ctan.org/ctan}---or %% the \ukfaqref{ctan}{\acro{UK FAQ}!}---Well, %% in order to generate \wikiref{URL}{\URL}s from human-readable %% or memorizable input and to document my macros that try to %% serve this purpose, I must guess what a domain or \CTAN\ has in %% mind when they provide \URL s, while they don't seem to tell us %% what they have in mind and what rules they follow. So I am just %% reporting what I observed and what I guess, and I am trying to %% introduce two technical terms ... \ The ``discovery" section %% (\secref{ctan-discovery}) may be confusing, then I hope that %% the ``summarizing section" (\secref{ctan-tables}) %% will help by its tables.---The present \CTAN\ section (\secref{ctan}) %% became especially difficult in December 2012 %% (cf. \ctanannpref{12-12-006718}{\CTAN\ announcement}) %% and January 2013 when some \URL s stopped to work %% or changed their behavior---several times very much %% within a few days---and I struggled to follow. %% %% ==== \CTAN ology: kinds of \CTAN\ \URL s (archives, bases) ==== %% % \subsubsection{\CTAN ology:\titlefootnote{A moment ago, %% % \wikienref{L. Ron Hubbard}{L.~Ron Hubbard} %% % kindly suggested the section's title to me.} %% % \ \ kinds of \CTAN\ \URL s (archives, bases)} %% \label{sec:ctan-discovery} %% \strong{One thing} are \strong{files} that have been \strong{contributed} %% to the \strong{\CTAN\ archive} so that \strong{users} can download %% them in order to run \TeX\ on their computers, especially for new %% features that have been made available only in recent months. %% Such files are submitted to the/a \CTAN\ archive, available through %% certain \URL s over the internet. %% %% It seems that after some years it became difficult to understand %% what features have been provided by so many contributors and %% how to find them. For a while, the `help' subtree of a \CTAN\ archive %% tried to help here (especially the \emph{\TeX\ catalogue}) ... %% but eventually only experts could understand the abundance. %% So a starting page just for providing tools for %% \strong{exploring} the \TeX\ archive became useful and was %% provided---over certain \URL s. Here I have called pages %% available by such \URL s as ``\CTAN\ \strong{description}" %% pages or so---\strong{second thing}. %% %% In order to save internet capacity (per time, %% and to save users' patience), \strong{\Wikiref{web mirror}}s %% of both archive and description pages have been established %% and maintained---copies of the central directory structure. %% %% I have seen two kinds of \strong{\URL s} interesting here: %% \begin{itemize} %% \item \strong{domains} ending on `ctan.org' %% \item \URL s ending on `/tex-archive' %% \end{itemize} %% %% \TeX\ \strong{archive} \URL s show (only) a list of top-level %% directories `biblio'..., `dviware', `fonts', `graphics', %% `help', `indexing', `info', `install', `language'..., %% `macros', `obsolete', `support', `systems', `tds', %% `usergrps', and `web'. This is what characterizes \TeX\ %% \emph{archives} or their \emph{roots}, as opposed to %% \emph{description} pages, by their \strong{content} %% (as opposed to characterization by the form of \strong{\URL s}). %% Including deeper subdirectories, the directory structures %% of all \TeX\ archives are the same (``mirrors"). They %% change by new contributions, but within 24 hours, %% other \TeX\ archives copy the changes of the first %% one.---There are several \strong{designs} of archive root pages, %% varying between archive \emph{mirrors.} %% %% \CTAN\ \strong{description} pages have \emph{roots} as well, %% and 'texlinks' previously has chosen macro names containing %% `ctanorgbase' for accessing them, so there is an idea to call those roots %% \strong{\CTAN\ bases}. In spring 2015, all bases I know %% have the same \strong{design}, and they actually \emph{combine} %% archive and description: an upper section shows the %% archive top-level directories, the remaining page offers %% the description/exploring tools. To compare bases with archives %% in terms of top-level subdirectories, I know of \CTAN\ base %% subdirectories `pkg', `author', `topic', and `tex-archive'. %% %% %% ==== Summary tables with macro names ==== %% \label{sec:ctan-tables} %% In the following tables, a macro in the right-hand column %% is just \emph{one} to access paths under the corresponding %% \URL\ in the left-hand column, so the list of macros %% probably is not complete here, it just is to give an \emph{idea} %% for the following sections. The `\nullctan'\codedots\ %% macros keep some `\ctan'\codedots\ control sequences free %% so the latter are available as shorthands for accessing the users' %% favorite domains. %% %% \vskip\medskipamount %%% \noindent %% The first table is a list of \URL s resolving to %% \CTAN\ description bases according to the previous subsection %% (\secref{ctan-discovery}) I know of. %% (It shrinked and changed much after some very recent discoveries of mine.) %% Sections starting at \secref{sing-pkgs} tell about many more %% macros for accessing description pages. %% 2015/05/20 %% \MakeOther\|\MakeNormal\& %% % \noNiceVerb %% \begin{center} %% \begin{tabular}{|r|r|} %% \hline %% \multicolumn{2}{|c|}{\strong{\CTAN\ bases for package descriptions}} \\ %% \hline \hline %% \multicolumn{1}{|c|}{\strong{\URL}} & \multicolumn{1}{c|}{\strong{macro}} \\ %% \hline \hline %% \urlhttpref{www.ctan.org} & `\wwwctanorgbaseref{}{}' \\ %% \hline %% \urlhttpref{ctan.org} & `\nullctanorgbaseref{}{}' \\ %% \hline %% \urlhttpref{dante.ctan.org} & \multicolumn{1}{c|}{---}\\ %% \hline %% \end{tabular} %% \end{center} %% \MakeActiveLet\|\nvCmdBox\MakeActiveLet\&\CmdSyntaxVerb %% % \useNiceVerb %% \strong{Remarks:}\enspace (a)~|www.ctan.org| and |ctan.org| %% have the same functionality. %% %% (b)~|\nullctanorgbaseref| appears here rather than |\ctanorgbaseref| %% because the latter is used as an alias for either %% |\wwwctanorgbaseref| or `\nullctanorgbaseref', by default for %% `\ctanorgbaseref', cf. \secref{sing-pkgs}. %% %% (c)~|dante.ctan.org| just redirects to |www.ctan.org|. %% \vskip\medskipamount %%% \pagebreak %%% \noindent %% The second table is a list of \URL s resolving to %% \CTAN\ \TeX\ archives according to the previous subsection %% (\secref{ctan-discovery}) I know of. %% Macros are described from \secref{texarc} onwards. %% \MakeOther\|\MakeNormal\& %% % \noNiceVerb %% \begin{center} %% \begin{tabular}{|r|r|} %% \hline %% \multicolumn{2}{|c|}{\strong{\CTAN\ archives}} \\ %% \hline \hline %% \multicolumn{1}{|c|}{\strong{\URL}} & \multicolumn{1}{c|}{\strong{macro}} \\ %% \hline \hline %% \urlhttpref{www.ctan.org/tex-archive} & `\wwwctanref{}{}' \\ %% \hline %% \urlhttpref{ctan.org/tex-archive} & `\nullctanref{}{}' \\ %% \hline \hline %% \urlhttpref{tug.ctan.org/tex-archive} & \multicolumn{1}{c|}{---} \\ %% \hline %% \urlhttpref{tug.ctan.org} & `\tugctanref{}{}' \\ %% \hline %% \urlhttpref{dante.ctan.org/tex-archive} & `\dantectanref{}{}'\\ %% \hline %% \urlhttpref{ctan.sciserv.eu} & `\sciservref{}{}' \\ %% \hline \hline %% \urlhttpref{mirror.ctan.org} & `\mirrorctanref{}{}'\\ %% \hline %% `/tex-archive' & \multicolumn{1}{c|}{TODO} \\ %% \hline %% `/ctan/' & \multicolumn{1}{c|}{TODO} \\ %% \hline %% `' & \multicolumn{1}{c|}{TODO} \\ %% \hline %% \end{tabular} %% \end{center} %% \MakeActiveLet\|\nvCmdBox\MakeActiveLet\&\CmdSyntaxVerb %% % \useNiceVerb %% \strong{Remarks:}\enspace \ \ (a)~|\nullctanref| %% rather than |\ctanref| appears here because the latter %% is used as an alias for one of the other `ctanref' commands, %% by default for `\mirrorctanref', cf. \secref{texarc}. %% %% (b)~|tug.ctan.org/tex-archive|,\quad |tug.ctan.org|, %% \[|dante.ctan.org/tex-archive|\mbox{,\quad and\quad} |ctan.sciserv.eu|\] %% have the same functionality; %% which includes (i)~that they show the same page of its own %% design and (z)~that this page includes a few lines of links %% to the basic functions of `www.ctan.org'. The design is much %% less heavy than the design of `www.ctan.org' with respect %% to ($\alpha$)~graphics and to ($\beta$)~the number of columns. %% At its bottom, the page describes itself as ``experimental" %% and as dating from February~2015 (observed in May 2015). %% %% (c)~\strong{Examples} for |//tex-archive|, %%%\quad %% |/ctan| and || %% (as listed below `mirror.ctan.org') %% are \strong{\wikienref{web mirror}{mirrors}} of %% \[|ctan.org/tex-archive|\mbox{\quad or \quad} %% |www.ctan.org/tex-archive|\] %% and appear as (somewhat random) resolutions of |mirror.ctan.org|. %% may be empty. %% |tug.ctan.org| and |ctan.sciserv.eu| listed earlier %% actually are examples of the last entry, %% and |dante.ctan.org/tex-archive| exemplifies the other %% lower entry. The file \ctanfileref{CTAN.sites} %% in the root directory of any \TeX\ archive should %% contain all the example \URL s to which `mirror.ctan.org' %% resolves. However, my intention (which failed) for %% the final table entries was that they exemplify mirrors %% with rather \emph{simple} directory designs, %% as opposed to the \URL s listed in the upper part %% of the table. %% %% %% ==== Some \CTAN\ Domains ==== %% \label{sec:domains} %% 2015/05/22 %% |\ctanorg| saves a few tokens, using |\nullctanorg| for |ctan.org| %% (latter new with v0.83, keeping ultimate expansion of `\ctanorg' from prior %% versions). \newcommand*{\nullctanorg}{ctan.org} \newcommand*{\ctanorg}{.\nullctanorg} %% `\nullctanorg' and |\wwwctanorg| are useful both for %% description pages and \TeX\ archives: \newcommand*{\wwwctanorg}{www\ctanorg} %% % Instances are |tug.ctan.org| (|\tugctanorg|), %% % |www.ctan.org| (|\wwwctanorg|): %% % |dante.ctan.org| (|\dantectanorg|): %% % \newcommand*{\tugctanorg} {tug\ctanorg} %% % \newcommand*{\wwwctanorg} {www\ctanorg} %% % \newcommand*{\dantectanorg} {dante\ctanorg} %% % \newcommand*{\mirrorctanorg}{mirror\ctanorg} %% Referring to \strong{``description"} pages %% according to \secref{ctan-discovery} %% (`\httpbaseref' from \secref{bases}):\MDdocnewline %% |\wwwctanorgbaseref{}{}| \ links to |www.ctan.org|: \newcommand*{\wwwctanorgbaseref}{\httpbaseref\wwwctanorg} %% |\nullctanorgbaseref{}{}| is like %% the previous command without `www.': \newcommand*{\nullctanorgbaseref}{\httpbaseref\nullctanorg} %% |\metactan@ref{}{}| for some ``null" vs. %% `www'-commands that are defined in \secref{sing-pkgs}: \newcommand*{\metactan@ref}[3]{#2{#1/#3}} %% %% ==== Fixed Macros for Paths in Various \TeX\ Archives ==== %% 2015/05/22 %% \label{sec:texarc} %% 2013/01/19 %% \paragraph{Shorthands for paths.} %% |\texarchive| saves a few tokens: %% 2015/05/21 \newcommand*{\texarchive}{/tex-archive} %% Typically, \LaTeX\ macro packages in `macros/latex/contrib/' %% are discussed, so here is |\ltxcontrib| saving both characters %% and tokens %% (no starting slash so it can be used with `\httpbaseref'; %% likewise no final one---hopefully only used in present demos %% before v0.83): \newcommand*{\ltxcontrib}{macros/latex/contrib} %% We now proceed along the second table of \secref{ctan-tables}: %% \paragraph{Advanced design of directories.} %% \TeX\ archive directories on |www.ctan.org| %% and |ctan.org| show an advanced design, %% as compared with mirror \TeX\ archives. %% They can be accessed by %% \begin{itemize} %% \item |\wwwctanref{}{}| and %% \item |\nullctanref{}{}| respectively %% \end{itemize} %% ( without starting slash): \MakeBasedHref{\wwwctanref} {\wwwctanorg/\texarchive} \MakeBasedHref{\nullctanref}{\nullctanorg/\texarchive} %% \begin{simpleexamples} %% \simpleexample{\wwwctanref{}{Archive root}} %% \simpleexample{\wwwctanref{macros/generic}{generic macros}} %% \simpleexample{\nullctanref{macros/generic}{generic macros}} %% % \longsimpleexample{\nullctanref{macros/generic}{generic macros}} %% \simpleexample{\nullctanref{\nvCSV\ltxcontrib/morehype}{hypertext}} %% \end{simpleexamples} %% In the final example, you see that the ``directory" design %% even includes something like the corrsponding %% \strong{\ctanpkggenref{morehype}{package description}}---especially %% the ``\acro{README}" is displayed in a ``frame." %% %% \paragraph{Advanced root page design.} %% Next, there are archive roots showing a special \emph{starting page}, %% while subdirectories show a rather simple design. %% \begin{itemize} %% \item |\tugctanref{}{}|, %% \item |\dantectanref{}{}|, and %% \item |\sciservref{}{}| %% \end{itemize} %% make a link to a \TeX~Archive directory or file %% on the corresponding domain: \MakeBasedHref{\tugctanref}{tug\ctanorg} %% (`tug.ctan.org' once behaved like `alan.smcvt.edu', %% Jim Hefferon's former \CTAN\ interface.) \MakeBasedHref{\dantectanref}{dante\ctanorg/\texarchive} \MakeBasedHref{\sciservref}{dante\ctanorg} %% Using the \emph{empty} may be most interesting %% for that starting page; otherwise they may simply serve as %% (known) \emph{nearby mirrors}---speed preferred over design. %% \begin{simpleexamples} %% \simpleexample{\tugctanref{}{Archive root}} %% \simpleexample{\tugctanref{info}{Info}} %% \end{simpleexamples} %% \paragraph{Random mirrors.} %% For speed, saving energy (i.e., the \emph{world}), %% and certain servers from overload, %% using |mirror.ctan.org| is recommended, %% which automatically chooses a \CTAN\ \wikienref{web mirror}{\emph{mirror}}. %% \[|\mirrorctanref{}{}|.\] %% 2011/10/10 :->.2011/10/21: %% is provided for this purpose: \MakeBasedHref{\mirrorctanref}{mirror\ctanorg} %% Resulting design may be poor ... %% \begin{simpleexamples} %% \simpleexample{% %% \mirrorctanref{}{Archive root}} %% \simpleexample{% %% \mirrorctanref{help}{Help}} %% \end{simpleexamples} %% %% ==== \cs{ctanref} for Favourite Mirror, Customizing ==== %% fav. 2015/05/21 %% \label{sec:custom-ref} %% |\ctanref| should work like one out of %% \begin{itemize} %% \item `\wwwctanref', `\nullctanref', %% \item `\tugctanref', `\dantectanref', `\sciservctanref', and %% \item `\mirrorctanref', %% \end{itemize} %% %%%(as introduced in \secref{texarc}) %% (as listed in the second table of \secref{ctan-tables}) %% depending on which out of %% \begin{itemize} %% \item |\usewwwctan|, |\usenullctan|, %% \item |\usetugctan|, |\usedantectan|, |\usesciservctan|, and %% \item |\usemirrorctan|, %% \end{itemize} %% appeared most recently. %% By \strong{default}, `\ctanref' works like `\mirrorctanref'. %% So in any case its syntax is \[|\ctanref{}{}|.\] %% The idea is that it is a shorthand to access the user's %% favourite \CTAN\ mirror, or just to save the `www' %% in `\wwwctanref', for instance. It may also be modified directly %% using %% \[|\MakeBasedHref{\ctanref}{}|\] %% where is a \URL\ of a root of %% a \CTAN\ mirror (imitate code from \secref{texarc}---TODO: %% more \URL s in \secref{domains}?), %% or by %% \[|\renewcommand{\ctanref}{\ctanref}|\] \newcommand*{\let@ctanref}{\let\ctanref} %% v0.83 2015/05/22 \newcommand*{\usemirrorctan}{\let@ctanref\mirrorctanref %% v0.83 rm. reminiscence of \let\ctanfileref } %% |\usemirrorctan| \emph{sets} the \strong{default} %% meaning for |\ctanref| as announced %% (so it uses \urlhttpref{mirror.ctan.org}): \usemirrorctan \RequirePackage{domore} \setdo[2]{\newcommand*#1{\let@ctanref#2}} %% TODO `\DoDoWithMore'? \DoWithMore\do{\usewwwctan \wwwctanref } {\usenullctan \nullctanref } {\usetugctan \tugctanref } {\usedantectani \dantectanref} {\usesciservctan \sciservref }\StopDoing %% v0.83 drops |\myctanref|, while it might be useful for the user's %% preferred mirror. However, \secref{texarc} should show how to %% set up `\myctanref' then, and %% \[|\renewcommand*{\ctanref}{\myctanref}|\] %% could replace the |\usemyctan| I haven't put here. %% % \begin{singthm}{Remark} (TODO) \ Another implementation %% % of adjusting `\ctanref' I consider is %% % using some `\ctanurl'\-`prefix' that you can redefine for %% % accessing your favourite mirror. %% % \end{singthm} %% %% ==== Opening/Downloading Files from an Archive ==== %% 2015/05/25 %% %% moved down 2015/05/18 %% You may actually want to \emph{open} a file in %% of a \TeX\ archive %% % displayed as the link text, %% 2011/10/21 %% % by %% 2013/01/21 %% by clicking on (which is formatted by %% |\filenamefmt| from \secref{fonts})---or %% to \emph{offer} this opportunity to readers of your document. %% In this case, the formatting of \CTAN\ pages %% (directories) doesn't matter at all, %% so a randomly chosen archive mirror should do: %% |\mirrorctanfileref{}{}| \newcommand*{\CTANfileref}[3]{#1{#2/#3}{\filenamefmt{#3}}} \newcommand*{\mirrorctanfileref}{\CTANfileref\mirrorctanref} %% |\ctanfileref{}{}| is provided as an alias %% or shorthand for `\mirrorctanfileref': \newlet\ctanfileref\mirrorctanfileref %% \begingroup\hfuzz=14pt %% TODO %% \begin{simpleexamples} %% \simpleexample{\ctanfileref{\nvCSV\ltxcontrib/filedate/doc}{filedate.pdf}} %% \simpleexample{\ctanfileref{\nvCSV\ltxcontrib/filedate}{README}} %% \simpleexample{\ctanfileref{\nvCSV\ltxcontrib}{filedate.zip}} %% \end{simpleexamples} %% \endgroup %% %% 2013/01/21: rm. \tugctanfileref %%%% 2015/05/21 %% |\mirrorctanfileref| should not be changed, %% while the user might %% \[|\renewcommand*{\ctanfileref}{\CTANfileref}|\] %% with from the previous section or the %% second table in \secref{ctan-tables} %% (immitate the earlier definition of `\mirrorctanfiler'), %% or s(h)e might %% \[|\newcommand*{\myctanfileref}{\CTANfileref}|\] %% and (temporarily) %% \[|\renewcommand*{\ctanfileref}{\myctanfileref}|\] %% (|\filectanref| that I earlier offered for customizing %% is dropped with v0.83.) %% %% It may be psychologically useful to have an \emph{opposite} %% to `\ctanfileref' %% 2015/05/23: filectan -> ctanfile %% that can easily be recognized as such, %% while `\ctanref' may be unclear. I offer %% |\dirctanref{}{}| ... %% %. It may be an alias %% was \dirfile... 2015/05/21 %% %for `\ctanref', even respecting the `\use'\codedots\ commands %% %from above. Another proposal above is dangerous with the present idea: %% as a kind of alias for `\ctanref'---you might change that %% by `\renewcommand': \newcommand*{\dirctanref}{\ctanref} %% \strong{Note:}\enspace Links for opening \CTAN\ files %% with a different link text than the filename %% can be generated by `ctanref' commands discribed earlier. %% %% ==== The \TeX\ Catalogue OnLine ==== %% \label{sec:texcat} %% 2012/12/18 %% % We are not providing access to everything in the %% % \catalogueref{}{\TeX~catalogue}. %% Before v0.8, only %% J\"urgen Fenn's Topical Index of the Catalogue %% was supported. v0.8 adds package descriptions displayed %% by the Catalogue. The following shorthand %% |\catalogueref{}{}| is an auxiliary for %% both of them (and other s the user might want). %% With empty , %% it generates an \URL\ of a \catalogueref{}{root} %% in a \CTAN\ mirror %% shorthand 2012/12/17 %% of \meta{The \TeX~Catalogue OnLine}: \newcommand*{\catalogueref}[1]{\mirrorctanref{help/Catalogue/#1}} %% The user may modify this by %% \begin{center} %% `\renewcommand*{\catalogueref}[1]{\myctanref{help/Catalogue/#1}}' %% \end{center} %% or by %% \begin{center} %% `\MakeBasedHref{\catalogueref}{texcatalogue\ctanorg}' %% \end{center} %% ---cf. \urlhttpref{texcatalogue\ctanorg}. %% %% Some mirrors seem to display the Catalogue's root directory %% only this way, while others display the ``Welcome" page. %% |\cataloguestartref{}| accesses the %% \cataloguestartref{\strong{Welcome} (\strong{start})} page surely: \newcommand*{\cataloguestartref}{\catalogueref{index\html}} %% |\bytopicref{}{}| %% \ %% 2011/10/21 %% makes a link to of %% \strong{J\"urgen Fenn's Topical Index} %% 2012/12/18 %% of the \TeX\ Catalogue. You find the %% by clicking at the respective \acro{TOC} entry on top of the page %% and then read the \URL\ from the browser's navigation display. \newcommand*{\bytopicref}[1]{\catalogueref{bytopic\html\##1}} %% \simpleexample{\bytopicref{html}{&\TeX~to HTML}} %% \par %% recplaces \[\] 2015/05/20 %% |\catpkgref{}| makes %% a link to the description of the \strong{package} %% in \meta{The \TeX~Catalogue Online}. %% \[|\CatPkgRef{}{}|\] %% is a variant for the cases where authors have a special idea %% using some capital letters when they describe their packages %% (\acro{ASCII} %%% ASCII %% 2012/12/14 %% versions of ``logos" such as `BibTeX') %% was Logos 2012/10/24 %% while the identifier doesn't allow capital letters. %% %% 2011/01/24: %% Also, may be a package from a \emph{bundle} %% where has a description page while %% doesn't have its \emph{own} description page~... %% \simpleexample{\CatPkgRef{morehype}{texlinks}} \newcommand*{\catpkgref}{\DoubleArg\CatPkgRef} %\newcommand*{\CatPkgRef}[1]{% % \cat@ctan@pkg@ref\catalogueref{entries/#1\html}} %% <- v0.83 2015/05/20 -> \newcommand*{\CatPkgRef}{\cat@ctan@pkg@ref\catpkggenref} %% v0.83 introduces |\catpkggenref{}{}| %% where formatting is up to the user %% (or not special formatting required): \newcommand*{\catpkggenref}[1]{\catalogueref{entries/#1\html}} %% |\cat@ctan@pkg@ref{}{}| %% 2012/12/19, rm. frag 2015/05/26 %% \ ensures that is typeset as the argument of %% `\pkgnamefmt' (\secref{fonts}). %% It is used in \secref{sing-pkgs} again: \newcommand*{\cat@ctan@pkg@ref}[3]{#1{#2}{\pkgnamefmt{#3}}} %% \simpleexample{\catpkgref{morehype}} %% % \begin{example} %% % \makeatletter \def\ex@mple{\catpkgref{morehype}}% %% % \fbox{\strut\expandafter\code\expandafter{\expandafter&\ex@mple}}% %% % %% <- bad spaces %% % \hskip\labelsep for\hskip\labelsep %% % \fbox{\strut\ex@mple} %% % |\catpkgref{morehype}| \ for \ %% % \fbox{\catpkgref{morehype}} %% % \end{example} %% %% ==== Single Packages without The \TeX~Catalogue ==== %% \label{sec:sing-pkgs} %% 2012/12/19 %% v0.83 introduces a way to refer to a package description without %% telling a package's name. |\wwwctanpkggenref{}{}| %% does not coerce into a special format: \newcommand*{\metactan@pkgref}{\metactan@ref{pkg}} \newcommand*{\wwwctanpkggenref}{\metactan@pkgref\wwwctanorgbaseref} %% \longsimpleexample %% {\wwwctanpkggenref{morehype}{an awesome bundle}} %% |\nullctanpkggenref{}{}| similarly without `www.': \newcommand*{\nullctanpkggenref}{\metactan@pkgref\nullctanorgbaseref} %% |\wwwctanpkgref{}| makes %% 2015/05/26 %% a link to a package info page for the package %% on `www.ctan.org'. is displayed and formatted %% by `\pkgnamefmt{}'. |\WwwCtanPkgRef{}{}| %% is a variant of `\wwwctanpkgref' relating to the latter %% as `\CatPkgRef' relates to `\catpkgref' (\secref{texcat}): \newcommand*{\wwwctanpkgref}{\DoubleArg\wwwCtanPkgRef} \newcommand*{\WwwCtanPkgRef}{\cat@ctan@pkg@ref\wwwctanpkggenref} % %% Using `\cat@ctan@pkg@ref' from \secref{texcat}: % \newcommand*{\Ct@nPkgRef}[2]{\cat@ctan@pkg@ref#1{pkg/#2}} %% |\wwwctanpkgstyref{}| %% 2012/11/27 %% adds \qtdcode{.sty} to the package name: \newcommand*{\wwwctanpkgstyref}[1]{\wwwCtanPkgRef{#1}{#1.sty}} %% Likewise |\nullctanpkgstyref{}| etc.: \newcommand*{\nullctanpkgstyref}[1]{\nullCtanPkgRef{#1}{#1.sty}} \newcommand*{\nullctanpkgref}{\DoubleArg\nullCtanPkgRef} \newcommand*{\NullCtanPkgRef}{\cat@ctan@pkg@ref\nullctanpkggenref} %% Command names \ |\ctanpkgstyref|, \ |\ctanpkgref|, \ |\CtanPkgRef|, \ %% and \ |\ctanpkggenref| \ interrelate analogously. %% I expect these ones are mainly used. %% Their exact behavior can be chosen from the `\nullctan'\codedots, %% `\wwwctan'\codedots\ things, they even can use the \TeX\ catalogue: \newcommand*{\ctanpkgstyref}[1]{\CtanPkgRef{#1}{#1.sty}} \newcommand*{\ctanpkgref}{\DoubleArg\CtanPkgRef} \newcommand*{\CtanPkgRef}{\cat@ctan@pkg@ref\ctanpkggenref} \newcommand*{\ctanpkggenref}{\metactan@pkgref\ctanorgbaseref} %% v0.83 abolishes `tugctanorgbaseref' as %% \urlhttpref{tug.ctan.org} no longer has a %% `pkg' top-level subdirectory: % \newcommand*{\useTUGpkgpages}{\let\CtanPkgRef\TugCtanPkgRef} %% After |\useWWWpkgpages|, %% the package descriptions from `www.ctan.org' are used: \newcommand*{\let@ctanobref}{\let\ctanorgbaseref} \newcommand*{\useWWWpkgpages}{\let@ctanobref\wwwctanorgbaseref} %% After |\useOpkgpages|, `\CtanPkgRef' and `\ctanpkgref' %% use the package descriptions from `ctan.org'. This command %% and the previous |\useOpkgpages| also decide whether %% author (\secref{pkg-au}), topic, and search pages %% (\secref{pkg-search}) have `www.' in their \URL\ or not: \newcommand*{\useOpkgpages}{\let@ctanobref\nullctanorgbaseref} %% And the latter is the \strong{default:} \useOpkgpages %% After |\useCATpkgpages|, `\CtanPkgRef' and `\ctanpkgref' %% use the \TeX~Catalogue to display package informations. %% The content should be much the same as with %% [`www.']`ctan.org', the same database is used, %% it is the design that differs: \newcommand*{\useCATpkgpages}{\let\CtanPkgRef\CatPkgRef} %% Finally, we provide experimental %% \[|\AllPkgRefs{}{}| \mbox{\quad and\quad} %% |\allpkgrefs{}|\] %% offering choice between the two interfaces for each package. %% \qtdcode{c} will stand for The \TeX~Catalogue and %% \qtdcode{w} for `www.ctan.org'. After |\useALLpkgpages|, %% this is what `\CtanPkgRef' and `\ctanpkgref' offer: \newcommand*{\AllPkgRefs}[2]{% \pkgnamefmt{#2}\,[\CatPkgRef{#1}{c}\textbar % \TugCtanPkgRef{#1}{t}\textbar %% rm. v0.83 \WwwCtanPkgRef{#1}{w}]} \newcommand*{\allpkgrefs}{\DoubleArg\AllPkgRefs} \newcommand*{\useALLpkgpages}{\let\CtanPkgRef\AllPkgRefs} %% \simpleexample{\allpkgrefs{morehype}} %% (With 'blog.sty', this requires some `\def\textbar{|}' TODO.) %% %% ==== Package Author Pages ==== %% \label{sec:pkg-au} %% |\wwwctanpkgauref{}{}| creates a link %% to the list of packages somebody described by %% maintains: \newcommand*{\metactan@auref}{\metactan@ref{author}} \newcommand*{\wwwctanpkgauref}{\metactan@auref\wwwctanorgbaseref} %% \simpleexample{\wwwctanpkgauref{lueck}{mine}} %% |\nullctanpkgauref{}{}| removes `www.': \newcommand*{\nullctanpkgauref}{\metactan@auref\nullctanorgbaseref} %% |\ctanpkgauref{}{}| chooses from the former %% possibilities according to the `\use'\codedots\ commands %% in the previous \secref{sing-pkgs}: \newcommand*{\ctanpkgauref}{\metactan@auref\ctanorgbaseref} %% %% ==== Other Ways to Search for Packages ==== %% \label{sec:pkg-search} %% 2012/12/29 %% |\wwwctanpkgtopicref{}{}| accesses a list of %% packages belonging to the ``topic" with identifier . \newcommand*{\metactan@topicref}{\metactan@ref{topic}} \newcommand*{\wwwctanpkgtopicref}{% \metactan@topicref\wwwctanorgbaseref} %% \longsimpleexample{\wwwctanpkgtopicref{cvt-html}{make HTML}} %% |\nullctanpkgtopicref{}{}| without `www.': \newcommand*{\nullctanpkgtopicref}{% \metactan@topicref\nullctanorgbaseref} %% |\nullctanpkgsearch{}| \ and \ |\wwwctanpkgsearch{}| \ %% create links to a page for searching packages %% with several options for search criteria: \newcommand*{\metactan@searchref}[1]{#1{search}} \newcommand*{\nullctanpkgsearchref}{% \metactan@searchref\nullctanorgbaseref} %% \simpleexample{\ctanpkgsearchref{CTAN~search}} \newcommand*{\wwwctanpkgsearchref}{% \metactan@searchref\wwwctanorgbaseref} %% |\ctanpkgtopicref| and |\ctanpkgsearchref| choose %% according to the `\use'\codedots\ commands in \secref{sing-pkgs}: \newcommand*{\ctanpkgtopicref}{\metactan@topicref\ctanorgbaseref} \newcommand*{\ctanpkgsearchref}{\metactan@searchref\ctanorgbaseref} %% The \TeX\ Catalogue OnLine has offered searching as well, %% yet today this search page is just the same as the one you %% get by \wwwctanpkgsearchref. %% %% %% === Mailing Lists === %% \label{sec:mail} %% This section mainly provides tools for referring %% 2015/05/28 %% to pages of or postings to the \CTAN\ announcments %% (\secref{ctan-ann}) and texhax (\secref{texhax}) mailing lists. %% v0.7 relies on package \ctanpkgref{langcode} for %% |\enmonthname{}| and |\demonthname{}|, %% for tricks with language codes extending those in %% \secref{langcode}: \RequirePackage{langcode} %% The next definitions are backbones for generating links to %% web pages about \TeX\ mailing lists. %% |\TL@piper@parse--| will be used %% for referring to single postings: \def\TL@piper@parse#1-#2-#3/{#1-\enmonthname{#2}/#3} %% \[|\texlistyearmonthref{<2-digits>-}|\] %% will generate \ |{}| \ for linking to the list of postings %% of the th month in the year 20<2-digits>: \newcommand*{\texlistyearmonthref}[2]{\texlist@yearmonthref#1#2\@nil} \def\texlist@yearmonthref#1#2-#3\@nil{#1{20#2-\enmonthname{#3}}} %% \qtd{} will be \qtdcode{20<2-digits>-}, %% and will be the \emph{English} name of the %% th month of the year. %% %% \[|\texlanglistmonthref{<2-digits>-}|\] %% will generate \ |{}{}| \ %% where is determined from by : \newcommand*{\texlanglistmonthref}[3]{\texlanglistm@nthref#1#2#3\@nil} \def\texlanglistm@nthref#1#2#3-#4\@nil{% #2{20#3-\enmonthname{#4}}{#1{#4}}} %% |\detexlistmonthref{<2-digits>-}| \ %% now could be used for `{}{}' %% \emph{German} ... \newcommand*{\detexlistmonthref}{\texlanglistmonthref\demonthname} %% ... as could be \ |\entexlistmonthref{<2-digits>-}| \ %% for \emph{English} ... \newcommand*{\entexlistmonthref}{\texlanglistmonthref\enmonthname} %% With proper use of \ctanpkgref{langcode} however, %% \[|\texlistmonthref{<2-digits>-}|\] %% \emph{automatically} chooses between English and German %% (according to intention ...): \newcommand*{\texlistmonthref}{\texlanglistmonthref\monthname} %% %% === \CTAN\ Announcements === %% 2011/06/27 %% \label{sec:ctan-ann} %% 2015/05/28 %% |\ctanannref{}{}| makes a link %% to the DANTE web page displaying a \CTAN\ %% announcement. You find by searching %% \[\texttt{https://lists.dante.de/pipermail/ctan-ann/}\] %% and then reading the \URL. %% is composed as %% \[`-/<6-digits>.html'\]%%%, \[\] 2012/10/24 %% %% 2012/10/24: %% where consists of 4 digits and is an \emph{English} %% month name: \newcommand*{\ctanannref}[1]{% \httpsref{lists.dante.de/pipermail/ctan-ann/#1}} %% |\ctanannpref{}{}| is a variant %% of `\ctanannref' where in place of %% you only type the third and fourth digit of the %% year (<2-digits>), then a \qtdcode{-}, then the (arabic) %% number of the month (cf. \secref{mail} so far), %% then another \qtdcode{-}, %% and then the actual internal identifier %% (a number of six digits preceding \qtdcode{.html} of the \URL). %% I.e., \qtd{} is \qtdcode{<2-digits>--}. \newcommand*{\ctanannpref}[1]{% \ctanannref{20\TL@piper@parse#1/\html}} %% `20' 2012/12/08 %% \[|\ctanannyearmonthref{<2-digits>-}|\] generates %% `\ctanannref{}' from \qtdcode{<2-digits>-}--- %% as in \secref{mail} ... \newcommand*{\ctanannyearmonthref}{\texlistyearmonthref\ctanannref} %% \[|\ctanannmonthref{<2-digits>-}|\] generates %% `\ctanannref{}{}' where obeys `\langcode' ... %% % from \qtdcode{<2-digits>-} \newcommand*{\ctanannmonthref}{\texlistmonthref\ctanannref} %% %% === \code{\dots stack\dots} Forums === %% 2012/12/17/18 %% |\stackexref{}{}| \ shows exchange about %% Question No.~ on \urlhttpref{tex.stackexchange.com}. %% is the number following \qtdcode{/questions/} %% in the \URL\ %% (the part of the \URL\ reflecting the caption are not needed). %% See an example from %% $=\stackexref{84878}{84878}$ in \secref{wiki-stack}. \newcommand*{\stackexref}{\stackquestionref{tex.stackexchange}} \newcommand*{\stackquestionref}[2]{\httpref{#1.com/questions/#2}} %% Likewise, \ |\stackoverref{}{}| \ links to %% \urlhttpref{stackoverflow.com} %% ($=\stackoverref{2118972}{2118972}$ is about file dates): \newcommand*{\stackoverref}{\stackquestionref{stackoverflow}} %% %% === \TUG === %% \TUG 2012/12/15 %% \label{sec:tug} %% 2012/12/29 %% |\tugref{}{}| makes a link %% to on domain `tug.org': \MakeBasedHref{\tugref}{tug.org} %% ==== texhax ==== %% \label{sec:texhax} %% 2015/05/28 %% |\texhaxref{}{}| makes a link %% to the \TUG\ web page displaying %% a texhax posting. You find by searching %% `tug.org/pipermail/texhax/' and then reading the \URL. %% is composed as `-/<6-digits>.html'. \newcommand*{\texhaxref}[1]{\tugref{pipermail/texhax/#1}} %% |\THref{}| saves you from choosing %% and uses `texhax' instead. \newcommand*{\THref}[1]{\texhaxref{#1}{texhax}} %% (It was `\prg{texhax}' in 'blog.sty', to have something %% logo-like, without a good idea how to implement it.) %% %% |\texhaxpref{}{}| is a variant %% of `\texhaxref' where in place of %% you only type the third and fourth digit of the %% year, then a `-', then the (arabic) number of %% the month, then another `-', and then the actual %% internal identifier %% (a number of six digits preceding `.html' of the \URL). %% I made this macro because I prefer typing to copying %% from the \URL. \newcommand*{\texhaxpref}[1]{% %% 2010/09/07 \texhaxref{20\TL@piper@parse#1/\html}} %% 2011/05/03 %% |\THpref{}| is a variant of `\THref' using %% as with `\texhaxpref': \newcommand*{\THpref}[1]{\texhaxpref{#1}{texhax}} %% 2011/03/24 %% TODO: `\texhaxPref#1' searches list of offsets %% to determine year/month from id ... %% %% \[|\texhaxyearmonthref{<2-digits>-}|\] generates %% `\texhaxref{}' from \qtdcode{<2-digits>-}--- %% as in \secref{mail} ... \newcommand*{\texhaxyearmonthref}{\texlistyearmonthref\texhaxref} %% \[|\texhaxmonthref{<2-digits>-}|\] generates %% `\texhaxref{}{}' where obeys `\langcode' ... \newcommand*{\texhaxmonthref}{\texlistmonthref\texhaxref} %% %% ==== Other ==== %% %% 2011/04/27 corr. doc. vol/issue %% |\tugbartref{tb-/}{}| %% makes a link to the \TUG boat article %% `.pdf' in vol.~ and issue~: % \newcommand*{\tugbartref}[1]{\tugref{TUGboat/Articles/#1\pdf}} \newcommand*{\tugbartref}[1]{\tugref{TUGboat/#1.pdf}} %% %% <- 2011/04/30 %% That `tb' can be dropped with %% \[|\tugbArtref{-/}{}|\] %% %% <- 2015/03/27 -> %% after this definition: \newcommand*{\tugbArtref}[1]{\tugbartref{tb#1}} %% |\tugiref{}{}| makes %% 2012/07/23 tugi 2012/08/05 %% a link to an %% on the \TUG\ web page entitled \qtd{TeX Resources on the Web} %% (e.g., $=\mbox{\qtdcode{web}}$ shows the section entitled %% \tugiref{web}{\qtd{\TeX~web projects}}): \newcommand*{\tugiref}[1]{\tugref{interest\html\##1}} %% It was `\TUGIref' until v0.6, we keep this for compatibility %% (deprecated): \newlet\TUGIref\tugiref %% %% === \acro{UK FAQ} === %% |\ukfaqref{