summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/minorrevision
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-11-16 23:52:33 +0000
committerKarl Berry <karl@freefriends.org>2013-11-16 23:52:33 +0000
commit9bd41c0ea62b048f9a61926ff523b1ea2b69ec9e (patch)
tree5c33c185f0fcb6b793c9ce33b8bf5cd33eb43b8e /Master/texmf-dist/tex/latex/minorrevision
parent9e7d9e01534a2c0515c3d5ce32d9c485fd6b559e (diff)
minorrevision (16nov13)
git-svn-id: svn://tug.org/texlive/trunk@32165 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/minorrevision')
-rw-r--r--Master/texmf-dist/tex/latex/minorrevision/minorrevision.sty68
1 files changed, 68 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/minorrevision/minorrevision.sty b/Master/texmf-dist/tex/latex/minorrevision/minorrevision.sty
new file mode 100644
index 00000000000..53fb956de5f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/minorrevision/minorrevision.sty
@@ -0,0 +1,68 @@
+%% Copyright (C) 2013 by Matthieu Guillaumin
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.2 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.2 or later is part of all distributions of
+%% LaTeX version 1999/12/01 or later.
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{minorrevision}
+ [ 2013/11/15 v1.1 minorrevision package ]
+
+% Package requirements
+\RequirePackage{xkeyval}
+\RequirePackage{lineno}
+\RequirePackage{xr}
+\DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{lineno,xr}} % pass options to other packages
+\ProcessOptionsX
+
+%%% Package commands %%%
+
+% Define .mrv extension for auxiliary files, creating/opening the output file
+\def\MRV@prefix{ MRV}
+\def\MRV@ext{.mrv}
+\def\MRV@outputfile{\jobname\MRV@ext}
+\typeout{minorrevision: creating \MRV@outputfile}
+\newwrite\outputmrv
+\immediate\openout\outputmrv=\MRV@outputfile
+
+% Macro for writing macros in the .mrv file
+\newcommand{\MRV@Write}[3]{%
+ \protected@write\outputmrv{}{\string\expandafter\string\def\string\csname\MRV@prefix/\jobname/#1@#2\string\endcsname{#3}}%
+}
+
+%%% User commands %%%
+
+% Define \mrvdocument: adds external document for xr, reads the .mrv file
+\newcommand{\mrvdocument}[1]{
+ \def\MRV@lastrefdoc{#1}
+ \def\MRV@lastrefmrv{#1\MRV@ext}
+ \typeout{minorrevision: reference ``\MRV@lastrefdoc'' declared, loading \MRV@lastrefmrv}
+ \externaldocument[\MRV@lastrefdoc-]{\MRV@lastrefdoc}
+ \input \MRV@lastrefmrv
+}
+
+\newcommand{\mrvref}[2]{\ref{#1-mrv:#2}}
+
+\newcommand{\mrvold}[2]{\csname\MRV@prefix/#1/old@#2\endcsname}
+
+\newcommand{\mrvnew}[2]{\csname\MRV@prefix/#1/new@#2\endcsname}
+
+\newcommand{\revref}[1]{\mrvref{\MRV@lastrefdoc}{#1}}
+
+\newcommand{\revold}[1]{\mrvold{\MRV@lastrefdoc}{#1}}
+
+\newcommand{\revnew}[1]{\mrvnew{\MRV@lastrefdoc}{#1}}
+
+\newcommand{\revisionrm}[2]{\linelabel{mrv:#1}\MRV@Write{old}{#1}{#2}}
+
+\newcommand{\revisionadd}[2]{\linelabel{mrv:#1}#2\MRV@Write{new}{#1}{#2}}
+
+\newcommand{\revision}[3]{\linelabel{mrv:#1}#2\MRV@Write{new}{#1}{#2}\MRV@Write{old}{#1}{#3}}
+
+%% End of user commands %%
+
+\endinput
+%%
+%% End of file `minorrevision.sty'.