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 /Master/texmf-dist/tex/latex | |
parent | 99b15e8f9f4310adb761bf677acad63828e3663b (diff) |
mnotes (26may22)
git-svn-id: svn://tug.org/texlive/trunk@63406 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/mnotes/mnotes.sty | 38 |
1 files changed, 26 insertions, 12 deletions
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}} |