texlive[41870] Master: phfsvnwatermark (16aug16)

commits+karl at tug.org commits+karl at tug.org
Tue Aug 16 23:46:50 CEST 2016


Revision: 41870
          http://tug.org/svn/texlive?view=revision&revision=41870
Author:   karl
Date:     2016-08-16 23:46:50 +0200 (Tue, 16 Aug 2016)
Log Message:
-----------
phfsvnwatermark (16aug16)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/
    trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/Makefile
    trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/README.md
    trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/phfsvnwatermark.pdf
    trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/pkg.mk
    trunk/Master/texmf-dist/source/latex/phfsvnwatermark/
    trunk/Master/texmf-dist/source/latex/phfsvnwatermark/phfsvnwatermark.dtx
    trunk/Master/texmf-dist/source/latex/phfsvnwatermark/phfsvnwatermark.ins
    trunk/Master/texmf-dist/tex/latex/phfsvnwatermark/
    trunk/Master/texmf-dist/tex/latex/phfsvnwatermark/phfsvnwatermark.sty
    trunk/Master/tlpkg/tlpsrc/phfsvnwatermark.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/Makefile	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/Makefile	2016-08-16 21:46:50 UTC (rev 41870)
@@ -0,0 +1,10 @@
+
+PKG = phfsvnwatermark
+
+-include pkg.mk
+
+pkg.mk:
+	ln -sf ../mkcommon/pkg.mk pkg.mk
+
+install:  install_sty install_doc
+


Property changes on: trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/README.md	2016-08-16 21:46:50 UTC (rev 41870)
@@ -0,0 +1,13 @@
+# The phfsvnwatermark package
+
+Add a watermark on each page with version control information from SVN.
+
+This package allows you to add version control information as a gray watermark
+on each page of your document. The SVN info is read from keyword tags such as
+$Id$, $Date$ and $Author$ via the `svn` or `svn-multi` packages.
+
+
+# Documentation
+
+Run 'make sty' to generate the style file and 'make pdf' to generate the package
+documentation. Run 'make' or 'make help' for more info.


Property changes on: trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/phfsvnwatermark.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/phfsvnwatermark.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/phfsvnwatermark.pdf	2016-08-16 21:46:19 UTC (rev 41869)
+++ trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/phfsvnwatermark.pdf	2016-08-16 21:46:50 UTC (rev 41870)

