summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-02-28 23:47:35 +0000
committerKarl Berry <karl@freefriends.org>2012-02-28 23:47:35 +0000
commitf7da2a17818db423b8221e8e0e3b743e1ff9abca (patch)
treeef3181fb602ef44a8d8c06930dfeeabd61822592
parent7e858432b363bfd725a253e408a5363af514ba64 (diff)
new latex package issuulinks (28feb12)
git-svn-id: svn://tug.org/texlive/trunk@25534 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/issuulinks/Makefile65
-rw-r--r--Master/texmf-dist/doc/latex/issuulinks/README21
-rw-r--r--Master/texmf-dist/doc/latex/issuulinks/issuulinks.pdfbin0 -> 258047 bytes
-rw-r--r--Master/texmf-dist/doc/latex/issuulinks/sample.pdfbin0 -> 117797 bytes
-rw-r--r--Master/texmf-dist/doc/latex/issuulinks/sample.tex39
-rw-r--r--Master/texmf-dist/source/latex/issuulinks/issuulinks.dtx277
-rw-r--r--Master/texmf-dist/source/latex/issuulinks/issuulinks.ins29
-rw-r--r--Master/texmf-dist/tex/latex/issuulinks/issuulinks.sty83
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check2
-rw-r--r--Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc1
-rw-r--r--Master/tlpkg/tlpsrc/issuulinks.tlpsrc0
11 files changed, 516 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/issuulinks/Makefile b/Master/texmf-dist/doc/latex/issuulinks/Makefile
new file mode 100644
index 00000000000..70b153def03
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/issuulinks/Makefile
@@ -0,0 +1,65 @@
+#
+# Makefile for issuulinks package
+#
+# This file is in public domain
+#
+# $Id: Makefile,v 1.2 2012-02-25 21:06:49 boris Exp $
+#
+
+PACKAGE=issuulinks
+
+SAMPLESTEX = sample.tex
+
+SAMPLESPDF = ${SAMPLESTEX:%.tex=%.pdf}
+
+all: $(PACKAGE).pdf $(SAMPLESPDF)
+
+
+%.pdf: %.dtx $(PACKAGE).sty
+ pdflatex $<
+ - bibtex $*
+ pdflatex $<
+ - makeindex -s gind.ist -o $*.ind $*.idx
+ - makeindex -s gglo.ist -o $*.gls $*.glo
+ pdflatex $<
+ while ( grep -q '^LaTeX Warning: Label(s) may have changed' $*.log) \
+ do pdflatex $<; done
+
+
+%.pdf: %.tex $(PACKAGE).sty
+ pdflatex $<
+ - bibtex $*
+ pdflatex $<
+ - makeindex -o $*.ind $*.idx
+ pdflatex $<
+ while ( grep -q '^LaTeX Warning: Label(s) may have changed' $*.log) \
+ do pdflatex $<; done
+
+
+
+%.sty: %.ins %.dtx
+ pdflatex $<
+
+
+
+.PRECIOUS: $(PACKAGE).cfg $(PACKAGE).sty
+
+
+clean:
+ $(RM) *.sty *.log *.aux \
+ *.cfg *.glo *.idx *.toc \
+ *.ilg *.ind *.out *.lof \
+ *.lot *.bbl *.blg *.gls \
+ *.dvi *.ps *.hd
+
+distclean veryclean: clean
+ $(RM) *.pdf
+
+#
+# Archive for the distribution. Includes typeset documentation
+#
+archive: all clean
+ cd ..; \
+ tar -czvf $(PACKAGE).tgz --exclude '*~' --exclude '*.tgz' --exclude CVS $(PACKAGE);\
+ mv $(PACKAGE).tgz $(PACKAGE);\
+ cd $(PACKAGE)
diff --git a/Master/texmf-dist/doc/latex/issuulinks/README b/Master/texmf-dist/doc/latex/issuulinks/README
new file mode 100644
index 00000000000..9135b45b0d7
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/issuulinks/README
@@ -0,0 +1,21 @@
+ Package issuulinks
+ Boris Veytsman
+ v1.0
+
+PDF visualizer ISSUU (http://issuu.com) is a popular service
+allowing to show PDF documents ``one page a time''. Due to the way
+it is implemented, internal links in these documents are not
+allowed. Instead, they must be converted to external ones in the
+form http://issuu.com/action/page?page=PAGENUMBER.
+
+This package patches hyperref to produce external links in the
+required form instead of internal links created by \ref, \cite and
+other commands.
+
+Since the package redefines the internals of hyperref, you need to
+call it AFTER hyperref.
+
+The author is grateful to FAO UN which partially funded this work
+and to Matthieu Stigler, Adam Prakash \& Filippo Gheri for
+suggesting and testing this package.
+
diff --git a/Master/texmf-dist/doc/latex/issuulinks/issuulinks.pdf b/Master/texmf-dist/doc/latex/issuulinks/issuulinks.pdf
new file mode 100644
index 00000000000..b57bbd62700
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/issuulinks/issuulinks.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/issuulinks/sample.pdf b/Master/texmf-dist/doc/latex/issuulinks/sample.pdf
new file mode 100644
index 00000000000..cc36c8d056f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/issuulinks/sample.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/issuulinks/sample.tex b/Master/texmf-dist/doc/latex/issuulinks/sample.tex
new file mode 100644
index 00000000000..c195d05fdf5
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/issuulinks/sample.tex
@@ -0,0 +1,39 @@
+\documentclass{article}
+\usepackage{lipsum,makeidx,natbib,hyperref}
+\usepackage{issuulinks}
+\makeindex
+\begin{document}
+\title{Sample Document for Issuulinks}
+\author{Boris Veytsman}
+\date{2012}
+\maketitle
+\tableofcontents
+\clearpage
+\section{First Section}
+\label{sec:first}
+
+The next section is Section~\ref{sec:second},
+called~\nameref{sec:second} on page~\pageref{sec:second}.
+
+See also~\cite{Knuth94:TheTeXbook} and~\cite{Lamport94} and
+\url{http://www.tug.org}.
+
+\lipsum[1-2]\index{blandit}\index{ligula|(}
+\lipsum[5-8]\index{ligula|)}\index{dolor|see{blandit}}
+
+\begin{equation}
+ \label{eq:trig}
+ e^{i\phi} = \cos\phi+i\sin\phi
+\end{equation}
+
+\pagenumbering{roman}
+
+\section{Second Section}
+\label{sec:second}
+
+\lipsum[10-14]
+See equation~(\ref{eq:trig}) on page~\pageref{eq:trig}.
+\printindex
+\bibliography{tex}
+\bibliographystyle{abbrvnat}
+\end{document}
diff --git a/Master/texmf-dist/source/latex/issuulinks/issuulinks.dtx b/Master/texmf-dist/source/latex/issuulinks/issuulinks.dtx
new file mode 100644
index 00000000000..8223de7cf2f
--- /dev/null
+++ b/Master/texmf-dist/source/latex/issuulinks/issuulinks.dtx
@@ -0,0 +1,277 @@
+% \iffalse
+% $Id: issuulinks.dtx,v 1.5 2012-02-28 01:48:35 boris Exp $
+%
+% Copyright 2012, Boris Veytsman <borisv@lk.net>
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3 of this license or (at your option) any
+% later version.
+% The latest version of the license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2003/06/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Boris Veytsman
+%
+% This work consists of the file issuulinks.dtx and the
+% derived files issuulinks.sty, issuulinks.dtx.
+%
+% \fi
+% \CheckSum{83}
+%
+%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%
+% \MakeShortVerb{|}
+%
+%\GetFileInfo{issuulinks.dtx}
+% \title{Produce External Links Instead of Internal
+% Ones\thanks{\copyright Boris Veytsman, 2012}}
+% \author{Boris Veytsman\thanks{This work was partially supported by
+% The Food and Agriculture Organization of the United Nations}}
+% \date{\filedate, \fileversion}
+% \maketitle
+%
+% \begin{abstract}
+% A package to change automatic internal links in a document into
+% external ones in the form
+% \path{http://issue.com/action/page=PAGENUMBER} as required by
+% \url{http://issuu.com}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \clearpage
+%
+%\section{Introduction}
+%\label{sec:intro}
+%
+% PDF visualizer ISSUU (\url{http://issuu.com}) is a popular service
+% allowing to show PDF documents ``one page a time''. Due to the way
+% it is implemented, internal links in these documents are not
+% allowed. Instead, they must be converted to external ones in the
+% form \path{http://issuu.com/action/page?page=PAGENUMBER}.
+%
+% This package patches \textsf{hyperref} to produce external links in
+% the required form instead of internal links created by |\ref|,
+% |\cite| and other commands.
+%
+% Since the package redefines the internals of \textsf{hyperref}, you
+% need to call it \emph{after} \textsf{hyperref}.
+%
+% The author is grateful to FAO UN which partially funded this work
+% and to Matthieu Stigler, Adam Prakash \& Filippo Gheri for
+% suggesting and testing this package.
+%
+%\section{Usage}
+%\label{sec:usage}
+%
+% To use this package just add |\usepackage{issuulinks}| \emph{after}
+% calling \textsf{hyperref}. By default all links will be converted
+% into the form required by ISSUU.
+%
+% \DescribeMacro{\issuusetup}
+% The command |\issuusetup|\marg{setup commands} might be used to
+% customize the behavior of the package. At present the only
+% customizable command is |prefix|, that sets the part of the link
+% before |PAGENUMBER|by default
+% |http://issuu.com/action/page?page=|. You can change it, for example,
+% \begin{verbatim}
+% \issuusetup{prefix={http://www.issuu.com/action/page?page=}}
+% \end{verbatim}
+%
+% Otherwise the work of the package should be transparent for the
+% user.
+%
+%\StopEventually{}
+%
+% \clearpage
+%
+% \section{Implementation}
+% \label{sec:implementation}
+%
+%
+%\subsection{Algorithm}
+%\label{sec:alg}
+%
+% The idea is following. Whenever \textsf{hyperref} creates an
+% internal anchor \marg{name}, we write to the aux file the command
+% \cmd{\newISSUUlink}\marg{name}\marg{abspage}, where \marg{abspage}
+% is the absolute page number (as different from the displayed page
+% number). Then when \textsf{hyperref} creates an internal link to
+% \marg{name}, we substitute this to a call to \url{http://issuu.com}
+% with the corresponding page number.
+%
+%\subsection{Declarations}
+%\label{sec:decl}
+%
+% We start with declaration, who we are:
+%
+% \changes{v1.0}{2012/02/27}{First released version}
+% \begin{macrocode}
+%<style>\NeedsTeXFormat{LaTeX2e}
+%<*gobble>
+\ProvidesFile{issuulinks.dtx}
+%</gobble>
+%<style>\ProvidesPackage{issuulinks}
+[2012/02/27 v1.0 Links in ISSUU style]
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*gobble>
+\documentclass{ltxdoc}
+\usepackage{hypdoc}
+\usepackage{url}
+\CodelineIndex
+\RecordChanges
+\EnableCrossrefs
+\begin{document}
+ \DocInput{issuulinks.dtx}
+\end{document}
+%</gobble>
+%<*style>
+% \end{macrocode}
+%
+%
+%\subsection{Parameters}
+%\label{sec:params}
+%
+% We use \textsf{keyval} to process options:
+% \begin{macrocode}
+\RequirePackage{xkeyval}
+% \end{macrocode}
+%
+% \begin{macro}{\issuusetup}
+% The shorthand for setting options:
+% \begin{macrocode}
+\def\issuusetup#1{\setkeys{ISL}{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ISL@prefix}
+% The |prefix| macro:
+% \begin{macrocode}
+\define@key{ISL}{prefix}{\def\ISL@prefix{#1}}
+\issuusetup{prefix={http://issuu.com/action/page?page=}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+%
+%\subsection{Working with Aux File}
+%\label{sec:file}
+%
+%
+% \begin{macro}{\newISSUUlink}
+% The page numbers in |\Hy@abspage| start from zero, so we need to
+% increment them:
+% \begin{macrocode}
+\def\newISSUUlink#1#2{\@tempcnta=#2\relax\advance\@tempcnta by1\relax
+ \expandafter\xdef\csname ISL@link#1\endcsname{\the\@tempcnta}}
+% \end{macrocode}
+% Someone can use an aux file from the previous run, so we provide a
+% safety valve:
+% \begin{macrocode}
+\AtBeginDocument{%
+ \if@filesw
+ \immediate\write\@mainaux{\string\providecommand\string\newISSUUlink[2]{}}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%\subsection{Writing the Internal Link Information}
+%\label{sec:writing}
+%
+% \begin{macro}{\new@pdflink}
+% We patch |\new@pdflink| to write its argument into the aux file.
+% Note that the counter |\Hy@abspage| stores the absolute page
+% position in \textsl{hyperref}. We do not prevent writing the
+% internal anchor in the catalog---probably a waste of time and
+% bits, but somebody might rely on this for some other
+% purpose\footnote{Actually I am too lazy to do otherwise\dots}.
+% \begin{macrocode}
+\let\new@pdflink@ISLorig=\new@pdflink
+\def\new@pdflink#1{%
+ \@bsphack
+ \protected@write\@mainaux{}%
+ {\string\newISSUUlink{#1}{\the\Hy@abspage}}%
+ \@esphack
+ \new@pdflink@ISLorig{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%\subsection{Patching Internal Links}
+%\label{sec:patching}
+%
+%
+% \begin{macro}{\Hy@StartlinkName}
+% The standard |\Hy@StartlinkName| is defined like this:
+% \begin{verbatim}
+% \def\Hy@StartlinkName#1#2{%
+% \pdfstartlink attr{#1}goto name{#2}\relax
+% }
+% \end{verbatim}
+% Here we are patching it. Note that we can have bad links if we use
+% `old' aux file
+% \begin{macrocode}
+\def\Hy@StartlinkName#1#2{%
+ \expandafter\ifx\csname ISL@link#2\endcsname\relax
+ \PackageWarning{issuulinks}{The page number for an external link
+ is not defined. Setting it to 1. You need to rerun LaTeX to
+ get the page numbers right.}%
+ \expandafter\def\csname ISL@link#2\endcsname{1}\fi
+ \edef\Hy@pstringURI{\ISL@prefix\csname ISL@link#2\endcsname}%
+ \pdfstartlink attr{#1}%
+ user{%
+ /Subtype/Link%
+ \ifHy@pdfa /F 4\fi
+ /A<<%
+ /Type/Action%
+ /S/URI%
+ /URI(\Hy@pstringURI)%
+ \ifHy@href@ismap
+ /IsMap true%
+ \fi
+ \Hy@href@nextactionraw
+ >>%
+ }%
+ \relax
+}
+% \end{macrocode}
+%
+%
+%
+% \end{macro}
+%
+%
+%
+% \begin{macrocode}
+%</style>
+% \end{macrocode}
+%\Finale
+%\clearpage
+%
+%\PrintChanges
+%\clearpage
+%\PrintIndex
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/issuulinks/issuulinks.ins b/Master/texmf-dist/source/latex/issuulinks/issuulinks.ins
new file mode 100644
index 00000000000..796ac004c05
--- /dev/null
+++ b/Master/texmf-dist/source/latex/issuulinks/issuulinks.ins
@@ -0,0 +1,29 @@
+%
+% Doctrip file for issuulinks
+% This file is in public domain
+% $Id: issuulinks.ins,v 1.1 2012-02-23 23:14:53 boris Exp $
+%
+\def\batchfile{issuulinks.ins}
+\input docstrip
+\keepsilent
+\showprogress
+
+
+\askforoverwritefalse
+
+\generate{%
+ \file{issuulinks.sty}{\from{issuulinks.dtx}{style}}}
+
+\obeyspaces
+\Msg{*****************************************************}%
+\Msg{* Congratulations! You successfully generated the *}%
+\Msg{* issuulinks package. *}%
+\Msg{* *}%
+\Msg{* Please move the file issuulinks.sty to where *}%
+\Msg{* LaTeX files are kept in your system. The manual *}%
+\Msg{* for the package is in the file issuulinks.pdf. *}%
+\Msg{* *}%
+\Msg{* The package is released under LPPL *}%
+\Msg{* *}%
+\Msg{* Happy TeXing! *}%
+\Msg{*****************************************************}% \ No newline at end of file
diff --git a/Master/texmf-dist/tex/latex/issuulinks/issuulinks.sty b/Master/texmf-dist/tex/latex/issuulinks/issuulinks.sty
new file mode 100644
index 00000000000..6e2b63754c3
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/issuulinks/issuulinks.sty
@@ -0,0 +1,83 @@
+%%
+%% This is file `issuulinks.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% issuulinks.dtx (with options: `style')
+%%
+%% IMPORTANT NOTICE:
+%%
+%% For the copyright see the source file.
+%%
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from issuulinks.sty.
+%%
+%% For distribution of the original source see the terms
+%% for copying and modification in the file issuulinks.dtx.
+%%
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{issuulinks}
+[2012/02/27 v1.0 Links in ISSUU style]
+\RequirePackage{xkeyval}
+\def\issuusetup#1{\setkeys{ISL}{#1}}
+\define@key{ISL}{prefix}{\def\ISL@prefix{#1}}
+\issuusetup{prefix={http://issuu.com/action/page?page=}}
+\def\newISSUUlink#1#2{\@tempcnta=#2\relax\advance\@tempcnta by1\relax
+ \expandafter\xdef\csname ISL@link#1\endcsname{\the\@tempcnta}}
+\AtBeginDocument{%
+ \if@filesw
+ \immediate\write\@mainaux{\string\providecommand\string\newISSUUlink[2]{}}%
+ \fi}
+\let\new@pdflink@ISLorig=\new@pdflink
+\def\new@pdflink#1{%
+ \@bsphack
+ \protected@write\@mainaux{}%
+ {\string\newISSUUlink{#1}{\the\Hy@abspage}}%
+ \@esphack
+ \new@pdflink@ISLorig{#1}}
+\def\Hy@StartlinkName#1#2{%
+ \expandafter\ifx\csname ISL@link#2\endcsname\relax
+ \PackageWarning{issuulinks}{The page number for an external link
+ is not defined. Setting it to 1. You need to rerun LaTeX to
+ get the page numbers right.}%
+ \expandafter\def\csname ISL@link#2\endcsname{1}\fi
+ \edef\Hy@pstringURI{\ISL@prefix\csname ISL@link#2\endcsname}%
+ \pdfstartlink attr{#1}%
+ user{%
+ /Subtype/Link%
+ \ifHy@pdfa /F 4\fi
+ /A<<%
+ /Type/Action%
+ /S/URI%
+ /URI(\Hy@pstringURI)%
+ \ifHy@href@ismap
+ /IsMap true%
+ \fi
+ \Hy@href@nextactionraw
+ >>%
+ }%
+ \relax
+}
+\endinput
+%%
+%% End of file `issuulinks.sty'.
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 5c1155ba519..b58b04ea780 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -206,7 +206,7 @@ my @TLP_working = qw(
interactiveworkbook interfaces interpreter intro-scientific
inversepath invoice
ionumbers iopart-num ipaex iso
- iso10303 isodate isodoc isomath isonums isorot isotope itnumpar
+ iso10303 isodate isodoc isomath isonums isorot isotope issuulinks itnumpar
iwhdp iwona
jablantile jamtimes japanese japanese-otf japanese-otf-uptex
jeopardy jfontmaps jknapltx jlabels jmlr jneurosci jpsj junicode
diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
index 237b4ecba2a..5cb42fdf452 100644
--- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
@@ -350,6 +350,7 @@ depend isonums
depend isodoc
depend isorot
depend isotope
+depend issuulinks
depend iwhdp
depend jlabels
depend jvlisting
diff --git a/Master/tlpkg/tlpsrc/issuulinks.tlpsrc b/Master/tlpkg/tlpsrc/issuulinks.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/issuulinks.tlpsrc