diff options
author | Karl Berry <karl@freefriends.org> | 2022-05-26 19:51:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-05-26 19:51:34 +0000 |
commit | 15652fc1ecc70dc5be9721fef2a3be4743218b01 (patch) | |
tree | 86422867c48f730e63b95913bd9b73d8e8d703aa | |
parent | 99b15e8f9f4310adb761bf677acad63828e3663b (diff) |
mnotes (26may22)
git-svn-id: svn://tug.org/texlive/trunk@63406 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/mnotes/mnotes.pdf | bin | 210491 -> 212401 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/mnotes/Makefile (renamed from Master/texmf-dist/doc/latex/mnotes/Makefile) | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mnotes/mnotes.dtx | 81 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mnotes/mnotes.sty | 38 |
4 files changed, 90 insertions, 31 deletions
diff --git a/Master/texmf-dist/doc/latex/mnotes/mnotes.pdf b/Master/texmf-dist/doc/latex/mnotes/mnotes.pdf Binary files differindex c5aab4221ed..ee8f03072c8 100644 --- a/Master/texmf-dist/doc/latex/mnotes/mnotes.pdf +++ b/Master/texmf-dist/doc/latex/mnotes/mnotes.pdf diff --git a/Master/texmf-dist/doc/latex/mnotes/Makefile b/Master/texmf-dist/source/latex/mnotes/Makefile index e9d5e727a8b..2cc0d6aac27 100644 --- a/Master/texmf-dist/doc/latex/mnotes/Makefile +++ b/Master/texmf-dist/source/latex/mnotes/Makefile @@ -1,6 +1,6 @@ SHELL=/bin/bash NAME=mnotes -VERSION=0.8 +VERSION=0.9 DISTDIR=$(NAME) ARCHIVE_NAME=/tmp/$(NAME)-$(VERSION).tar.gz DISTFILES=$(NAME).dtx Makefile README $(NAME).ins $(NAME).pdf diff --git a/Master/texmf-dist/source/latex/mnotes/mnotes.dtx b/Master/texmf-dist/source/latex/mnotes/mnotes.dtx index babd0566a6c..35a406bf017 100644 --- a/Master/texmf-dist/source/latex/mnotes/mnotes.dtx +++ b/Master/texmf-dist/source/latex/mnotes/mnotes.dtx @@ -28,13 +28,12 @@ % %% @LaTeX-package-file{ %% author = "Saturnino Luz", -%% version = "0.6", -%% date = "18 April 2013", +%% version = "0.9", +%% date = "25 May 2022", %% filename = "mnotes.dtx", %% address = "S Luz -%% Trinity College %% Dublin, Ireland", -%% URL = "http://www.scss.tcd.ie/~luzs/", +%% URL = "https://gitlab.com/e1700/mnotes/", %% email = "luzs@acm.org", %% codetable = "ISO/ASCII", %% keywords = "margin, notes, comments", @@ -55,7 +54,7 @@ This is a generated file. -Copyright (C) 2013 by S Luz <luzs@acm.org> +Copyright (C) 2013-2021 by S Luz <luzs@acm.org> This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license @@ -93,7 +92,7 @@ and version 1.3 or later is part of all distributions of LaTeX version %</driver> %<package>\ProvidesPackage{mnotes}[% %<*driver|package> - 2013/20/04 v0.7 margin notes for collaborative document editing] + 2022/25/05 v0.9 margin notes for collaborative document editing] %</driver|package> %<*driver> \documentclass{ltxdoc} @@ -153,7 +152,7 @@ and version 1.3 or later is part of all distributions of LaTeX version % % \section{Package options} % -% The basic usage is to include a \verb+\usepackage{mnote}+ to the +% The basic usage is to include a \verb+\usepackage{mnotes}+ to the % preamble of your \LaTeX\ document. % % The \textsf{mnotes} package also provides some basic @@ -227,6 +226,23 @@ and version 1.3 or later is part of all distributions of LaTeX version % are not regular \LaTeX\ users. % \end{verbatim} % +% \DescribeMacro{\Mnewauthor} Define author-specific margin notes for +% comments. \\The +% \verb+\Mnewauthor[<initials>]{<name>}{<todonote specs>}+ macro +% defines a command for personalised comments by author \verb+name+ by +% setting up the command \verb+\mn<initials>[highlight]{comment}+ +% which can then be used in the text. Usage: +% \begin{verbatim} +% \newauthor[BD]{Bob}{yellow} +% \end{verbatim} +% This defines \verb+\mnBD+, which can be used to comment and highlight +% as follows: +% \begin{verbatim} +% \mnBD[this is highlighted]{this is a margin note.} or, +% alternatively, without highlighting +% \mnBDhis is a margin note with no highlights.} +% \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. @@ -248,6 +264,7 @@ and version 1.3 or later is part of all distributions of LaTeX version % is passed % as an option. In this case, note placement reverts to \LaTeX{}'s % kernel's \verb+\marginpar+ macro. +% \item[soul] for highlighting. % \item[tikz] for graphics (boxes and connectors). N.B.: % \texttt{tikz} is note required if \texttt{basic} is passed as an % option. @@ -288,6 +305,7 @@ and version 1.3 or later is part of all distributions of LaTeX version % Get package options % \begin{macrocode} \RequirePackage{kvoptions} +\RequirePackage{soul} \DeclareVoidOption{basic}{\@mnotes@basictrue} \DeclareVoidOption{sidenotes}{\@mnotes@sidenotestrue} \DeclareVoidOption{hide}{\@mnotes@hidetrue \AtEndOfPackage{\HideMNOTES{}}} @@ -295,8 +313,8 @@ and version 1.3 or later is part of all distributions of LaTeX version \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 +\setlength{\paperwidth}{#1\paperwidth}\@mnotes@scaletrue\fi} +\DeclareVoidOption{centre}{\if@mnotes@scale\hoffset\paperwidth \advance\hoffset-\paperwidth \hoffset.5\hoffset\fi} \DeclareStringOption{mnwidth}[\MNOTEWIDTH] @@ -307,6 +325,8 @@ and version 1.3 or later is part of all distributions of LaTeX version \define@key{mnotes}{fontsize}{% \count1=#1 \multiply \count1 by 116 \divide \count1 by 100% \def\MNFONT{\fontsize{#1}{\count1}\selectfont}} +%% try to keep notes on the same margin +% \makeatletter \@mparswitchfalse \makeatother %\ExecuteOptions{} \ProcessKeyvalOptions{mnotes} %\ProcessOptions @@ -352,8 +372,8 @@ and version 1.3 or later is part of all distributions of LaTeX version [{\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} +\newcommand{\MNOTEon}[2][\MNCOLOUR]{% +\setlength{\marginparsep}{6pt}\setlength{\marginparwidth}{\MNOTEWIDTH}% \begin{tikzpicture}[remember picture, baseline=-0.75ex]% \node [coordinate] (textPOS) {};% \end{tikzpicture}% @@ -362,7 +382,7 @@ and version 1.3 or later is part of all distributions of LaTeX version {\MNFONT\raggedright\em% \begin{tikzpicture}[remember picture]% \draw node [draw=#1,text width=\MNOTEWIDTH-1pt] (notePOS) {#2};% -\end{tikzpicture} +\end{tikzpicture}% }% \else \marginpar% @@ -377,17 +397,17 @@ and version 1.3 or later is part of all distributions of LaTeX version \fi% \if@twocolumn% \if@firstcolumn% - \if@mnotes@reverseconnect + \if@mnotes@reverseconnect% \mnoteswestlink{#1}% - \else + \else% \mnoteseastlink{#1}% - \fi + \fi% \else% - \if@mnotes@reverseconnect + \if@mnotes@reverseconnect% \mnoteseastlink{#1}% - \else + \else% \mnoteswestlink{#1}% - \fi + \fi% \fi% \else% \if@twoside% @@ -419,6 +439,31 @@ and version 1.3 or later is part of all distributions of LaTeX version \fi % \end{macrocode} % \end{macro} +%\begin{macro} +% Define author-specific margin notes for comments. +% Syntax: \verb'\Mnewauthor[<initials>]{<name>}{color}' +% Example: +% \verb'\Mnewauthor[SL]{Nino}{yellow}' +% Sets up the command \verb'\mn<initials>{}' which can then be used in the +% text. +% E.g.: +% \verb'\mnSL[this is highlighted]{this is a margin note.}' +% \verb'\mnSL{this is a margin note with no highlights.}' +% \begin{macrocode} +\newcommand{\Mnewauthor}[3][]{% + % If #1 is not given, use #2 by default as the cmd name + \def\@tempa{#1}% + \ifx\@tempa\@empty% + \def\@authid{#2}% + \else% + \def\@authid{#1}% + \fi% + % Define the \mnX command with the colour and so on + \expandafter\newcommand\csname mn\@authid\endcsname[2][]{% + \if@mnotes@hide ##1\else\sethlcolor{#3}\hl{##1}\MNOTE[#3]{#2: ##2}{}\fi}% +} +% \end{macrocode} +% \end{macro} % \begin{macro}{\MNOTE} % User interface to \verb+\MNOTEon+ % \begin{macrocode} diff --git a/Master/texmf-dist/tex/latex/mnotes/mnotes.sty b/Master/texmf-dist/tex/latex/mnotes/mnotes.sty index 32cfb193619..b35f19cfe84 100644 --- a/Master/texmf-dist/tex/latex/mnotes/mnotes.sty +++ b/Master/texmf-dist/tex/latex/mnotes/mnotes.sty @@ -21,7 +21,7 @@ %% 2003/12/01 or later. %% \ProvidesPackage{mnotes}[% - 2013/20/04 v0.7 margin notes for collaborative document editing] + 2022/25/05 v0.9 margin notes for collaborative document editing] \expandafter\ifx\csname mnotespaperwidth\endcsname\relax \newdimen\mnotespaperwidth \mnotespaperwidth1.05\paperwidth @@ -41,6 +41,7 @@ \newif\if@mnotes@reverseconnect \@mnotes@reverseconnectfalse \RequirePackage{kvoptions} +\RequirePackage{soul} \DeclareVoidOption{basic}{\@mnotes@basictrue} \DeclareVoidOption{sidenotes}{\@mnotes@sidenotestrue} \DeclareVoidOption{hide}{\@mnotes@hidetrue \AtEndOfPackage{\HideMNOTES{}}} @@ -48,8 +49,8 @@ \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 +\setlength{\paperwidth}{#1\paperwidth}\@mnotes@scaletrue\fi} +\DeclareVoidOption{centre}{\if@mnotes@scale\hoffset\paperwidth \advance\hoffset-\paperwidth \hoffset.5\hoffset\fi} \DeclareStringOption{mnwidth}[\MNOTEWIDTH] @@ -60,6 +61,7 @@ \define@key{mnotes}{fontsize}{% \count1=#1 \multiply \count1 by 116 \divide \count1 by 100% \def\MNFONT{\fontsize{#1}{\count1}\selectfont}} +%% try to keep notes on the same margin %\ExecuteOptions{} \ProcessKeyvalOptions{mnotes} \if@twocolumn\if@mnotes@scale\hoffset\pdfpagewidth @@ -85,8 +87,8 @@ [{\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} +\newcommand{\MNOTEon}[2][\MNCOLOUR]{% +\setlength{\marginparsep}{6pt}\setlength{\marginparwidth}{\MNOTEWIDTH}% \begin{tikzpicture}[remember picture, baseline=-0.75ex]% \node [coordinate] (textPOS) {};% \end{tikzpicture}% @@ -95,7 +97,7 @@ {\MNFONT\raggedright\em% \begin{tikzpicture}[remember picture]% \draw node [draw=#1,text width=\MNOTEWIDTH-1pt] (notePOS) {#2};% -\end{tikzpicture} +\end{tikzpicture}% }% \else \marginpar% @@ -110,17 +112,17 @@ \fi% \if@twocolumn% \if@firstcolumn% - \if@mnotes@reverseconnect + \if@mnotes@reverseconnect% \mnoteswestlink{#1}% - \else + \else% \mnoteseastlink{#1}% - \fi + \fi% \else% - \if@mnotes@reverseconnect + \if@mnotes@reverseconnect% \mnoteseastlink{#1}% - \else + \else% \mnoteswestlink{#1}% - \fi + \fi% \fi% \else% \if@twoside% @@ -150,6 +152,18 @@ \end{tikzpicture}% } \fi +\newcommand{\Mnewauthor}[3][]{% + % If #1 is not given, use #2 by default as the cmd name + \def\@tempa{#1}% + \ifx\@tempa\@empty% + \def\@authid{#2}% + \else% + \def\@authid{#1}% + \fi% + % Define the \mnX command with the colour and so on + \expandafter\newcommand\csname mn\@authid\endcsname[2][]{% + \if@mnotes@hide ##1\else\sethlcolor{#3}\hl{##1}\MNOTE[#3]{#2: ##2}{}\fi}% +} \newcommand{\MNOTE}{\MNOTEon} \newcommand{\HideMNOTES}{\renewcommand{\MNOTE}[2][red]{}} \newcommand{\ShowMNOTES}{\renewcommand{\MNOTE}{\MNOTEon}} |