diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/morehype/texlinks.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/morehype/texlinks.sty | 208 |
1 files changed, 172 insertions, 36 deletions
diff --git a/Master/texmf-dist/tex/latex/morehype/texlinks.sty b/Master/texmf-dist/tex/latex/morehype/texlinks.sty index 8ca6e2da521..3a54c6a258d 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/05/13 v0.6 TeX-related links (UL)] +\ProvidesPackage{texlinks}[2012/11/28 v0.7 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. @@ -97,7 +97,7 @@ %% as with the choice for `\httpref': %% TODO 2011/01/24 % \@ifdefinable\pkgnamefmt {\let\pkgnamefmt\@firstofone} % \AtBeginDocument {\let\pkgnamefmt\textsf} -%% <- This was here until v0.61, makes a difference for \acro{PDF} +%% <- This was here until v0.7, makes a difference for \acro{PDF} %% vs.\ 'blog' \HTML. Now we choose the same as with `\urlfmt': \providecommand*{\pkgnamefmt}{\textsf} %% Indeed, the same day we are providing `\textsf' in 'blog.sty'. @@ -243,8 +243,10 @@ %% <- 2012/03/09 etc. with Sec.~\ref{sec:bases} -> \newcommand*{\wikilangref}[1]{\httpbaseref{#1.wikipedia.org/wiki}} %% There is |\Wikilangref{<language-code>}{<lemma>}| -%% for the case that <lemma> and <text> are the same: -\newcommand*{\Wikilangref}[2]{\wikilangref{#1}{#2}{#2}} +%% for the case that <lemma> and <text> are the same. +%% With v0.7 however, this command becomes more powerful, +%% see Section~\ref{sec:pipe}. +% \newcommand*{\Wikilangref}[2]{\wikilangref{#1}{#2}{#2}} %% `\wikilangref{<lang>}[<lemma>]{<text>}' would be nicer; %% %% <- shortened 2012/01/06 -> %% however, the present code is to work with 'blog.sty' @@ -270,6 +272,59 @@ %% \ for \ %% \wikilangref{en}{TeX#History}{\TeX}. %% +%% === Piped Links === +%% \label{sec:pipe} +%% v0.7 emulates Wikipedia's +%% \wikiref{Help:Links\#Piped Links}{piped links} +%% as with Wikipedia source code \[`[[Pipeline|Pipe]]'\] +%% to get a link to article \qtd{Pipeline} with diplayed text +%% \qtd{\wikiref{Pipeline}{Pipe}}. The same syntax +%% (double brackets) is actually supported by +%% 'blog.sty' with 'blogexec.sty', while otherwise only +%% \[\GenCmdBox+\Wikilangref{<language-code>}{<lemma>|<text>}+\] +%% works---with settings more below something like +%% \GenCmdBox+\Wikiref{<lemma>|<text>}+---which +%% admittedly is not much better than the equivalent +%% \[`\wikiref{<lemma>}{<text>}'\] +%% +%% Even Wikipedia's feature that empty <text> 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} +%% 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: @@ -289,16 +344,21 @@ \newcommand*{\Wikiendisambref}{\Wikilangdisambref{en}} %% %% === ``Implicit" Choice of Language === %% 2012/01/06 +%% \label{sec:langcode} %% With v0.6, |\wikiref{<lemma>}{<text>}| works like -%% \[|\wikilang{<lc>}{<lemma>}{<text>}|\] when |\langcode| expands to <lc> +%% \[`\wikilangref{<lc>}{<lemma>}{<text>}'\] %% ref 2012/10/24 +%% when |\langcode| expands to <lc> %% (the two-letter language code according to \Wikiref{ISO 639-1}). -%% The default for <lc> is `en' for English. +%% The default for <lc> is \qtdcode{en} for English. %% It can be overridden even before loading 'texlinks' %% (e.g., by an earlier `\newcommand\langcode{de}'): \providecommand*{\langcode}{en} -%% For the German versions, use `\renewcommand\langcode{de}'. -%% You may find a package 'langcode' providing a command -%% `\uselangcode{<lc>}' that adjusts a number of other settings. +%% %% mod. 2012/10/24: +%% For the German versions, use \ `\renewcommand{\langcode}{de}'. \ +%% The \ctanpkgref{langcode} package provides a command \ +%% |\uselangcode{<lc>}| \ that works like +%% \ `\renewcommand*{\langcode}{<lc>}' \ +%% and adjusts a number of other settings. \newcommand*{\wikiref}{\wikilangref\langcode} %% |\Wikiref| and |Wikidisambref| are the obvious analogues: \newcommand*{\Wikiref}{\Wikilangref\langcode} @@ -363,7 +423,7 @@ % \@namedef{urluml:s}{\#C3\#9F} %% 2010/08/09 %% %% == \TeX-related == %% 2010/08/24 -%% === \CTAN === +%% === \CTAN === %% ==== 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 @@ -441,7 +501,7 @@ %% |\CtanPkgRef{<name>}{<Name>}| %% is a variant for the cases where authors have a special idea %% <Name> using some capital letters when they describe their packages -%% (ASCII versions of ``Logos" such as `BibTeX') +%% (ASCII versions of ``logos" such as `BibTeX') %% was Logos 2012/10/24 %% while the identifier <name> doesn't allow capital letters. %% %% 2011/01/24: %% Also, <Name> may be a package from a \emph{bundle} <name> @@ -452,40 +512,91 @@ \newcommand*{\CtanPkgRef}[2]{% \ctanorgbaseref{pkg/#1}{\pkgnamefmt{#2}}} \newcommand*{\ctanpkgref}[1]{\CtanPkgRef{#1}{#1}} -%% Jim Hefferon also offers pages listing all the packages +%% |\ctanpkgstyref{<name>}| %% 2012/11/27 +%% adds \qtdcode{.sty} to the package name: +\newcommand*{\ctanpkgstyref}[1]{\CtanPkgRef{#1}{#1.sty}} +%% Jim Hefferon also offers pages listing +%% of %% 2012/11/08 +%% all the packages %% of a given author, accessible by her/his <id>. %% |\ctanpkgauref{<id>}{<text>}| makes <text> a link to that page: \newcommand*{\ctanpkgauref}[1]{\ctanorgbaseref{author/id/#1}} %% E.g., see \ctanpkgauref{lueck}{\emph{my}} packages. %% -%% === \CTAN\ Announcements === %% 2011/06/27 +%% === Mailing Lists === +%% \label{sec:mail} +%% v0.7 relies on package \ctanpkgref{langcode} for +%% |\enmonthname{<month-number>}| and |\demonthname{<month-number>}|, +%% for tricks with language codes extending those in +%% Section~\ref{sec:langcode}: +\RequirePackage{langcode} +%% The next definitions are backbones for generating links to +%% web pages about \TeX\ mailing lists. +%% |\TL@piper@parse<year>-<month-number>-<id>| will be used +%% for referring to single postings: +\def\TL@piper@parse#1-#2-#3/{#1-\enmonthname{#2}/#3} +%% \[|\texlistyearmonthref<list-ref>{<2-digits>-<month-no>}|\] +%% will generate \ |<list-ref>{<path>}| \ for linking to the list of postings +%% of the <month-no>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{<path>} will be \qtdcode{20<2-digits>-<month>}, +%% and <month> will be the \emph{English} name of the +%% <month-no>th month of the year. +%% +%% \[|\texlanglistmonthref<month-cmd><list-ref>{<2-digits>-<month-no>}|\] +%% will generate \ |<list-ref>{<path>}{<month>}| \ +%% where <month> is determined from <month-no> by <month-cmd>: +\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<list-ref>{<2-digits>-<month-no>}| \ +%% now could be used for `<list-ref>{<path>}{<month>}' +%% \emph{German} <month> ... +\newcommand*{\detexlistmonthref}{\texlanglistmonthref\demonthname} +%% ... as could be \ |\entexlistmonthref<list-ref>{<2-digits>-<month-no>}| \ +%% for \emph{English} <month> ... +\newcommand*{\entexlistmonthref}{\texlanglistmonthref\enmonthname} +%% With proper use of \ctanpkgref{langcode} however, +%% \[|\texlistmonthref<list-ref>{<2-digits>-<month-no>}|\] +%% \emph{automatically} chooses between English and German <month> +%% (according to intention ...): +\newcommand*{\texlistmonthref}{\texlanglistmonthref\monthname} +%% +%% === \CTAN\ Announcements === %% 2011/06/27 %% |\ctanannref{<id>}{<text>}| makes <text> a link %% to the DANTE web page displaying a \CTAN\ %% announcement. You find <id> by searching %% \[\texttt{https://lists.dante.de/pipermail/ctan-ann/}\] %% and then reading the \URL. -%% <id> is composed as `<year>-<month>/<6-digits>.html'. +%% <id> is composed as +%% \[`<year>-<month>/<6-digits>.html'\]%%%, \[\] 2012/10/24 +%% %% 2012/10/24: +%% where <year> consists of 4 digits and <month> is an \emph{English} +%% month name: \newcommand*{\ctanannref}[1]{% \httpsref{lists.dante.de/pipermail/ctan-ann/#1}} %% |\ctanannpref{<id-code>}{<text>}| is a variant %% of `\ctanannref' where in place of <id> %% 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). +%% year (<2-digits>), then a \qtdcode{-}, then the (arabic) +%% number <month-no> of the month (cf. Section~\ref{sec:mail} so far), +%% then another \qtdcode{-}, +%% and then the actual internal identifier <running-no> +%% (a number of six digits preceding \qtdcode{.html} of the \URL). +%% I.e., \qtd{<id-code>} is \qtdcode{<2-digits>-<month-no>-<running-no>}. \newcommand*{\ctanannpref}[1]{% \ctanannref{\TL@piper@parse#1/.html}} -\def\TL@piper@parse#1-#2-#3/{% - #1-% - \ifcase #2\or - January\or February\or March\or April\or - May\or June\or July\or August\or - September\or October\or November\or December% 2010/12/23 - \fi - /#3} +%% \[|\ctanannyearmonthref{<2-digits>-<month-no>}|\] generates +%% `\ctanannref{<path>}' from \qtdcode{<2-digits>-<month-no>}---<path> +%% as in Section~\ref{sec:mail} ... +\newcommand*{\ctanannyearmonthref}{\texlistyearmonthref\ctanannref} +%% \[|\ctanannmonthref{<2-digits>-<month-no>}|\] generates +%% `\ctanannref{<path>}{<month>}' where <month> obeys `\langcode' ... +%% % from \qtdcode{<2-digits>-<month-no>} +\newcommand*{\ctanannmonthref}{\texlistmonthref\ctanannref} %% -%% === \acro{TUG} === +%% === \acro{TUG} === %% |\tugref{<path>}{<text>}| makes <text> a link %% to <path> on domain `tug.org': \newcommand*{\tugref}{\httpbaseref{tug.org}} @@ -514,7 +625,15 @@ \newcommand*{\texhaxpref}[1]{% %% 2010/09/07 \texhaxref{20\TL@piper@parse#1/.html}} %% 2011/05/03 %% TODO: `\texhaxPref#1' searches list of offsets -%% to determine year/month from id +%% to determine year/month from id ... +%% +%% \[|\texhaxyearmonthref{<2-digits>-<month-no>}|\] generates +%% `\texhaxref{<path>}' from \qtdcode{<2-digits>-<month-no>}---<path> +%% as in Section~\ref{sec:mail} ... +\newcommand*{\texhaxyearmonthref}{\texlistyearmonthref\texhaxref} +%% \[|\texhaxmonthref{<2-digits>-<month-no>}|\] generates +%% `\texhaxref{<path>}{<month>}' where <month> obeys `\langcode' ... +\newcommand*{\texhaxmonthref}{\texlistmonthref\texhaxref} %% %% ==== Other ==== %% %% 2011/04/27 corr. doc. vol/issue @@ -524,22 +643,27 @@ % \newcommand*{\tugbartref}[1]{\tugref{TUGboat/Articles/#1.pdf}} \newcommand*{\tugbartref}[1]{\tugref{TUGboat/#1.pdf}} %% %% <- 2011/04/30 -%% |\TUGIref{<anchor>}{<text>}| makes text a link to an <anchor> +%% |\tugiref{<anchor>}{<text>}| makes <text> %% <text> 2012/07/23 tugi 2012/08/05 +%% a link to an <anchor> %% on the \acro{TUG} web page entitled \qtd{TeX Resources on the Web} -%% (e.g., \TUGIref{web}{\qtd{Web Projects}}): -\newcommand*{\TUGIref}[1]{\tugref{interest.html\##1}} +%% (e.g., \tugiref{web}{\qtd{Web Projects}}): +\newcommand*{\tugiref}[1]{\tugref{interest.html\##1}} +%% It was `\TUGIref' until v0.6, we keep this for compatibility +%% (deprecated): +\newcommand*{\TUGIref}{} \let\TUGIref\tugiref %% -%% === \acro{UK FAQ} === +%% === \acro{UK FAQ} === %% |\ukfaqref{<label>}{<text>}| makes <text> a link to %% the UK~\TeX~FAQ page with ``label"~= <label>: \newcommand*{\ukfaqref}[1]{\httpref{% www.tex.ac.uk/cgi-bin/texfaq2html?label=#1}} -%% === Wikibooks === -%% |\wikilangbooks{<language-code>}{<file>}{<text>}| +%% === Wikibooks === +%% |\wikilangbooksref{<language-code>}{<book>/<subject>}{<text>}| +%% %% <- ref 2012/10/04, <book>/<subject> \newcommand*{\wikilangbooksref}[1]{% %% `lang' 2012/01/06 \httpbaseref{#1.wikibooks.org/wiki}} -%% |\latexwikibookref{<file>}{<subject>}{<text>}| refers to the -%% (English) \LaTeX\ Wikibook: +%% |\latexwikibookref{<subject>}{<text>}| refers to the %% rm. extra arg. 2012/10/24 +%% (English) \latexwikibookref{}{\LaTeX\ Wikibook:} \newcommand*{\latexwikibookref}[1]{\wikilangbooksref{en}{LaTeX/#1}} %% The German %% \wikilangbooksref{de}{LaTeX-Kompendium}{\dqtd{\LaTeX-Kompendium}} @@ -586,3 +710,15 @@ v0.6 2012/01/06 \wikilangref etc., \wikiref etc. depend on 2012/04/09 \ctanorgbaseref, \ctanpkgauref 2012/04/10 makedoc link works! 2012/05/13 example for \wikilangref corrected +uploaded with MOREHYPE r0.6 +v0.7 2012/07/23 doc.: <text> + 2012/08/05 \tugiref + 2012/10/04 doc. wikibooks: ref + 2012/10/24 ...monthref... requiring `langcode.sty', moving + links to mailing list pages from `texblog.fdf' + here; doc.: \pagebreak s, wikibooks: <book>..., + corr. args, \wikiref refers to `langcode.sty', + `ref', using \qtdcode (new in `makedoc.cfg') + 2012/11/08 doc.: Jim corr. + 2012/11/27 \ctanpkgstyref from 'texblog.fdf' + 2012/11/28 [[...|...]] |