summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/minorrevision
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/minorrevision
Initial commit
Diffstat (limited to 'macros/latex/contrib/minorrevision')
-rw-r--r--macros/latex/contrib/minorrevision/README150
-rw-r--r--macros/latex/contrib/minorrevision/minorrevision.pdfbin0 -> 163090 bytes
-rw-r--r--macros/latex/contrib/minorrevision/minorrevision.sty68
-rw-r--r--macros/latex/contrib/minorrevision/minorrevision.tex155
4 files changed, 373 insertions, 0 deletions
diff --git a/macros/latex/contrib/minorrevision/README b/macros/latex/contrib/minorrevision/README
new file mode 100644
index 0000000000..a0972848e0
--- /dev/null
+++ b/macros/latex/contrib/minorrevision/README
@@ -0,0 +1,150 @@
+ +-----------------------------------------------+
+ | MINORREVISION v1.1 |
+ | |
+ | Quoting and referring to modified documents |
+ | |
+ | By Matthieu Guillaumin |
+ | guillaumin@vision.ee.ethz.ch |
+ +-----------------------------------------------+
+
+
+Description and usage
+=====================
+
+minorrevision is intended for researchers who publish articles in peer-reviewed
+journals. In the final stages of the review process, the authors typically have
+to provide an additional document (such as a letter to the editors) where they
+want to provide a list of modifications that they made to the manuscript. It
+is convenient for the editors to have line numbers and quotations from the
+manuscript in this letter. This package helps automatizing this task for the
+authors.
+
+This is a two-step process.
+
+Step 1) In the manuscript (say "manuscript.tex"), you need to declare the use
+of the package, by putting the following line in the preamble of your LaTeX
+source:
+
+ \usepackage{minorrevision}
+
+You should also add line numbers to your manuscript, also in the preamble:
+
+ \linenumbers
+
+Then, in the body of you manuscript, when you make a minor modification, you
+need to use the \revision macro. For instance, if the following sentence was in
+your manuscript:
+
+ In this paper, we show that $1+1=2$.
+
+And, following reviews, you want to modify it to:
+
+ In this paper, we hypothetize that $1+1=2$.
+
+Then, instead of replacing the text directly, you should use
+\revision{label}{new text}{old text}, like this:
+
+ In this paper, we \revision{mymod}{hypothetize}{show} that $1+1=2$.
+
+Here, we have used the label "mymod" for later reference. When compiling
+manuscript.tex with LaTeX, only the new version of the text will appear.
+
+For text that is simply removed, you can use: \revisionrm{label}{text}
+For text that is simply added: \revisionadd{label}{text}
+A call to \revision{label}{text1}{text2} is similar to
+\revisionrm{label}{text2}\revisionadd{label}{text1} but the latter wouldn't
+work because the label would be defined twice.
+
+Step 2) In the document where you want make reference to the manuscript, also
+add the minorrevision package, and specify that manuscript.tex is the
+reference:
+
+ \usepackage{minorrevision}
+ \mrvdocument{manuscript}
+
+Note how ".tex" should *not* be included in the \mrvdocument macro. As of
+v1.1, you can have multiple references:
+
+ \mrvdocument{manuscript}
+ \mrvdocument{manuscript2}
+ ...
+
+You can now refer to the line numbers of modifications in the reference
+documents via their label names, by using \mrvref{reference}{label},
+\mrvold{reference}{label} and \mrvnew{reference}{label}. "reference" should
+correspond to the argument of \mrvreference.
+
+ On line~\mrvref{manuscript}{mymod}, we have replaced
+ ``\mrvold{manuscript}{mymod}'' with ``\mrvnew{manuscript}{mymod}''.
+
+It's up to you to format that as you prefer. The quote environment is probably
+better for larger modifications.
+
+For the latest declared reference document, the simpler \revref{label},
+\revold{label} and \revnew{label} are available.
+
+ On line~\revref{mymod}, we have replaced ``\revold{mymod}'' with
+ ``\revnew{mymod}''.
+
+This is particularly useful when there is no ambiguity, ie there is only one
+reference document.
+
+
+
+Implementation details
+======================
+
+This package automatically adds the following packages:
+- xkeyval: for passing options to the packages below
+- lineno: to get line numbers of labels
+- xr: to perform cross-reference between documents
+
+When using the minorrevision package, a new auxiliary file is created, with
+extention ``.mrv''. In the case of manuscript.tex, the file will be
+manuscript.mrv. The \revision macro not only declares the label for lineno and
+prints the new text to the document, but also writes two macro definitions in
+manuscript.mrv with both the new and old text contents. The macro name depends
+on the name of the reference (here, ``manuscript''), and the label name (here,
+``mymod'').
+
+When making the call to \mrvdocument, those macro definitions are read (simply
+by inputting the file), and calls to \revref{mymod}, \revold{mymod} and
+\revnew{mymod} become available.
+
+See minorrevision.sty for the actual implementation with comments.
+
+
+
+File manifest
+=============
+
+README This file
+minorrevision.sty The style file
+
+
+
+Bug report and questions
+========================
+
+Please use the official bitbucket repository for bug reports, patch proposal
+and question:
+
+https://bitbucket.org/mguillau/latex-minorrevision
+
+
+
+Copyright and License
+=====================
+
+Copyright 2013 Matthieu Guillaumin
+
+This work may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.3c 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.3c or later is part of all distributions of LaTeX version
+2008/05/04 or later.
+
diff --git a/macros/latex/contrib/minorrevision/minorrevision.pdf b/macros/latex/contrib/minorrevision/minorrevision.pdf
new file mode 100644
index 0000000000..703fcab974
--- /dev/null
+++ b/macros/latex/contrib/minorrevision/minorrevision.pdf
Binary files differ
diff --git a/macros/latex/contrib/minorrevision/minorrevision.sty b/macros/latex/contrib/minorrevision/minorrevision.sty
new file mode 100644
index 0000000000..53fb956de5
--- /dev/null
+++ b/macros/latex/contrib/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'.
diff --git a/macros/latex/contrib/minorrevision/minorrevision.tex b/macros/latex/contrib/minorrevision/minorrevision.tex
new file mode 100644
index 0000000000..8bc690fef7
--- /dev/null
+++ b/macros/latex/contrib/minorrevision/minorrevision.tex
@@ -0,0 +1,155 @@
+\documentclass{ltxdoc}
+\usepackage{minorrevision}
+\usepackage{url}
+\usepackage{framed}
+
+\begin{document}
+
+\title{The \textsf{minorrevision} package\thanks{This document corresponds to \textsf{minorrevision}~v1.1, dated~2013/11/15.}}
+\author{Matthieu Guillaumin\\ \texttt{guillaumin@vision.ee.ethz.ch}}
+
+\maketitle
+
+\tableofcontents
+
+\section{Description and usage}
+
+\verb|minorrevision| is intended for researchers who publish articles in peer-reviewed
+journals. In the final stages of the review process, the authors typically have
+to provide an additional document (such as a letter to the editors) where they
+want to provide a list of modifications that they made to the manuscript. It
+is convenient for the editors to have line numbers and quotations from the
+manuscript in this letter. This package helps automatizing this task for the
+authors.
+
+This is a two-step process.
+
+\subsection{Step 1: Editing the reference document}
+In the manuscript (say \verb|manuscript.tex|), you need to declare the use
+of the package, by putting the following line in the preamble of your LaTeX
+source:
+\begin{verbatim}
+\usepackage{minorrevision}
+\end{verbatim}
+
+You should also add line numbers to your manuscript, also in the preamble:
+\begin{verbatim}
+\linenumbers
+\end{verbatim}
+
+Then, in the body of you manuscript, when you make a minor
+modification, you need to use the \verb|\revision| macro. For instance, if the
+following sentence was in your manuscript:
+\begin{verbatim}
+In this paper, we show that $1+1=2$.
+\end{verbatim}
+
+And, following reviews, you want to modify it to:
+\begin{verbatim}
+In this paper, we hypothetize that $1+1=2$.
+\end{verbatim}
+
+Then, instead of replacing the text directly, you should use the \verb|\revision| macro:
+\begin{quote}
+\verb|\revision| \marg{label} \marg{new text} \marg{old text}
+\end{quote}
+
+In your document, this looks like:
+\begin{verbatim}
+In this paper, we \revision{mymod}{hypothetize}{show} that $1+1=2$.
+\end{verbatim}
+
+Here, we have used the label \verb|mymod| for later reference. When compiling
+\verb|manuscript.tex| with LaTeX, only the new version of the text will appear.
+
+For text that is simply removed, you can use:
+\begin{quote}
+\verb|\revisionrm| \marg{label} \marg{old text}
+\end{quote}
+
+For text that is simply added:
+\begin{quote}
+\verb|\revisionadd| \marg{label} \marg{new text}
+\end{quote}
+
+A call to \verb|\revision{label}{text1}{text2}| is similar to
+\begin{verbatim}
+\revisionrm{label}{text2}\revisionadd{label}{text1}
+\end{verbatim}
+but the latter wouldn't work because the label would be defined twice.
+
+\subsection{Step 2: Editing the referring document}
+
+In the document where you want make reference to the manuscript, also add the \verb|minorrevision| package, and specify that \verb|manuscript.tex| is the reference:
+
+\begin{verbatim}
+\usepackage{minorrevision}
+\mrvdocument{manuscript}
+\end{verbatim}
+
+Note how \verb|.tex| should \textbf{not} be included in the \verb|\mrvdocument| macro.
+As of v1.1, you can have multiple references:
+
+\begin{verbatim}
+\mrvdocument{manuscript}
+\mrvdocument{manuscript2}
+\end{verbatim}
+
+You can now refer to the line numbers of modifications in the reference documents via their label names, by using:
+\begin{quote}
+\verb|\mrvref| \marg{reference} \marg{label} \\
+\verb|\mrvold| \marg{reference} \marg{label} \\
+\verb|\mrvnew| \marg{reference} \marg{label}
+\end{quote}
+
+\verb|reference| should correspond to the argument of \verb|\mrvdocument|.
+
+\begin{verbatim}
+On line~\mrvref{manuscript}{mymod}, we have replaced
+``\mrvold{manuscript}{mymod}'' with ``\mrvnew{manuscript}{mymod}''.
+\end{verbatim}
+
+It's up to you to format that as you prefer.
+The \verb|quote| or \verb|quotation| environments are probably better for larger modifications.
+
+For the latest declared reference document, the following simpler macros are available:
+\begin{quote}
+\verb|\revref| \marg{label}\\
+\verb|\revold| \marg{label}\\
+\verb|\revnew| \marg{label}
+\end{quote}
+
+This is particularly useful when there is no possible ambiguity, i.e when there is only one reference.
+
+\begin{verbatim}
+On line~\revref{mymod}, we have replaced ``\revold{mymod}''
+with ``\revnew{mymod}''.
+\end{verbatim}
+
+\section{Implementation details}
+
+This package automatically adds the following packages:
+\begin{itemize}
+\item \textsf{xkeyval}: for passing options to the packages below
+\item \textsf{lineno}: to get line numbers of labels
+\item \textsf{xr}: to perform cross-reference between documents
+\end{itemize}
+
+When using the package, a new auxiliary file is created, with extention \verb|.mrv|.
+In the case of \verb|manuscript.tex|, the file will be \verb|manuscript.mrv|.
+The \verb|\revision| macro not only declares the label for \verb|lineno| and prints the new text to the document, but also writes two macro definitions in \verb|manuscript.mrv| with both the new and old text contents.
+The macro name depends on the name of the reference (here, \verb|manuscript|), and the label name (here, \verb|mymod|).
+
+When making the call to \verb|\mrvdocument|, those macro definitions are read (simply by inputting the file), and calls to \verb|\revref{mymod}|, \verb|\revold{mymod}| and \verb|\revnew{mymod}| (and \verb|\mrvref|, \verb|\mrvold| and \verb|\mrvnew|) become available.
+
+See \verb|minorrevision.sty| for the actual implementation with comments.
+
+\section{Bug reports}
+
+Please use the official bitbucket repository for bug reports, patch proposals and other questions:
+
+\begin{quote}
+\url{https://bitbucket.org/mguillau/latex-minorrevision}
+\end{quote}
+
+\end{document}