Property changes on: trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/phfsvnwatermark.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/pkg.mk
===================================================================
--- trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/pkg.mk	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/pkg.mk	2016-08-16 21:46:50 UTC (rev 41870)
@@ -0,0 +1,167 @@
+
+#
+# Common useful definitions
+#
+LATEX = latex
+
+PDFLATEX = TEXINPUTS="$$TEXINPUTS:../phfnote" pdflatex
+PDFLATEXOPTS = -interaction=batchmode
+PDFLATEXOPTSLAST = -interaction=batchmode --synctex=1
+
+MAKEINDEX = makeindex
+
+
+#
+# Set default PREFIX. This can be overridden with 'make install PREFIX=/installation/directory'
+#
+DEFAULT_PREFIX := $(shell kpsewhich -var-value TEXMFHOME)
+PREFIX ?= $(DEFAULT_PREFIX)
+
+
+#
+# package should be set in variable PKG
+#
+PKGREADME = README.md
+
+#
+# packages may specify additional files in the distribution with this variable
+# (by default empty)
+#
+DIST_ADDITIONAL_FILES ?= 
+
+
+PKGDTX = $(PKG).dtx
+PKGINS = $(PKG).ins
+PKGSTY = $(PKG).sty
+PKGPDF = $(PKG).pdf
+PKGTDSZIP = $(PKG).tds.zip
+PKGZIP = $(PKG).zip
+
+
+
+.PHONY: help sty pdf install install_sty install_doc tdszip dist clean cleanall cleansty cleanaux cleanpdf cleantdszip cleandist
+
+
+help:
+	@echo "Targets for $(PKG):"
+	@echo "make sty             -- generate LaTeX package file $(PKG).sty"
+	@echo "make pdf             -- generate pdf documentation"
+	@echo "make install         -- install style and documentation files to TEXMF tree"
+	@echo "make install PREFIX=[specify texmf directory]"
+	@echo "make $(PKG).tds.zip  -- create TDS.ZIP to include in CTAN upload"
+	@echo "make dist            -- create distribution ZIP, ready for upload to CTAN"
+	@echo "make clean           -- remove LaTeX auxiliary files"
+	@echo "make cleansty        -- remove generated style file"
+	@echo "make cleanpdf        -- remove generated pdf documentation"
+	@echo "make cleanall        -- remove all generated files, incl. distribution zip"
+
+
+clean: cleanaux
+
+cleanall: cleansty cleanaux cleanpdf cleantdszip cleandist
+
+# ------------------------------------------------
+# make sty
+# ------------------------------------------------
+
+sty: $(PKGSTY)
+
+$(PKGSTY): $(PKGINS) $(PKGDTX)
+	$(LATEX) $<
+
+cleansty:
+	@rm -f $(PKGSTY)
+
+# ------------------------------------------------
+# make pdf
+# ------------------------------------------------
+
+pdf: $(PKG).pdf
+
+#
+# fake index & glossary so they get a TOC entry from the beginning, and so the page
+# numbers in the index are correct.
+#
+$(PKG).aux $(PKG).idx $(PKG).glo: $(PKGDTX) $(PKGSTY)
+	DTX=$< ; echo '\\begin{theindex}\\item index here \\end{theindex}' >$${DTX%.dtx}.ind
+	DTX=$< ; echo '\\begin{theglossary}\\item changes here\\end{theglossary}' >$${DTX%.dtx}.gls
+	$(PDFLATEX) $(PDFLATEXOPTS) $<
+	$(PDFLATEX) $(PDFLATEXOPTS) $<
+	$(PDFLATEX) $(PDFLATEXOPTS) $<
+
+$(PKG).ind: $(PKG).idx
+	$(MAKEINDEX) -s gind.ist -o $@ $<
+
+$(PKG).gls: $(PKG).glo
+	$(MAKEINDEX) -s gglo.ist -o $@ $<
+
+# final steps of making the PKG.pdf doc file.  At the end, touch the ind and gls files so
+# that they don't look out-of-date (because the idx and glo files were overwritten again)
+$(PKGPDF): $(PKGDTX) $(PKG).aux $(PKG).ind $(PKG).gls
+	$(PDFLATEX) $(PDFLATEXOPTS) $<
+	$(PDFLATEX) $(PDFLATEXOPTS) $<
+	$(PDFLATEX) $(PDFLATEXOPTSLAST) $<
+	touch $(PKG).ind $(PKG).gls $(PKG).pdf
+
+
+cleanaux:
+	@rm -f *.aux *.log *.toc *.glo *.gls *.ind *.idx *.ilg *.out *.bbl *.blg *.synctex.gz *.hd
+
+cleanpdf:
+	@rm -f $(PKGPDF)
+
+# ------------------------------------------------
+# 'make install' partial installation targets
+# ------------------------------------------------
+
+#
+# The install target itself is defined per-package, in case packages want to install more
+# files (such as bibtex styles)
+#
+
+install_sty: $(PKGSTY)
+	mkdir -p $(DESTDIR)$(PREFIX)/tex/latex/$(PKG)
+	cp $(PKGSTY)  $(DESTDIR)$(PREFIX)/tex/latex/$(PKG)
+
+install_doc: $(PKGPDF)
+	mkdir -p $(DESTDIR)$(PREFIX)/doc/latex/$(PKG)
+	cp $(PKGPDF) $(PKGREADME)  $(DESTDIR)$(PREFIX)/doc/latex/$(PKG)
+
+
+
+# ------------------------------------------------
+# make tdszip
+# ------------------------------------------------
+
+TDSTMPDIR = $(CURDIR)/_install_tds_zip.make.tmp
+
+tdszip: $(PKGTDSZIP)
+
+$(PKGTDSZIP): $(PKGSTY) $(PKGPDF)
+	mkdir $(TDSTMPDIR)
+	$(MAKE) install PREFIX=$(TDSTMPDIR)
+	cd $(TDSTMPDIR) && zip -r $(CURDIR)/$(PKGTDSZIP) *
+	rm -rf $(TDSTMPDIR)
+
+cleantdszip:
+	@rm -f $(PKGTDSZIP)
+
+
+# ------------------------------------------------
+# make dist
+# ------------------------------------------------
+
+DISTTMPDIR = $(CURDIR)/_install_dist_zip.make.tmp
+
+dist: $(PKGZIP)
+
+$(PKGZIP): $(PKGTDSZIP)
+	rm -rf $(DISTTMPDIR)
+	mkdir -p $(DISTTMPDIR)/$(PKG)
+	cp $(PKGTDSZIP) $(DISTTMPDIR)
+	cp $(PKGDTX) $(PKGINS) $(PKGPDF) $(PKGREADME) Makefile pkg.mk $(DIST_ADDITIONAL_FILES) $(DISTTMPDIR)/$(PKG)
+	cd $(DISTTMPDIR) && zip -r $(CURDIR)/$(PKGZIP) $(PKGTDSZIP) $(PKG)
+	rm -rf $(DISTTMPDIR)
+
+cleandist:
+	@rm -f $(PKGZIP)


