From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/mnotes/Makefile | 57 +++++ macros/latex/contrib/mnotes/README | 25 ++ macros/latex/contrib/mnotes/mnotes.dtx | 449 +++++++++++++++++++++++++++++++++ macros/latex/contrib/mnotes/mnotes.ins | 42 +++ macros/latex/contrib/mnotes/mnotes.pdf | Bin 0 -> 210491 bytes 5 files changed, 573 insertions(+) create mode 100644 macros/latex/contrib/mnotes/Makefile create mode 100644 macros/latex/contrib/mnotes/README create mode 100644 macros/latex/contrib/mnotes/mnotes.dtx create mode 100644 macros/latex/contrib/mnotes/mnotes.ins create mode 100644 macros/latex/contrib/mnotes/mnotes.pdf (limited to 'macros/latex/contrib/mnotes') diff --git a/macros/latex/contrib/mnotes/Makefile b/macros/latex/contrib/mnotes/Makefile new file mode 100644 index 0000000000..e9d5e727a8 --- /dev/null +++ b/macros/latex/contrib/mnotes/Makefile @@ -0,0 +1,57 @@ +SHELL=/bin/bash +NAME=mnotes +VERSION=0.8 +DISTDIR=$(NAME) +ARCHIVE_NAME=/tmp/$(NAME)-$(VERSION).tar.gz +DISTFILES=$(NAME).dtx Makefile README $(NAME).ins $(NAME).pdf + +DEP=$(NAME).sty + +all: pdf + +ps: $(NAME).ps + +%.ps: %.dvi + dvips $(DVIPSOPT) $< -o $@ + +pdf: $(NAME).pdf $(DEP) + +%.pdf: %.dtx + pdflatex $< + makeindex -s gglo.ist -o $(NAME).gls $(NAME).glo + makeindex -s gind.ist -o $(NAME).ind $(NAME).idx + pdflatex $< + +dist: $(DISTFILES) + rm -rf $(DISTDIR) + mkdir $(DISTDIR) + cp -aL --parents $(DISTFILES) $(DISTDIR) + tar cfvz $(ARCHIVE_NAME) $(DISTDIR) + rm -rf $(DISTDIR) + +clean: + rm -f $(NAME).{glo,log,toc,lot,lof,idx,ilg,ind,aux,blg,bbl,dvi} + rm -f *~ + +cleandist: clean + rm -f $(NAME).{pdf,sty,ins} + +REFWARN = 'Rerun to get cross-references' +LATEXMAX = 5 + +%.dvi: %.dtx $(DEP) + latex $< + RUNS=$(LATEXMAX); \ + while [ $$RUNS -gt 0 ] ; do \ + if grep $(REFWARN) $*.log > /dev/null; \ + then latex $< ; else break; fi; \ + RUNS=`expr $$RUNS - 1`; \ + done + +$(NAME).sty: $(NAME).ins FORCE + tex $(NAME).ins + +$(NAME).ins: + pdflatex $(NAME).dtx + +FORCE: diff --git a/macros/latex/contrib/mnotes/README b/macros/latex/contrib/mnotes/README new file mode 100644 index 0000000000..f258978049 --- /dev/null +++ b/macros/latex/contrib/mnotes/README @@ -0,0 +1,25 @@ + MNOTES: a flexible package for annotating and commenting + ====== collaboratively written documents + + Copyright (C) 2013 by S Luz + + 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 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 2003/12/01 or later. + + INSTALLATION: + + on Unix, run "make" to get the style file and the documentation; + Alternatively, to generate the driver mnotes.ins run + + $ pdflatex mnotes.dtx + + To generate the style file run + + $ tex mnotes.ins diff --git a/macros/latex/contrib/mnotes/mnotes.dtx b/macros/latex/contrib/mnotes/mnotes.dtx new file mode 100644 index 0000000000..babd0566a6 --- /dev/null +++ b/macros/latex/contrib/mnotes/mnotes.dtx @@ -0,0 +1,449 @@ +% \iffalse meta-comment +% +%<*preamble> +% mnotes.dtx +% +% Copyright (C) 2013 by S Luz +% +% 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 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 2003/12/01 or later. +% +% INSTALLATION: +% +% on Unix, run "make" to get the style file and the documentation; +% Alternatively, to generate the driver mnotes.ins run +% +% $ pdflatex mnotes.dtx +% +% To generate the style file run +% +% $ tex mnotes.ins +% +%% @LaTeX-package-file{ +%% author = "Saturnino Luz", +%% version = "0.6", +%% date = "18 April 2013", +%% filename = "mnotes.dtx", +%% address = "S Luz +%% Trinity College +%% Dublin, Ireland", +%% URL = "http://www.scss.tcd.ie/~luzs/", +%% email = "luzs@acm.org", +%% codetable = "ISO/ASCII", +%% keywords = "margin, notes, comments", +%% supported = "yes", +%% docstring = "This document describes the mnotes package. +%% } +%% +% +% +% +%<*batchfile> +\begin{filecontents}{mnotes.ins} +\def\batchfile{mnotes.ins} +\input docstrip.tex +\askforoverwritefalse +\keepsilent +\preamble + +This is a generated file. + +Copyright (C) 2013 by S Luz + +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 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 +2003/12/01 or later. + +\endpreamble +\generate{\file{mnotes.sty}{\from{mnotes.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{* mnotes.sty *} +\Msg{* *} +\Msg{* To produce the documentation run the file mnotes.dtx *} +\Msg{* through LaTeX. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{*************************************************************} +\endbatchfile +\end{filecontents} +% +% +%<*driver> +\ProvidesFile{mnotes.dtx}[% +% +%\ProvidesPackage{mnotes}[% +%<*driver|package> + 2013/20/04 v0.7 margin notes for collaborative document editing] +% +%<*driver> +\documentclass{ltxdoc} +%%\usepackage{mnotes} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} + \DocInput{mnotes.dtx} + \PrintIndex + \PrintChanges +\end{document} +% +% \fi +% +% \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{v0.4}{2013/04/18}{Clean-up} +% \changes{v0.5}{2013/04/20}{First release} +% +% \GetFileInfo{mnotes.dtx} +% +% +% \title{\texttt{mnotes} --- annotate documents with margin comments\thanks{This document +% corresponds to \textsf{mnotes}~\fileversion, dated \filedate.}} +% \author{S Luz\\ \texttt{luzsacm.org} } +% +% \maketitle +% +% \begin{abstract} +% This is a simple package to allow you to add comments to the margins +% of your documents. It is primarily designed to support collaborative +% document writing. The comments can be added to the text similarly +% to \verb+\footnote+ and will be displayed on the margins in +% text boxes connected by a thin line to the part of the text they refer +% to. Thanks to the use of \texttt{sidenotes}, comments can float on +% the margins to avoid overlaps. The text can optionally be scaled +% down to allow comments to fit in otherwise narrow notes without +% altering the document's template. +% \end{abstract} +% +% \tableofcontents +% +% \section{Package options} +% +% The basic usage is to include a \verb+\usepackage{mnote}+ to the +% preamble of your \LaTeX\ document. +% +% The \textsf{mnotes} package also provides some basic +% customisation of the way comments are displayed. The interface to the +% package's options is, as usual, accessed through the \verb+\usepackage+ +% command. +% +% The package options are: +% \begin{itemize} +% \item[\texttt{scale}] This enlarges the physical page of the +% document to allow comments to fit in the margin area. The default +% \verb+\usepackage[scale]{mnotes}+ is to make the physical page 5\% +% larger than the original paper size. You can pass a value to this +% option to control the the amount of space allocated to the +% margins. For instance \verb+\usepackage[scale=1.2]{mnotes}+ makes +% the physical page 20\% larger. \textbf{Important:} when printing +% your draft, make +% sure that the printer is set to shrink the page to printable area.\\ +% Default: \texttt{scale=1.05}. +% \item[\texttt{mnwidth}] Sets the default width for the comment +% boxes. \\ Default: \texttt{mnwidth=2.2cm}. +% \item[\texttt{boxcolour}] the colour of the box that encloses the +% comments (and of the lines that connect comments to the +% text). \\Default: \texttt{boxcolour=red}. +% \item[\texttt{hide}] Hides all notes. Useful for generating a final +% (camera-ready) version without comments, without actually removing +% the comments from the \LaTeX\ code. +% +% \changes{v0.6}{2013/04/22}{Added nosidenotes option} +% \changes{v0.8}{2014/11/05}{By default don't use sidenotes. Specify +% sidenotes option to use it. marginnote allows placement of MNOTEs on +% floats; sidenote doesn't seem to.} +% +% \item[\texttt{sidenotes}] use sidenote package instead of plain marginnote. +% \item[\texttt{basic}] This causes the note setting to fallback to +% \LaTeX{} kernel's \verb+\marginpar+, in case \texttt{sidenotes} or +% \texttt{tikz} isn't available. +% +% \changes{v0.6}{2013/04/22}{Added reverseconnect option} +% +% \item[\texttt{reverseconnect}] Some classes seem to call the right +% column 'first column' (i.e. they set \verb+\if@firstcolumn+ to +% \texttt{true} on the first column). This option tries to fix this, +% so the lines link to the notes on the right side of the boxes +% (west for right columns and east for left columns). The direction +% of connection can also be reversed in the document through the +% \verb+\ReverseMNConnect+ command. +% \end{itemize} +% +% \section{Usage} +% +% \DescribeMacro{\MNOTE} The \verb+\MNOTE[colour]{comments}+ places +% \texttt{comments} on the right margin of the document. Comments can +% contain any valid \LaTeX\ code, including text, pictures, tables +% etc. Comments are enclosed in boxes and linked to specific places in +% the text by lines, except when the option \texttt{basic} is passed to +% \verb+\usepackage+. If you are generating a \texttt{pdf} file with +% \texttt{pdflatex} (or \texttt{pdftex}) you might have to run it +% at least twice in order to get \texttt{tikz} to find the correct +% coordinates for lines and boxes. +% +% The aim was to keep the interface as simple as +% possible, so that the +% usage can be quickly explained to your collaborators, even if they +% are not regular \LaTeX\ users. The following example shows the basic +% usage: +% \begin{verbatim} +% The aim was to keep the interface as simple as +% possible\MNOTE{Revise this text}, so that the +% usage can be quickly explained to your collaborators, even if they +% are not regular \LaTeX\ users. +% \end{verbatim} +% +% \DescribeMacro{\HideMNOTES} Comments can be ``switched off'' at any +% point in the text by adding a \verb+\HideMNOTES{}+ command anywhere +% in the text. +% \DescribeMacro{\ShowMNOTES} +% They can be switched back on again through the +% \verb+\ShowMNOTES{}+ +% +% \DescribeMacro{\ReverseMNConnect} +% Toggle the side to which the comment boxes are connected to the +% text, to be used in case \LaTeX\ looses track of it. Package option +% \verb+reverseconnect+ reverses these connections globally. +% +% \section{Required packages} +% +% \begin{description} +% \item[kvoptions] for option processing +% \item[sidenotes] for note placement, including floats. N.B.: +% \texttt{sidenotes} is not required if \texttt{basic} or \texttt{nosidenotes} +% is passed +% as an option. In this case, note placement reverts to \LaTeX{}'s +% kernel's \verb+\marginpar+ macro. +% \item[tikz] for graphics (boxes and connectors). N.B.: +% \texttt{tikz} is note required if \texttt{basic} is passed as an +% option. +% \end{description}% +% +% \section{Bugs} +% +% The connectors sometimes go off the page when option +% \verb+nosidenotes+ is set (i.e. notes are set through \LaTeX\ kernnel's +% \verb+\marginpar+ macro). +% +% \section{Implementation} +% +% \iffalse +%<*package> +% \fi +% Define some defaults: width of comment bcx, colour, font and paperwidth. +% \begin{macrocode} +\expandafter\ifx\csname mnotespaperwidth\endcsname\relax + \newdimen\mnotespaperwidth + \mnotespaperwidth1.05\paperwidth +\fi +\newlength{\MNOTEWIDTH} +\setlength{\MNOTEWIDTH}{2.2cm} +\newcommand{\MNCOLOUR}{red} +\newcommand{\MNFONT}{\tiny} +\newif\if@mnotes@hide +\@mnotes@hidefalse +\newif\if@mnotes@basic +\@mnotes@basicfalse +\newif\if@mnotes@sidenotes +\@mnotes@sidenotesfalse +\newif\if@mnotes@scale +\@mnotes@scalefalse +\newif\if@mnotes@reverseconnect +\@mnotes@reverseconnectfalse +% \end{macrocode} +% Get package options +% \begin{macrocode} +\RequirePackage{kvoptions} +\DeclareVoidOption{basic}{\@mnotes@basictrue} +\DeclareVoidOption{sidenotes}{\@mnotes@sidenotestrue} +\DeclareVoidOption{hide}{\@mnotes@hidetrue \AtEndOfPackage{\HideMNOTES{}}} +\DeclareVoidOption{reverseconnect}{\@mnotes@reverseconnecttrue} +\SetupKeyvalOptions{family=mnotes, prefix=mnotes@} +\DeclareStringOption{scale}[1.05] +\define@key{mnotes}{scale}{\if@mnotes@hide\else% +\pdfpagewidth#1\paperwidth\@mnotes@scaletrue\fi} +\DeclareVoidOption{centre}{\if@mnotes@scale\hoffset\pdfpagewidth + \advance\hoffset-\paperwidth + \hoffset.5\hoffset\fi} +\DeclareStringOption{mnwidth}[\MNOTEWIDTH] +\define@key{mnotes}{mnwidth}{\setlength{\MNOTEWIDTH}{#1}} +\DeclareStringOption{boxcolour} +\define@key{mnotes}{boxcolour}{\renewcommand{\MNCOLOUR}{#1}} +\DeclareStringOption{fontsize}[6] +\define@key{mnotes}{fontsize}{% +\count1=#1 \multiply \count1 by 116 \divide \count1 by 100% +\def\MNFONT{\fontsize{#1}{\count1}\selectfont}} + %\ExecuteOptions{} +\ProcessKeyvalOptions{mnotes} +%\ProcessOptions +% \end{macrocode} +% \changes{v0.7}{2013/04/24}{made basic option independent of +% ifoddpage package} +% \begin{macrocode} +\if@twocolumn\if@mnotes@scale\hoffset\pdfpagewidth + \advance\hoffset-\paperwidth + \hoffset.5\hoffset\fi\fi +\if@mnotes@basic + \RequirePackage{color} + \newif\ifoddpage %% define \ifoddpage even though it's not used to +\else %% avoid extra bracket error + \if@mnotes@sidenotes + \RequirePackage{sidenotes} + \else + \RequirePackage{marginnote} + \renewcommand\marginpar\marginnote + \fi + \RequirePackage{tikz} + \RequirePackage{ifoddpage} +\fi +% \end{macrocode} +% \begin{macro}{\MNOTEon} +% This is the core of the notes macro. +% \changes{v0.6}{2013/04/22}{Fixed problems with margins for +% twocolumn and twoside documents, so that connectors connect to the +% right side of the notes box. For some strange reason, article.cls +% seems to call the right column 'first column' (i.e. \texttt{if@firstcolumn} +% true). Created an option reverseconnect to fix that, so the lines +% link to the notes on the right side of the boxes (west for right +% columns and east for left columns). } +% \changes{v0.6}{2013/04/22}{Use reverseconnect to set the left and +% right margins correctly in some classes.} +% \changes{v0.8}{2013/04/24}{replaced marginpar by marginnote on the +% nosidenote option to allow MNOTES in floats.} +% \begin{macrocode} +\if@mnotes@basic +\setlength{\marginparsep}{6pt}\setlength{\marginparwidth}{\MNOTEWIDTH} +\newcommand{\MNOTEon}[2][\MNCOLOUR]{% +\marginpar% +[{\MNFONT\raggedleft\color{#1}\em #2}]% +{\MNFONT\raggedright\color{#1}\em #2}}% +\else% not basic +\newcommand{\MNOTEon}[2][\MNCOLOUR]{ +\setlength{\marginparsep}{6pt}\setlength{\marginparwidth}{\MNOTEWIDTH} +\begin{tikzpicture}[remember picture, baseline=-0.75ex]% +\node [coordinate] (textPOS) {};% +\end{tikzpicture}% +\if@mnotes@sidenotes +\sidenotetext[\tiny.]% +{\MNFONT\raggedright\em% +\begin{tikzpicture}[remember picture]% +\draw node [draw=#1,text width=\MNOTEWIDTH-1pt] (notePOS) {#2};% +\end{tikzpicture} +}% +\else +\marginpar% +[{\MNFONT\raggedleft\em\begin{tikzpicture}[remember picture]% +\draw node [draw=#1,text width=\MNOTEWIDTH-1pt] (notePOS) {#2};% +\end{tikzpicture}}]% +{{\MNFONT\raggedright\em% +\begin{tikzpicture}[remember picture]% +\draw node [draw=#1,text width=\MNOTEWIDTH-1pt] (notePOS) {#2};% +\end{tikzpicture}% +}}% +\fi% +\if@twocolumn% + \if@firstcolumn% + \if@mnotes@reverseconnect + \mnoteswestlink{#1}% + \else + \mnoteseastlink{#1}% + \fi + \else% + \if@mnotes@reverseconnect + \mnoteseastlink{#1}% + \else + \mnoteswestlink{#1}% + \fi + \fi% +\else% + \if@twoside% + \checkoddpage% + \ifoddpage%\ifodd\value{mn@abspage}% + \mnoteswestlink{#1}% + \else% + \mnoteseastlink{#1}% + \fi% + \else% + \mnoteswestlink{#1}% + \fi% +\fi% +}% +\newcommand{\mnoteseastlink}[1]{% +\begin{tikzpicture}[remember picture, overlay]% + \draw[#1,-]% + ([yshift=-0.2cm] textPOS)% + -|([xshift=-0.1pt] notePOS.east);% + \end{tikzpicture}% +} +\newcommand{\mnoteswestlink}[1]{% +\begin{tikzpicture}[remember picture, overlay]% +\draw[#1,-]% +([yshift=-0.2cm] textPOS)% +-|([xshift=-0.1pt] notePOS.west);% + \end{tikzpicture}% +} +\fi +% \end{macrocode} +% \end{macro} +% \begin{macro}{\MNOTE} +% User interface to \verb+\MNOTEon+ +% \begin{macrocode} +\newcommand{\MNOTE}{\MNOTEon} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\HideMNOTES} +% Hide notes from this point on. +% \begin{macrocode} +\newcommand{\HideMNOTES}{\renewcommand{\MNOTE}[2][red]{}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ShowMNOTES} +% Show notes from this point on. +% \begin{macrocode} +\newcommand{\ShowMNOTES}{\renewcommand{\MNOTE}{\MNOTEon}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ReverseMNConnect} +% Reverse the side of from which the lines connect to the MNOTE box. +% \begin{macrocode} +\newcommand{\ReverseMNConnect}{% +\if@mnotes@reverseconnect\@mnotes@reverseconnectfalse +\else\@mnotes@reverseconnecttrue\fi} +% \end{macrocode} +% \end{macro} +% \Finale +\endinput diff --git a/macros/latex/contrib/mnotes/mnotes.ins b/macros/latex/contrib/mnotes/mnotes.ins new file mode 100644 index 0000000000..4180710061 --- /dev/null +++ b/macros/latex/contrib/mnotes/mnotes.ins @@ -0,0 +1,42 @@ +%% LaTeX2e file `mnotes.ins' +%% generated by the `filecontents' environment +%% from source `mnotes' on 2013/04/23. +%% +\def\batchfile{mnotes.ins} +\input docstrip.tex +\askforoverwritefalse +\keepsilent +\preamble + +This is a generated file. + +Copyright (C) 2013 by S Luz + +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 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 +2003/12/01 or later. + +\endpreamble +\generate{\file{mnotes.sty}{\from{mnotes.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{* mnotes.sty *} +\Msg{* *} +\Msg{* To produce the documentation run the file mnotes.dtx *} +\Msg{* through LaTeX. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{*************************************************************} +\endbatchfile diff --git a/macros/latex/contrib/mnotes/mnotes.pdf b/macros/latex/contrib/mnotes/mnotes.pdf new file mode 100644 index 0000000000..c5aab4221e Binary files /dev/null and b/macros/latex/contrib/mnotes/mnotes.pdf differ -- cgit v1.2.3