diff options
author | Karl Berry <karl@freefriends.org> | 2013-01-04 23:29:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-01-04 23:29:05 +0000 |
commit | 5ab401f066bdbf32ae3ca4b1be2e9783f203054b (patch) | |
tree | 08ecdca48954535a964f1f02749c954d4eb5ea0e /Master/texmf-dist/tex/latex/morehype/texlinks.sty | |
parent | 128f3fd93dbeca96fa4580608e2cf46fa785ee17 (diff) |
morehype (4jan13)
git-svn-id: svn://tug.org/texlive/trunk@28730 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/morehype/texlinks.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/morehype/texlinks.sty | 197 |
1 files changed, 144 insertions, 53 deletions
diff --git a/Master/texmf-dist/tex/latex/morehype/texlinks.sty b/Master/texmf-dist/tex/latex/morehype/texlinks.sty index 2ba0585b1db..d14dd78dca7 100644 --- a/Master/texmf-dist/tex/latex/morehype/texlinks.sty +++ b/Master/texmf-dist/tex/latex/morehype/texlinks.sty @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e}[1994/12/01] %% \newcommand* etc. -\ProvidesPackage{texlinks}[2012/12/20 v0.8 TeX-related links (UL)] +\ProvidesPackage{texlinks}[2012/12/31 v0.81 TeX-related links (UL)] %% copyright (C) 2011 2012 Uwe Lueck, %% http://www.contact-ednotes.sty.de.vu %% -- author-maintained in the sense of LPPL below. @@ -72,14 +72,23 @@ %% and ``packages" (|\pkgnamefmt|). %% For the latter two, in certain files I use shorthands %% |\file| and |\pkg|, resp., ... -%% (Not sure about `\providecommand' TODO ...) -%% %% TODO "fallback" with 'provlast' +%% `\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 `\texttt' for formatting \TeX\ code +%% 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{<url>}| 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{<file-name>}| %% may differ from the format for \URL s---if somebody %% wants/adjusts it, \emph{here} it is the \emph{same:} @@ -88,6 +97,9 @@ %% I favour `\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{<pack-name>}|, %% %% 'blog.sty' had `\pkg{<pack-name>}', %% was `prg' 2011/10/20 @@ -100,7 +112,8 @@ % \@ifdefinable\pkgnamefmt {\let\pkgnamefmt\@firstofone} % \AtBeginDocument {\let\pkgnamefmt\textsf} %% <- This was here until v0.7, makes a difference for \acro{PDF} -%% vs.\ 'blog' \HTML. Now we choose the same as with `\urlfmt': +%% vs.\ 'blog'/\HTML. %% / 2012/12/28 +%% 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 @@ -153,7 +166,8 @@ %% With |\urlhttpsref{<url>}|, we \emph{force} displaying \qtd{`https://'}: \newcommand*{\urlhttpsref}[1]{\httpsref{#1}{\urlfmt{https://#1}}} %% -%% ==== The \URL\ as the Link Text Phrase ==== +%% ==== The \URL\ (or a Part) as the Link Text Phrase ==== %% (...) 2012/12/28 +%% \label{sec:url-text} %% With |\urlhttpref{<url>}|, that \URL\ <url> is displayed: \newcommand*{\urlhttpref}[1]{% \NormalHTTPref{#1}{\urlfmt{\httpprefix#1}}} @@ -170,7 +184,7 @@ %% to say about the same matter, such as the web versions %% of newspapers or magazines. So you may compare how %% \domainref{www.ctan.org}{pkg/morehype} and -%% \domainref{tug.ctan.org}{pkg/morehype} inform about +%% \domainref {\tugctanorg}{pkg/morehype} inform about %% \tugc... 2012/12/29 %% the 'morehype' bundle (v0.8). %% The command is also used in \secref{wiki-stack} %% for `tex.stackexchange.com'. @@ -200,18 +214,28 @@ %% \begin{example}\leavevmode %% \[`\CtanPkgRef{morehype}{MoreHype}' %% \mbox{\quad and\quad } `\ctanpkgref{morehype}'\] -%% are provided below for linking to +%% 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} -%% \item try `ctanpkgref' \emph{here}: \ctanpkgref{morehype},\\ -%% for the \emph{footnote} try -%% `\urlfoot{ctanpkgref}{morehype}'.%%% -%% \urlfoot{ctanpkgref}{morehype} +%% \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 @@ -293,6 +317,7 @@ %% \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}), @@ -429,10 +454,15 @@ %% and adjusts a number of other settings. \newcommand*{\wikiref}{\wikilangref\langcode} %% %% adding args 2012/12/17: -%% |\Wikiref{<lemma>}| and |Wikidisambref{<term>}{<add>}| +%% |\Wikiref{<lemma>}| and |\Wikidisambref{<term>}{<add>}| %% 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} @@ -501,22 +531,52 @@ \newcommand*{\html}{.html} %% %% === \CTAN === +%% ==== Former `tug.ctan.org' ==== %% 2012/12/29 +%% \label{sec:tug.ctan.org} +%% Apparently on 2012-12-21, `tug.ctan.org' ceased to refer +%% to the \CTAN\ interface that Jim Hef{}feron had developed, +%% and it has no longer provided a \TeX\ archive or package descriptions. +%% This killed many links generated by 'texlinks', and +%% `\tugctanref' and `\usetugctan' from v0.41 as well as +%% `\TugCtanPkgRef' and `\useTUGpkgpages' (among others) +%% from v0.8 that I uploaded 2012-12-20 became useless. +%% +%% I am now trying to make sense of these 'texlinks' macros +%% for a while, in order to avoid changing existing code +%% (in my package documentations and on my web pages). +%% For this purpose, |ctan.tug.org| and |alan.smcvt.edu| +%% seem to be good domains. I have been warned that this +%% may stop working soon again. So I do \strong{not recommend} +%% typing new code containing macros whose names contain `tugctan'. +%% +%% Also for later documentation +%% (\secref{search-pkg}, \secref{x.ctan.org}), +%% I introduce |\tugctanorg|, with a very counter-intuitive +%% definition due to what I have mentioned +%% (and to get intuitive interrelations instead): +\newcommand*{\tugctanorg}{ctan.tug.org} +%% (TODO: cf. \secref{tug}) +%% %% ==== Directories and Files in a \TeX~Archive ==== %% % `\newcommand*{\ctanref}[1]{\httpref{ctan.org/#1}}' %% % once was replaced in 'blog.sty' by what will now be %% \[|\tugctanref{<path>}{<text>}|\] %% \[...\] 2012/12/19 +%% hopefully %% 2012/12/29 %% makes <text> a link -%% to a \TeX~Archive directory or file <path>. -%% |\ctanorg| saves a few tokens: %% 2012/12/18 -\newcommand*{\ctanorg}{.ctan.org} -\newcommand*{\tugctanref}{\httpbaseref{tug\ctanorg/tex-archive}} +%% to a \TeX~Archive directory or file <path> +%% with Jim Hef{}feron's interface. %% 2012/12/29 +\newcommand*{\tugctanref}{\httpbaseref{\tugctanorg/tex-archive}} +%% \simpleexample{\tugctanref{}{Archive root}} %% Alternatively, you can refer to an (automatically chosen) %% \CTAN\ \emph{mirror} %% using %% \[|\mirrorctanref{<path>}{<text>}|.\] %% 2011/10/10 :->.2011/10/21: -%% (I prefer the \emph{appearance} of the -%% \tugctanref{}{\TUG\ archive}, designed by Jim Hefferon.) +%% % (I prefer the \emph{appearance} of the %% rm. 2012/12/29 +%% % \tugctanref{}{\TUG\ archive}, designed by Jim Hefferon.) +%% |\ctanorg| saves a few tokens: %% 2012/12/18, mv. down 2012/12/29 +\newcommand*{\ctanorg}{.ctan.org} \newcommand*{\mirrorctanref}{\httpbaseref{mirror\ctanorg}} +%% \simpleexample{\mirrorctanref{}{Archive root}} %% You may actually want to ``open" a file <file-name> in <path> %% on \CTAN, %% <file-name> displayed as the link text, %% 2011/10/21 @@ -531,6 +591,13 @@ %% Typically, \LaTeX\ macro packages in `macros/latex/contrib/' %% are discussed, so here is |\ltxcontrib| saving a few characters: \newcommand*{\ltxcontrib}{macros/latex/contrib/} +%% So \[\simplecodefbox{% +%% \mirrorctanref{&\ltxcontrib morehype}{&\pkg{morehype}}}\] +%% yields \simplecodeoutfbox{% +%% \mirrorctanref {\ltxcontrib morehype}{&\pkg{morehype}}}. +%% %% <- & doesn't work in first arg. of \href 2012/12/30 +%% %% -> `replace.sty'? +%% %% |\ctanref| works like `\tugctanref' or like `\mirrorctanref', %% depending on |\usetugctan| vs.\ |\usemirrorctan|. %% So in any case its syntax is \[|\ctanref{<path>}{<text>}|.\] @@ -550,6 +617,10 @@ %% |\ctanref| and |\ctanfileref| use %% \urlhttpref{mirror.ctan.org}: \usemirrorctan +%% So +%% \simplecodefbox {\ctanref{&\ltxcontrib morehype}{&\pkg{morehype}}} +%% yields +%% \simplecodeoutfbox{\ctanref {\ltxcontrib morehype}{&\pkg{morehype}}}. %% \meta{Remark} (TODO): \ Another implementation I consider is %% using some `\ctanurl'\-`prefix' that you can redefine for %% accessing your favourite mirror. @@ -571,7 +642,7 @@ %% of \meta{The \TeX~Catalogue OnLine}: \newcommand*{\catalogueref}[1]{\mirrorctanref{help/Catalogue/#1}} %% Some mirrors seem to display the Catalogue's root directory -%% only this way, while others display ``Welcome" page. +%% only this way, while others display the ``Welcome" page. %% |\cataloguestartref{<text>}| accesses the %% \cataloguestartref{\strong{Welcome} (\strong{start})} page surely: \newcommand*{\cataloguestartref}{\catalogueref{index\html}} @@ -638,40 +709,44 @@ %% pages under that domain have been changed in December %% and no longer call themselves ``Jim Hef{}feron's." %% The latter's pages seem to stay available under -%% `tug.ctan.org'. Major contentual differences at present +%% \urlfmt{\tugctanorg}. Major contentual differences at present %% (2012-12-18) seem to be: %% \begin{enumerate} %% \item `www.ctan.org' classifies packages by a new concept -%% of ``topics," while `tug.ctan.org' classifies them +%% of ``topics," while \urlfmt{\tugctanorg} classifies them %% by ``\strong{keywords}" as well as %% by ``\strong{char\-ac\-teri\-za\-tions}" out of which one is %% ``primary" and others are ``secondary." -%% \item `tug.ctan.org' like the Catalogue as in \secref{texcat} +%% \item \urlfmt{\tugctanorg} like the Catalogue as in \secref{texcat} %% provides links to single documentation files, %% unlike `www.ctan.org'. %% \end{enumerate} %% %% In order to keep as much as possible, I introduce new %% `\tugctan'\codedots\ and `\wwwctan'\codedots\ commands. -%% The first ones link to `tug.ctan.org', the others to +%% The first ones link to \urlfmt{\tugctanorg} +%% (see \secref{tug.ctan.org} for why), the others to %% `www.ctan.org'. The user may choose whether the -%% `\ctan'\codedots\ commands link to `tug.ctan.org' or to -%% `www.ctan.org'. +%% `\ctan'\codedots\ commands link to \urlfmt{\tugctanorg} +%% or to `www.ctan.org'. %% -%% |\tugctanorgbaseref{<path>}{<text>}| \ links to `tug.ctan.org' +%% |\tugctanorgbaseref{<path>}{<text>}| \ links to \urlfmt{\tugctanorg} %% independently of the choice for `\ctanorgbaseref': -\newcommand*{\tugctanorgbaseref}{\httpbaseref{tug\ctanorg}} +\newcommand*{\tugctanorgbaseref}{\httpbaseref\tugctanorg} %% |\wwwctanorgbaseref{<path>}{<text>}| \ links to `www.ctan.org' %% independently of the choice for `\ctanorgbaseref': \newcommand*{\wwwctanorgbaseref}{\httpbaseref{www\ctanorg}} %% |\useTUGctanbases| \ lets `\ctanorgbaseref' be `\tugctanorgbaseref': \newcommand*{\useTUGctanbases}{\let\ctanorgbaseref\tugctanorgbaseref} -%% |\ctanorgbaseref{<path>}{<text>}| \ aims to get Jim Hef{}feron's +%% `\ctanorgbaseref{<path>}{<text>}' before v0.81 aimed to get Jim Hef{}feron's %% pages via `\tugctanorgbaseref' by default: -\useTUGctanbases -%% To get the `www.ctan.org' interface instead, -%% issue |\useWWWctanbases|: +% \useTUGctanbases +%% ... but that is bad when the future of \urlfmt{\tugctanorg} is unclear. +%% Therefore, \ +%% |\useWWWctanbases| \ will choose `www.ctan.org' to look for package +%% descriptions as the default instead (as of v0.81): \newcommand*{\useWWWctanbases}{\let\ctanorgbaseref\wwwctanorgbaseref} +\useWWWctanbases %% %% ==== Single Packages without The \TeX~Catalogue ==== %% \label{sec:sing-pkgs} %% 2012/12/19 @@ -690,14 +765,14 @@ %% adds \qtdcode{.sty} to the package name: \newcommand*{\ctanpkgstyref}[1]{\CtanPkgRef{#1}{#1.sty}} %% The previous commands for package info pages choose between -%% `tug.ctan.org' and `www.ctan.org' according to +%% \urlfmt{\tugctanorg} and `www.ctan.org' according to %% `\useTUGctanbases' or `\useWWWctanbases' %% (i.e., `\ctanorgbaseref', \secref{x.ctan.org}). %% The next commands allow that choice independently of %% `\ctanorgbaseref', by contrast. %% |\useTUGpkgpages| may be issued to stick to the \TUG\ -%% package descriptions (from `CtanPkgRef') -%% even after `\useWWWctanorgbases' (useful? TODO): +%% package descriptions (from `CtanPkgRef'). +%% % even after `\useWWWctanorgbases' (useful? TODO): %% rm. 2012/12/29 \newcommand*{\TugCtanPkgRef}{\Ct@nPkgRef\tugctanorgbaseref} \newcommand*{\tugctanpkgref}{\@double@first@arg\TugCtanPkgRef} \newcommand*{\useTUGpkgpages}{\let\CtanPkgRef\TugCtanPkgRef} @@ -715,7 +790,7 @@ %% |\allpkgrefs{<name>}|\] %% offering choice between the three interfaces for each package. %% \qtdcode{c} will stand for The \TeX~Catalogue, -%% \qtdcode{t} for `tun.ctan.org', and +%% \qtdcode{t} for \urlfmt{\tugctanorg}, and %% \qtdcode{w} for `www.ctan.org'. After |\useALLpkgpages|, %% this is what `\CtanPkgRef' and `\ctanpkgref' offer: \newcommand*{\AllPkgRefs}[2]{% @@ -737,37 +812,45 @@ %% With the advent of ``the new `www.ctan.org'" announced on %% \ctanannpref{12-12-006718}{2012-12-12,} links generated %% by this command stopped working altogether. -%% For v0.8, we ``repair" the definition so that the claim -%% becomes true again. But ``the new `www.ctan.org'" also +%% For v0.8, we repaired the definition so that the claim +%% became true again---for a few days. +%% v0.81 changes the default, see \secref{x.ctan.org}. +%% But ``the new `www.ctan.org'" also %% provides its own author pages, and we offer a choice %% between both interfaces for the author pages. %% A little problem has been that the paths to these pages -%% differ between `tug.ctan.org' and `www.ctan.org' now. -%% +%% differ between \urlfmt{\tugctanorg} and `www.ctan.org' now. \newcommand*{\ctanpkgauref}[1]{\ctanorgbaseref{author/% -%% Only `tug.ctan.org' uses \qtdcode{id/}: +%% Only \urlfmt{\tugctanorg} uses \qtdcode{id/}: \ifx\ctanorgbaseref\tugctanorgbaseref id/\fi #1}} %% % \simpleexample{\ctanpkgauref{lueck}{&\emph{My} packages}} %% \simpleexample{\ctanpkgauref{lueck}{mine}} +%% %---On 2012-12-30, however, I see that with `ctan.org/author/id', +%% %\qtdcode{/id} is automatically removed. (TODO) +%% %% |\tugctanpkgauref{<id>}{<text>}| chooses Jim Hef{}feron's %% author pages even if `www.ctan.org' has been chosen to be %% the main interface for package descriptions (\secref{x.ctan.org}): \newcommand*{\tugctanpkgauref}[1]{\tugctanorgbaseref{author/id/#1}} %% \simpleexample{\tugctanpkgauref{lueck}{mine}} %% |\wwwctanpkgauref{<id>}{<text>}| chooses the new `www.ctan.org''s -%% author pages even if `tug.ctan.org' has been chosen to be +%% author pages even if \urlfmt{\tugctanorg} has been chosen to be %% the main interface for package descriptions (\secref{x.ctan.org}): \newcommand*{\wwwctanpkgauref}[1]{\wwwctanorgbaseref{author/#1}} %% \simpleexample{\wwwctanpkgauref{lueck}{mine}} +%% By the default settings as of v0.81, `\wwwctanpkgauref' %% 2012/12/30 +%% is equivalent to `\ctanpkgauref'. To change this, issue +%% \[`\renewcommand{\ctanpkgauref}{\tugctanpkgauref}'\] %% %% ==== Other Ways to Search for Packages ==== +%% \label{sec:search-pkg} %% 2012/12/29 %% |\ctanpkgtopicref{<topic-id>}{<text>}| accesses a list of %% packages belonging to the ``topic" with identifier <topic-id>. \newcommand*{\ctanpkgtopicref}[1]{\wwwctanorgbaseref{topic/#1}} %% \simpleexample{\ctanpkgtopicref{cvt-html}{make HTML}} %% -%% `tug.ctan.org' and `www.ctan.org' offer more pages for which +%% \urlfmt{\tugctanorg} and `www.ctan.org' offer more pages for which %% I don't create own macros, while I use some of them on a %% \httpref{www.webdesign-bu.de/uwe_lueck/taeglich.htm} %% {page collecting my favourite links.} @@ -778,18 +861,18 @@ %% \begin{itemize} %% \item On \urlhttpref{www.ctan.org/author}, you can browse %% package authors. I could not find an equivalent -%% page under `tug.ctan.org'. -%% \item \urlhttpref{tug.ctan.org/search} and +%% page under \urlfmt{\tugctanorg}. +%% \item \urlhttpref{\tugctanorg/search} and %% \urlhttpref{www.ctan.org/search} offer different %% criteria for searches. %% \item On \urlhttpref{www.ctan.org/topic}, you can browse topics. %% This page in fact is accessed by `\ctanpkgtopicref{}' %% (<topic-id> empty). Jim Hef{}feron's keywords %% %%% and characterizations -%% can be browsed on \urlhttpref{tug.ctan.org/keywords}. +%% can be browsed on \urlhttpref{\tugctanorg/keywords}. %% His characterizations can be browsed from -%% \urlhttpref{tug.ctan.org/characterization/choose\string_dimen}. -%% \item \urlhttpref{tug.ctan.org/pkg} is a single page listing +%% \urlhttpref{\tugctanorg/characterization/choose\string_dimen}. +%% \item \urlhttpref{\tugctanorg/pkg} is a single page listing %% all package identifiers <pkg-id> %% (for `\ctanpkgref{<pkg-id>}', as links). %% %%% The corresponding @@ -887,6 +970,7 @@ \newcommand*{\stackoverref}{\stackquestionref{stackoverflow}} %% %% === \TUG === %% \TUG 2012/12/15 +%% \label{sec:tug} %% 2012/12/29 %% |\tugref{<path>}{<text>}| makes <text> a link %% to <path> on domain `tug.org': \newcommand*{\tugref}{\httpbaseref{tug.org}} @@ -1045,3 +1129,10 @@ v0.8 2012/12/15 \domainref from `texblog.fdf' 2012/12/19 \cat@ctan@pkg@ref, \@double@first@arg; doc. uses {example}, \fbox, etc. 2012/12/20 \ctanpkgtopicref +v0.81 2012/12/28 doc.: "fonts" \provide, corr. \pkgnamefmt, + reworked \urlfoot + 2012/12/29 \tugctanorg; doc.: TODO on "fonts", + more on Jim ... \tugctanorg + 2012/12/30 ... in sec:search-pkg; mod. doc. \ctanpkgauref, + more doc. wiki "overview", \simplecodefbox etc., + 2012/12/31 doc. "the" Welcome ... |