Property changes on: trunk/Master/texmf-dist/doc/latex/phfsvnwatermark/pkg.mk
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/phfsvnwatermark/phfsvnwatermark.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/phfsvnwatermark/phfsvnwatermark.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/phfsvnwatermark/phfsvnwatermark.dtx	2016-08-16 21:46:50 UTC (rev 41870)
@@ -0,0 +1,553 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2016 by Philippe Faist <philippe.faist at bluewin.ch>
+% -------------------------------------------------------
+% 
+% This file 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 this license is in:
+%
+%    http://www.latex-project.org/lppl.txt
+%
+% and version 1.3 or later is part of all distributions of LaTeX 
+% version 2005/12/01 or later.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{phfsvnwatermark.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+%<package>\ProvidesPackage{phfsvnwatermark}
+%<*package>
+    [2016/08/15 v1.0 phfsvnwatermark package]
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{xcolor}
+\usepackage[id=svn-multi,watermark=false]{phfsvnwatermark}
+\svnid{$Id$}
+\usepackage[preset=xpkgdoc]{phfnote}
+\EnableCrossrefs         
+\CodelineIndex
+\RecordChanges
+\begin{document}
+  \DocInput{phfsvnwatermark.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{0}
+%
+% \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         \~}
+%
+%
+% \changes{v1.0}{2016/05/03}{Initial version}
+%
+% \GetFileInfo{phfsvnwatermark.dtx}
+%
+% \DoNotIndex{\newcommand,\newenvironment,\def,\gdef,\edef,\xdef,\if,\else,\fi,\ifx}
+% 
+% \title{\phfqitltxPkgTitle{phfsvnwatermark}}
+% \author{Philippe Faist\quad\email{philippe.faist at bluewin.ch}}
+% \date{\pkgfmtdate\filedate}
+% \maketitle
+%
+% \begin{abstract}
+%   \pkgname{phfsvnwatermark}---Add a watermark on each page with version control
+%   information from SVN.
+% \end{abstract}
+%
+% \inlinetoc
+%
+% \section{Introduction}
+%
+% This package allows you to add version control information as a gray watermark on each
+% page of your document.
+%
+% The watermark may be placed automatically on each page, or its placement may be
+% controlled manually by the user.
+%
+% It is based on reading SVN keywords from your source file (e.g.\@ |$Id$|, which SVN
+% expands upon the following commit to |$Id: file.tex ... $|).  The tags are read with
+% either the \pkgname{svn} or \pkgname{svn-multi} packages (at your option).
+%
+% There is also decent support for multiple files, with \pkgname{svn-multi} and
+% \pkgname{currfile}.  This allows to both display overall document version information as
+% well as information for the current file.
+%
+%
+% \section{SVN Identification Methods}
+%
+% The SVN version of the input file(s) is read with the help of SVN keyword |$Id$|.  (The
+% \pkgname{svn} package may also read |$Date$| and |$Author$|, I'm not sure any more [TODO: CHECK].)
+%
+% Don't forget to enable source keyword expansion for your \LaTeX{} source(s).  This is
+% done with the help of the command:
+% \begin{verbatim}
+%   svn propset svn:keywords "Id Date Author"  my-file.tex
+% \end{verbatim}
+% 
+% You must specify an identification method with the package option |id=|\meta{method}.
+%
+% \begin{pkgoptions}
+% \item[id=svn] Read the keywords with the \pkgname{svn} package.  Keywords are set in the
+%   file with the command |\SVN $Id$|.  (The |$Id$| keyword contains all the relevant
+%   information and only this one needs to be set.)  See below.
+% \item[id=gitnotsvn] Read the keywords with the \pkgname{svn} pacakge.  However, a script
+%   is used to fake these tags from what are in fact GIT meta-information.  This causes
+%   |$Id$| not to contain all the information, and the |$Date$| and |$Author$| tags must
+%   be read and included in the watermark, as well.  See below.
+% \item[id=svn-multi] Read the keywords with the \pkgname{svn-multi} package.  The ID
+%   information is set with the command |\svnid{$Id$}|.  (The |$Id$| keyword contains all
+%   the relevant information.)  See below.
+% \item[id=svn-multi-currfile] Read the keywords with the \pkgname{svn-multi} package, with
+%   \pkgname{currfile} support.  Ideal for a document with multiple source files which are
+%   |\input| into each other.  The ID information is set in each file with the command
+%   |\svnid{$Id$}|.  (The |$Id$| keyword contains all the relevant information.)  See
+%   below.
+% \end{pkgoptions}
+%
+% In each case, the relevant SVN package is automatically loaded \pkgname{svn},
+% \pkgname{svn-multi} and/or \pkgname{currfile}.
+%
+%
+% \subsection{SVN Keywords read with the \pkgname{svn} package}
+%
+%
+% Probably the most straightforward solution.  Just introduce in your \LaTeX{} source
+% file, somewhere near the top, the line:
+% \begin{verbatim}
+% \SVN $Id$
+% \end{verbatim}
+%
+% Don't forget to enable source keyword expansion for this \LaTeX{} file, and next time
+% you commit your file to SVN, the |$Id$| tag will be replaced by something like:
+% \begin{verbatim}
+% \SVN $Id: thesis.tex 1488 2016-05-03 16:19:34Z pfaist $
+% \end{verbatim}
+% which identifies the file version.
+%
+%
+%
+% \subsection{GIT information faked as SVN keywords and read with the \pkgname{svn} package}
+%
+% \begin{pkgwarning}
+%   This method is buggy, and keywords won't always get updated.  I'm currently seeking a
+%   better method.  Unfortunately all methods for obtaining GIT meta-data require running
+%   GIT hooks or auxiliary scripts.
+%
+%   To force update the GIT keywords, make sure you file has no local modifications,
+%   delete the file and run |git checkout |\meta{file}.
+% \end{pkgwarning}
+%
+% The idea is to use the same keyword parsing engine, with the \pkgname{svn} package, but
+% to plug in the GIT meta-information instead inside faked svn keyword tags.
+%
+% In your source file, add the lines
+% \begin{verbatim}
+% \SVN $Id$
+% \SVN $Date$
+% \SVN $Author$
+% \end{verbatim}
+%
+% And then, with the additional GIT configuration described below, these keywords will be
+% expanded to the hash of the file contents (and not the commit, this may be misleading!),
+% the date of the commit and the author.
+%
+% In order to set up GIT for this, add to the |.gitattribtes| file (create it in the
+% repository directory if necessary):
+% \begin{verbatim}
+%   *.tex ident filter=rcs-keyword
+% \end{verbatim}
+%
+% Then copy the following code, and paste it at the end of your |REPO/.git/config| or
+% |HOME/.gitconfig|:
+% \begin{samepage}
+% \begin{verbatim}
+% [filter "rcs-keyword"]
+%   clean = perl -pwe \"s/\\\\\\$(Date|Author)[^\\\\\\$]*\\\\\\$/\\\\\\$\\$1\\\\\\$/\"
+%   smudge = "echo >&2 'Applying RCS filter rules on '%f'.' && perl -we \
+%         \"\\$f=%f; use Date::Parse; use POSIX;\
+%         chomp(\\$author=\\`git log -1 --format=format:%ae -- \\$f\\`);\
+%         chomp(\\$gitdate=\\`git log -1 --format=format:%aD -- \\$f\\`);\
+%         \\$date=POSIX::strftime('%Y-%m-%d %H:%M:%S %z (%a, %e %b %Y)',\
+%         localtime(str2time(\\$gitdate)));\
+%         print STDERR \\\"formatted date: \\$date\\\\n\\\";\
+%         while (<>) {\
+%           s/\\\\\\$Date[^\\\\\\$]*\\\\\\$/'\\$Date: '.\\$date.' \\$'/e;\
+%           s/\\\\\\$Author[^\\\\\\$]*\\\\\\$/'\\$Author: '.\\$author.' \\$'/e;\
+%           print \\$_; }\""
+% \end{verbatim}
+% \end{samepage}
+%
+% \subsection{SVN Keywords read with the \pkgname{svn-multi} package}
+%
+% The \pkgname{svn-multi} package is an alternative, more powerful, package for parsing SVN
+% keywords.
+%
+% Add near the top of your files the command
+% \begin{verbatim}
+% \svnid{$Id$}
+% \end{verbatim}
+% and make sure keyword expansion is enabled in your source files.
+%
+%
+% \subsection{SVN Keywords read with the \pkgname{svn-multi} package, with \pkgname{currfile} support}
+%
+% This method is the same as for the |id=svn-multi| method with the \pkgname{svn-multi}
+% package, but with added support for multiple files.
+%
+% Now, the watermark displays \emph{two} lines, with the overall document version
+% information, and the version information of the current file.
+%
+%
+%
+% \section{Placement of the Watermark}
+%
+% First, there is a master switch for enabling or disabling the watermark.  In either
+% case, the relevant SVN-related package is loaded anyway, to allow files to provide their
+% meta-information regardless of whether the watermark is displayed or not.
+% \begin{pkgoptions}
+% \item[watermark=true] Show the watermark with the ID information.
+% \item[watermark=false] Do not show the watermark with the ID information.  (Note that
+%   manually placed watermarks are not affected by this option.)
+% \end{pkgoptions}
+%
+%
+% \begin{pkgoptions}
+% \item[placement=shipout] Place the watermark at the bottom of each page;
+% \item[placement=manual] Don't place the watermark anywhere automatically; the user is
+%   responsible for placing it with a call to |\phfsvnVersionIdTag| wherever they want.
+% \end{pkgoptions}
+%
+% \subsection{Watermark on each page}
+%
+% With the |placement=shipout| option, the watermark is automatically added on each page.
+%
+% \DescribeMacro{\phfsvnShipoutWatermarkXposRight}
+% \DescribeMacro{\phfsvnShipoutWatermarkYposBaseline} \null\par\vspace*{\baselineskip} The
+% macros |\phfsvnShipoutWatermarkXposRight| and |\phfsvnShipoutWatermarkYposBaseline|
+% determine the position of the watermark.  They are macros which expand to a length, not
+% lengths themselves.  You may redefine them to adjust the placement of the watermark.
+%
+% \subsection{Manual placement}
+%
+% You may also opt to place the watermark manually on the page with the |placement=manual|
+% option.  Do this if you want the information to appear for example in a header or
+% footer.
+%
+% \DescribeMacro{\phfsvnVersionIdTag}\DescribeMacro{\phfsvnVersionIdTag*} Places the ID
+% tag immediately, at the given location.  The starred version produces a box of zero
+% width.
+%
+%
+%
+% \StopEventually{\PrintChangesAndIndex}
+%
+% \section{Implementation}
+%
+% Include useful packages.
+%    \begin{macrocode}
+\RequirePackage{kvoptions}
+\RequirePackage{calc}
+%    \end{macrocode}
+% 
+%
+% make sure the 'color' or 'xcolor' package is loaded
+%    \begin{macrocode}
+\@ifpackageloaded{xcolor}{}{%
+  \@ifpackageloaded{color}{}{%
+    \RequirePackage{xcolor}%
+  }
+}
+%    \end{macrocode}
+% 
+%
+% \subsection{Common Formatting of ID tag}
+%
+% common exterior formatting for Version ID tag.
+%
+%    \begin{macrocode}
+\definecolor{phfsvnversionidcolor}{rgb}{0.6,0.6,0.6}
+\def\phfsvnVersionIdTagOuterFont{\normalfont\scriptsize}
+\def\phfsvnVersionIdTagInnerFont{\ttfamily}
+\def\phfsvn at versionidtag{%
+  \begingroup%
+    \color{phfsvnversionidcolor}\phfsvnVersionIdTagOuterFont%
+    [\,\begingroup\phfsvnVersionIdTagInnerFont%
+        {\phfsvn at versionidtag@contents}\endgroup\,]%
+  \endgroup%
+}
+%    \end{macrocode}
+% 
+%
+% \begin{macro}{\phfsvnVersionIdTag}
+%   For manual placement.  Starred version does not smash the thing.
+%    \begin{macrocode}
+\newcommand\phfsvnVersionIdTag{%
+  \@ifstar\phfsvn at smashedsvnversionidtag\phfsvn at versionidtag
+}
+\def\phfsvn at smashedsvnversionidtag{%
+  \hspace*{0pt}\smash{\phfsvn at clap{\phfsvn at versionidtag}}
+}
+%    \end{macrocode}
+% \end{macro}
+% 
+% Helper macro\footnote{see \url{https://www.tug.org/TUGboat/tb22-4/tb72perlS.pdf}}:
+%    \begin{macrocode}
+\def\phfsvn at clap#1{\hbox to 0pt{\hss#1\hss}}
+%    \end{macrocode}
+% 
+%
+%
+% \subsection{Definitions for the different SVN info engines}
+%
+% \begin{macro}{\phfsvn at versionidtag@contents at svn}
+% \begin{macro}{\phfsvn at doincludesvn@svn}
+% Definitions for method \phfverb{id=svn}:
+%    \begin{macrocode}
+\def\phfsvn at versionidtag@contents at svn{%
+  \SVNId%
+}
+\def\phfsvn at doincludesvn@svn{
+  \RequirePackage{svn}
+}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% 
+% 
+% \begin{macro}{\phfsvn at versionidtag@contents at gitnotsvn}
+% \begin{macro}{\phfsvn at versionidtag@contents at gitnotsvn}
+%   Definitions for method \phfverb{id=gitnotsvn}.  Use the \pkgname{svn}
+%   package because the files have fake SVN tags with in fact the GIT
+%   meta-info
+%    \begin{macrocode}
+\def\phfsvn at versionidtag@contents at gitnotsvn{%
+  \SVNId\hspace*{1.5em}\SVNDate~\SVNTime\hspace*{1.5em}\SVNAuthor%
+}
+\def\phfsvn at doincludesvn@gitnotsvn{
+  \RequirePackage{svn}%
+}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% 
+%
+%
+% \begin{macro}{\phfsvn at versionidtag@contents at svnmulti}
+% \begin{macro}{\phfsvn at doinludesvn@svnmulti}
+%   Definitions for method \phfverb{id=svn-multi}:
+%    \begin{macrocode}
+\def\phfsvn at versionidtag@contents at svnmulti{%
+  SVN Document Version:\hspace*{1ex}%
+  \svnmainfilename~r\svnrev~\svndate~\svnauthor%
+}
+\def\phfsvn at doincludesvn@svnmulti{
+  \PassOptionsToPackage{filehooks}{svn-multi}
+  \RequirePackage{svn-multi}
+}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% 
+%
+% \begin{macro}{\phfsvn at versionidtag@for at svnmulticurrfile}
+% \begin{macro}{\phfsvn at doincludesvn@svnmulticurrfile}
+%   Definitions for method \phfverb{id=svn-multi-currfile}:
+%    \begin{macrocode}
+\def\phfsvn at svnmulticurrfile@maxwidth{0.8\paperwidth}
+\newsavebox\phfsvn at box@upperline
+\newsavebox\phfsvn at box@lowerline
+\def\phfsvn at svnmulticurrfile@upperline{%
+  SVN Document Version:\hspace{1.5ex}r\svnrev~\svndate~\svnauthor}%
+\def\phfsvn at svnmulticurrfile@lowerline{%
+  \svnkw{Filename}:\hspace{1.5ex}r\svnfilerev~\svnfiledate~\svnfileauthor}%
+\def\phfsvn at versionidtag@for at svnmulticurrfile{%
+  \begingroup%
+  \color{phfsvnversionidcolor}%
+  \phfsvnVersionIdTagOuterFont\phfsvnVersionIdTagInnerFont%
+  \sbox\phfsvn at box@upperline{\phfsvn at svnmulticurrfile@upperline}%
+  \sbox\phfsvn at box@lowerline{\phfsvn at svnmulticurrfile@lowerline}%
+  \begin{minipage}[t]{\minof{\phfsvn at svnmulticurrfile@maxwidth}%
+      {\maxof{\wd\phfsvn at box@upperline}{\wd\phfsvn at box@lowerline}}}%
+    \parindent=0pt\relax\parskip=0pt\relax%
+    \raggedleft%
+%    \end{macrocode}
+% Don't just |\usebox| the saved boxes, because if the filenames are long we want to
+% re-layout and allow line breaks:
+%    \begin{macrocode}
+    \par\phfsvn at svnmulticurrfile@upperline%
+    \par\phfsvn at svnmulticurrfile@lowerline%
+  \end{minipage}%
+  \endgroup%
+}%
+\def\phfsvn at doincludesvn@svnmulticurrfile{%
+  \RequirePackage{currfile}%
+  \RequirePackage[filehooks]{svn-multi}%
+}%
+%    \end{macrocode}
+% \end{macro} 
+% \end{macro}
+% 
+%
+% \subsection{Placement Methods}
+%
+% \begin{macro}{\phfsvn at doplace@shipout}
+%   The |shipout| placement method.
+%    \begin{macrocode}
+\def\phfsvn at doplace@shipout{%
+  \RequirePackage{eso-pic}
+  \AddToShipoutPicture{%
+    \setlength{\@tempdimb}{\phfsvnShipoutWatermarkXposRight}%
+    \setlength{\@tempdimc}{\phfsvnShipoutWatermarkYposBaseline}%
+    \setlength{\unitlength}{1pt}%
+    \put(2,\strip at pt\@tempdimc){%
+      \makebox(\strip at pt\@tempdimb,0)[r]%
+      {\hfill\phfsvn at versionidtag}}%
+  }%
+}
+%    \end{macrocode}
+% \end{macro}
+% 
+% \begin{macro}{\phfsvnShipoutWatermarkXposRight}
+% \begin{macro}{\phfsvnShipoutWatermarkYposBaseline}
+%   Control the position of the watermark.  These are proper macros which expand to a
+%   length; they are not declared as lengths directly.  (This allows to calculate the
+%   lengths on the spot.)
+%    \begin{macrocode}
+\def\phfsvnShipoutWatermarkXposRight{0.9\paperwidth}
+\def\phfsvnShipoutWatermarkYposBaseline{0.05\paperheight}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% 
+% \begin{macro}{\phfsvn at doplace@manual}
+% There is nothing to do for the |manual| placement, since the info is placed manually
+% anyway.  This macro is called by the package option treatment.
+%    \begin{macrocode}
+\def\phfsvn at doplace@manual{}
+%    \end{macrocode}
+% \end{macro}
+% 
+%
+%
+% \subsection{Package Options \& Setup}
+%
+%    \begin{macrocode}
+\SetupKeyvalOptions{
+  family=phfsvn,
+  prefix=phfsvn@
+}
+%    \end{macrocode}
+% 
+% Setup code for a given ID method: 
+%    \begin{macrocode}
+\def\phfsvn at SetupForId#1{%
+  \ifcsname phfsvn at SetupForId@#1\endcsname%
+    \csname phfsvn at SetupForId@#1\endcsname%
+  \else%
+     \PackageError{phfsvn}{Unknown SvnId method: '#1'}%
+  \fi
+}
+\def\phfsvn at doincludesvn{}
+\def\phfsvn at SetupForId@svn{
+  \message{phfsvn: Using SvnId method = svn}
+  \let\phfsvn at doincludesvn\phfsvn at doincludesvn@svn
+  \let\phfsvn at versionidtag@contents\phfsvn at versionidtag@contents at svn
+}
+\def\phfsvn at SetupForId@gitnotsvn{
+  \message{phfsvn: Using SvnId method = gitnotsvn}
+  \let\phfsvn at doincludesvn\phfsvn at doincludesvn@gitnotsvn
+  \let\phfsvn at versionidtag@contents\phfsvn at versionidtag@contents at gitnotsvn
+}
+\expandafter\def\csname phfsvn at SetupForId@svn-multi\endcsname{
+  \message{phfsvn: Using SvnId method = svn-multi}
+  \let\phfsvn at doincludesvn\phfsvn at doincludesvn@svnmulti
+  \let\phfsvn at versionidtag@contents\phfsvn at versionidtag@contents at svnmulti
+}
+\expandafter\def\csname phfsvn at SetupForId@svn-multi-currfile\endcsname{
+  \message{phfsvn: Using SvnId method = svn-multi-currfile}
+  \let\phfsvn at doincludesvn\phfsvn at doincludesvn@svnmulticurrfile
+  % redefine whole versionidtag, not only contents:
+  \let\phfsvn at versionidtag\phfsvn at versionidtag@for at svnmulticurrfile
+}
+\def\phfsvn at SetupForId@{% no ID method
+  \PackageWarning{phfsvn}{*** No SvnId method provided, no watermark will be displayed.}
+  \phfsvn at watermarkfalse
+}
+%    \end{macrocode}
+% 
+%
+%
+% Setup code for the placement:
+%    \begin{macrocode}
+\def\phfsvn at SetupPlacement#1{%
+  \ifcsname phfsvn at doplace@#1\endcsname%
+    \csname phfsvn at doplace@#1\endcsname%
+  \else%
+     \PackageError{phfsvn}{Unknown placement method: '#1'}%
+  \fi
+}
+%    \end{macrocode}
+% 
+% Declare the |keyval| options:
+%
+%    \begin{macrocode}
+\DeclareStringOption[]{id}[svn]
+\DeclareBoolOption[true]{watermark}
+\DeclareStringOption[shipout]{placement}
+\DeclareDefaultOption{%
+  % We provide the standard LaTeX error.
+  \@unknownoptionerror
+}
+%    \end{macrocode}
+% 
+%
+% Process \& execute options:
+%    \begin{macrocode}
+\ProcessKeyvalOptions*
+%    \end{macrocode}
+% 
+%
+% Now, take action according to the given options.
+%
+% Set up the correct ID method:
+%    \begin{macrocode}
+\phfsvn at SetupForId{\phfsvn at id}
+%    \end{macrocode}
+% 
+% Always include the relevant SVN package, so all files can have their meta-info tags
+% regardless of whether the watermark is displayed or not:
+%    \begin{macrocode}
+\phfsvn at doincludesvn
+%    \end{macrocode}
+% 
+%
+% Finish setting up, set up  the watermark if we want it on.
+%    \begin{macrocode}
+\ifphfsvn at watermark
+  \phfsvn at SetupPlacement{\phfsvn at placement}
+\fi
+%    \end{macrocode}
+%
+%\Finale
+\endinput


Property changes on: trunk/Master/texmf-dist/source/latex/phfsvnwatermark/phfsvnwatermark.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/phfsvnwatermark/phfsvnwatermark.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/phfsvnwatermark/phfsvnwatermark.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/phfsvnwatermark/phfsvnwatermark.ins	2016-08-16 21:46:50 UTC (rev 41870)
@@ -0,0 +1,55 @@
+%%
+%% Copyright (C) 2016 by Philippe Faist <philippe.faist at bluewin.ch>
+%%
+%% This file 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 this
+%% license is in:
+%% 
+%%    http://www.latex-project.org/lppl.txt
+%% 
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2005/12/01 or later.
+%%
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/phfqitltx}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2016 by Philippe Faist <philippe.faist at bluewin.ch>
+
+This file 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 this
+license is in:
+
+   http://www.latex-project.org/lppl.txt
+
+and version 1.3 or later is part of all distributions of LaTeX version
+2005/12/01 or later.
+
+\endpreamble
+
+\generate{\file{phfsvnwatermark.sty}{\from{phfsvnwatermark.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{*                                                           *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX:                    *}
+\Msg{*                                                           *}
+\Msg{*     phfsvnwatermark.sty                                   *}
+\Msg{*                                                           *}
+\Msg{* To produce the documentation run the .dtx file through    *}
+\Msg{* (PdF-)LaTeX.                                              *}
+\Msg{*                                                           *}
+\Msg{* Happy TeXing!                                             *}
+\Msg{*                                                           *}
+\Msg{*************************************************************}
+
+\endbatchfile

Added: trunk/Master/texmf-dist/tex/latex/phfsvnwatermark/phfsvnwatermark.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/phfsvnwatermark/phfsvnwatermark.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/phfsvnwatermark/phfsvnwatermark.sty	2016-08-16 21:46:50 UTC (rev 41870)
@@ -0,0 +1,169 @@
+%%
+%% This is file `phfsvnwatermark.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% phfsvnwatermark.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright (C) 2016 by Philippe Faist <philippe.faist at bluewin.ch>
+%% 
+%% This file 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 this
+%% license is in:
+%% 
+%%    http://www.latex-project.org/lppl.txt
+%% 
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2005/12/01 or later.
+%% 
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{phfsvnwatermark}
+    [2016/08/15 v1.0 phfsvnwatermark package]
+\RequirePackage{kvoptions}
+\RequirePackage{calc}
+\@ifpackageloaded{xcolor}{}{%
+  \@ifpackageloaded{color}{}{%
+    \RequirePackage{xcolor}%
+  }
+}
+\definecolor{phfsvnversionidcolor}{rgb}{0.6,0.6,0.6}
+\def\phfsvnVersionIdTagOuterFont{\normalfont\scriptsize}
+\def\phfsvnVersionIdTagInnerFont{\ttfamily}
+\def\phfsvn at versionidtag{%
+  \begingroup%
+    \color{phfsvnversionidcolor}\phfsvnVersionIdTagOuterFont%
+    [\,\begingroup\phfsvnVersionIdTagInnerFont%
+        {\phfsvn at versionidtag@contents}\endgroup\,]%
+  \endgroup%
+}
+\newcommand\phfsvnVersionIdTag{%
+  \@ifstar\phfsvn at smashedsvnversionidtag\phfsvn at versionidtag
+}
+\def\phfsvn at smashedsvnversionidtag{%
+  \hspace*{0pt}\smash{\phfsvn at clap{\phfsvn at versionidtag}}
+}
+\def\phfsvn at clap#1{\hbox to 0pt{\hss#1\hss}}
+\def\phfsvn at versionidtag@contents at svn{%
+  \SVNId%
+}
+\def\phfsvn at doincludesvn@svn{
+  \RequirePackage{svn}
+}
+\def\phfsvn at versionidtag@contents at gitnotsvn{%
+  \SVNId\hspace*{1.5em}\SVNDate~\SVNTime\hspace*{1.5em}\SVNAuthor%
+}
+\def\phfsvn at doincludesvn@gitnotsvn{
+  \RequirePackage{svn}%
+}
+\def\phfsvn at versionidtag@contents at svnmulti{%
+  SVN Document Version:\hspace*{1ex}%
+  \svnmainfilename~r\svnrev~\svndate~\svnauthor%
+}
+\def\phfsvn at doincludesvn@svnmulti{
+  \PassOptionsToPackage{filehooks}{svn-multi}
+  \RequirePackage{svn-multi}
+}
+\def\phfsvn at svnmulticurrfile@maxwidth{0.8\paperwidth}
+\newsavebox\phfsvn at box@upperline
+\newsavebox\phfsvn at box@lowerline
+\def\phfsvn at svnmulticurrfile@upperline{%
+  SVN Document Version:\hspace{1.5ex}r\svnrev~\svndate~\svnauthor}%
+\def\phfsvn at svnmulticurrfile@lowerline{%
+  \svnkw{Filename}:\hspace{1.5ex}r\svnfilerev~\svnfiledate~\svnfileauthor}%
+\def\phfsvn at versionidtag@for at svnmulticurrfile{%
+  \begingroup%
+  \color{phfsvnversionidcolor}%
+  \phfsvnVersionIdTagOuterFont\phfsvnVersionIdTagInnerFont%
+  \sbox\phfsvn at box@upperline{\phfsvn at svnmulticurrfile@upperline}%
+  \sbox\phfsvn at box@lowerline{\phfsvn at svnmulticurrfile@lowerline}%
+  \begin{minipage}[t]{\minof{\phfsvn at svnmulticurrfile@maxwidth}%
+      {\maxof{\wd\phfsvn at box@upperline}{\wd\phfsvn at box@lowerline}}}%
+    \parindent=0pt\relax\parskip=0pt\relax%
+    \raggedleft%
+    \par\phfsvn at svnmulticurrfile@upperline%
+    \par\phfsvn at svnmulticurrfile@lowerline%
+  \end{minipage}%
+  \endgroup%
+}%
+\def\phfsvn at doincludesvn@svnmulticurrfile{%
+  \RequirePackage{currfile}%
+  \RequirePackage[filehooks]{svn-multi}%
+}%
+\def\phfsvn at doplace@shipout{%
+  \RequirePackage{eso-pic}
+  \AddToShipoutPicture{%
+    \setlength{\@tempdimb}{\phfsvnShipoutWatermarkXposRight}%
+    \setlength{\@tempdimc}{\phfsvnShipoutWatermarkYposBaseline}%
+    \setlength{\unitlength}{1pt}%
+    \put(2,\strip at pt\@tempdimc){%
+      \makebox(\strip at pt\@tempdimb,0)[r]%
+      {\hfill\phfsvn at versionidtag}}%
+  }%
+}
+\def\phfsvnShipoutWatermarkXposRight{0.9\paperwidth}
+\def\phfsvnShipoutWatermarkYposBaseline{0.05\paperheight}
+\def\phfsvn at doplace@manual{}
+\SetupKeyvalOptions{
+  family=phfsvn,
+  prefix=phfsvn@
+}
+\def\phfsvn at SetupForId#1{%
+  \ifcsname phfsvn at SetupForId@#1\endcsname%
+    \csname phfsvn at SetupForId@#1\endcsname%
+  \else%
+     \PackageError{phfsvn}{Unknown SvnId method: '#1'}%
+  \fi
+}
+\def\phfsvn at doincludesvn{}
+\def\phfsvn at SetupForId@svn{
+  \message{phfsvn: Using SvnId method = svn}
+  \let\phfsvn at doincludesvn\phfsvn at doincludesvn@svn
+  \let\phfsvn at versionidtag@contents\phfsvn at versionidtag@contents at svn
+}
+\def\phfsvn at SetupForId@gitnotsvn{
+  \message{phfsvn: Using SvnId method = gitnotsvn}
+  \let\phfsvn at doincludesvn\phfsvn at doincludesvn@gitnotsvn
+  \let\phfsvn at versionidtag@contents\phfsvn at versionidtag@contents at gitnotsvn
+}
+\expandafter\def\csname phfsvn at SetupForId@svn-multi\endcsname{
+  \message{phfsvn: Using SvnId method = svn-multi}
+  \let\phfsvn at doincludesvn\phfsvn at doincludesvn@svnmulti
+  \let\phfsvn at versionidtag@contents\phfsvn at versionidtag@contents at svnmulti
+}
+\expandafter\def\csname phfsvn at SetupForId@svn-multi-currfile\endcsname{
+  \message{phfsvn: Using SvnId method = svn-multi-currfile}
+  \let\phfsvn at doincludesvn\phfsvn at doincludesvn@svnmulticurrfile
+  % redefine whole versionidtag, not only contents:
+  \let\phfsvn at versionidtag\phfsvn at versionidtag@for at svnmulticurrfile
+}
+\def\phfsvn at SetupForId@{% no ID method
+  \PackageWarning{phfsvn}{*** No SvnId method provided, no watermark will be displayed.}
+  \phfsvn at watermarkfalse
+}
+\def\phfsvn at SetupPlacement#1{%
+  \ifcsname phfsvn at doplace@#1\endcsname%
+    \csname phfsvn at doplace@#1\endcsname%
+  \else%
+     \PackageError{phfsvn}{Unknown placement method: '#1'}%
+  \fi
+}
+\DeclareStringOption[]{id}[svn]
+\DeclareBoolOption[true]{watermark}
+\DeclareStringOption[shipout]{placement}
+\DeclareDefaultOption{%
+  % We provide the standard LaTeX error.
+  \@unknownoptionerror
+}
+\ProcessKeyvalOptions*
+\phfsvn at SetupForId{\phfsvn at id}
+\phfsvn at doincludesvn
+\ifphfsvn at watermark
+  \phfsvn at SetupPlacement{\phfsvn at placement}
+\fi
+\endinput
+%%
+%% End of file `phfsvnwatermark.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/phfsvnwatermark/phfsvnwatermark.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2016-08-16 21:46:19 UTC (rev 41869)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2016-08-16 21:46:50 UTC (rev 41870)
@@ -451,6 +451,7 @@
     pgfgantt pgfkeyx pgfmolbio
     pgfopts pgfornament pgfplots
     phaistos phffullpagefigure phfnote phfparen phfqit phfquotetext
+    phfsvnwatermark
     philex philokalia philosophersimprint
     phonetic phonrule photo physics piano picinpar pict2e
     pictex pictex2 pictexsum piechartmp piff pigpen

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2016-08-16 21:46:19 UTC (rev 41869)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2016-08-16 21:46:50 UTC (rev 41870)
@@ -773,6 +773,7 @@
 depend phfparen
 depend phfqit
 depend phfquotetext
+depend phfsvnwatermark
 depend philex
 depend photo
 depend piff

Added: trunk/Master/tlpkg/tlpsrc/phfsvnwatermark.tlpsrc
===================================================================


More information about the tex-live-commits mailing list