From 15652fc1ecc70dc5be9721fef2a3be4743218b01 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 26 May 2022 19:51:34 +0000 Subject: mnotes (26may22) git-svn-id: svn://tug.org/texlive/trunk@63406 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/mnotes/Makefile | 57 +++++++++++++++++ Master/texmf-dist/source/latex/mnotes/mnotes.dtx | 81 ++++++++++++++++++------ 2 files changed, 120 insertions(+), 18 deletions(-) create mode 100644 Master/texmf-dist/source/latex/mnotes/Makefile (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/mnotes/Makefile b/Master/texmf-dist/source/latex/mnotes/Makefile new file mode 100644 index 00000000000..2cc0d6aac27 --- /dev/null +++ b/Master/texmf-dist/source/latex/mnotes/Makefile @@ -0,0 +1,57 @@ +SHELL=/bin/bash +NAME=mnotes +VERSION=0.9 +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/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 +Copyright (C) 2013-2021 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 @@ -93,7 +92,7 @@ and version 1.3 or later is part of all distributions of LaTeX version % %\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> \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[]{}{}+ macro +% defines a command for personalised comments by author \verb+name+ by +% setting up the command \verb+\mn[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[]{}{color}' +% Example: +% \verb'\Mnewauthor[SL]{Nino}{yellow}' +% Sets up the command \verb'\mn{}' 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} -- cgit v1.2.3