From 11e32119fc9aed18b083f92d64463e1342c285e9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 22 Feb 2009 00:20:00 +0000 Subject: marginnote update (20feb09) git-svn-id: svn://tug.org/texlive/trunk@12203 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/marginnote/marginnote.pdf | Bin 147858 -> 149325 bytes Master/texmf-dist/source/latex/marginnote/README | 11 ++- .../source/latex/marginnote/marginnote.dtx | 82 +++++++++++++++------ .../source/latex/marginnote/marginnote.ins | 2 +- .../texmf-dist/tex/latex/marginnote/marginnote.sty | 59 +++++++++------ 5 files changed, 108 insertions(+), 46 deletions(-) diff --git a/Master/texmf-dist/doc/latex/marginnote/marginnote.pdf b/Master/texmf-dist/doc/latex/marginnote/marginnote.pdf index 4206b399f2b..b6ce72b7968 100644 Binary files a/Master/texmf-dist/doc/latex/marginnote/marginnote.pdf and b/Master/texmf-dist/doc/latex/marginnote/marginnote.pdf differ diff --git a/Master/texmf-dist/source/latex/marginnote/README b/Master/texmf-dist/source/latex/marginnote/README index 1764260da20..47ede31b9b9 100644 --- a/Master/texmf-dist/source/latex/marginnote/README +++ b/Master/texmf-dist/source/latex/marginnote/README @@ -1,8 +1,8 @@ ---------------------------------------------------------------------------- Package marginnote -Copyright (c) Markus Kohm 2005-2008 +Copyright (c) Markus Kohm 2005-2009 Licence: LPPL -Version: 2008/11/10 v1.1a +Version: 2009/02/16 v1.1b ---------------------------------------------------------------------------- This package provides the command \marginnote that may be used instead of \marginpar at almost every place, where \marginpar cannot be used, e.g. @@ -41,4 +41,11 @@ If you instead of this have only the files marginnote.dtx, marginnote.ins marginnote.pdf (optional) and README, you have to call: tex marginnote.ins and follow the instructions. + +NOTE: README is part of the sources of the Work. To produce a legal and +valid distribution if the Work, you need only the source files +`marginnote.dtx', `marginnote.ins', and `README'. You are not allowed to +distribute any of these without the others. You are not allowed to +distribute the generated files `marginnote.sty' or `marginnote.pdf' without +these source files. See LPPL for definition of `distribution'! ---------------------------------------------------------------------------- diff --git a/Master/texmf-dist/source/latex/marginnote/marginnote.dtx b/Master/texmf-dist/source/latex/marginnote/marginnote.dtx index 7bc87d50a6e..e823e8f4c28 100644 --- a/Master/texmf-dist/source/latex/marginnote/marginnote.dtx +++ b/Master/texmf-dist/source/latex/marginnote/marginnote.dtx @@ -1,9 +1,9 @@ -% \CheckSum{534} +% \CheckSum{565} % \iffalse meta-comment % % marginnote.dtx % -%% Copyright (c) Markus Kohm 2005-2008 +%% Copyright (c) Markus Kohm 2005-2009 %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -31,7 +31,7 @@ % %\ProvidesPackage{marginnote}[% %<*driver|package> - 2008/11/10 v1.1a non floating margin notes for LaTeX] + 2009/02/16 v1.1b non floating margin notes for LaTeX] % %<*driver> \documentclass{ltxdoc} @@ -181,6 +181,11 @@ % means, if you are using two \cs{marginnote} commands at the same line, they % will be put on the same place. This is not a bug but a feature! % +% Since release~1.1b \cs{marginnote} between paragraphs (in vertical mode) +% will place the note between the paragaphs instead of the end of the previous +% paragraph. You may use \cs{leavevmode} or the third optional argument of +% \cs{marginnote} to place it different. +% % No page break may occure inside a margin note created with \cs{marginnote}. % % \cs{marginnote} somewhat different from \cs{marginpar} if used immediate @@ -240,6 +245,7 @@ % \changes{v1.1}{2006/10/23}{new switch}% % \changes{v1.1a}{2008/11/10}{PDF\TeX\ since 1.40 allows \cs{pdfsavepos} in % DVI mode too}% +% \changes{v1.1b}{2009/02/16}{if level fixed}% % We need to know, wether or not PDF\TeX{} and which version of PDF\TeX{} is % used. With PDF\TeX{} the horizontal output position may be detected using % \cs{pdfsavepos} and \cs{pdflastxpos}. So the relative position of the margin @@ -250,22 +256,24 @@ \newif\if@mn@pdfmode\@mn@pdfmodefalse \AtBeginDocument{% \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdflastxpos\endcsname\relax\else - \expandafter\ifx\csname pdftexversion\endcsname\relax + \expandafter\ifx\csname pdflastxpos\endcsname\relax\else% bg or 1 + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname pdftexversion\endcsname\relax% bg 2 \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdfoutput\endcsname\relax\else - \ifcase\pdfoutput\else\@mn@pdfmodetrue\fi - \fi - \else - \ifnum \pdftexversion<140 - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdfoutput\endcsname\relax\else - \ifcase\pdfoutput\else\@mn@pdfmodetrue\fi - \fi - \else - \@mn@pdfmodetrue - \fi - \fi + \expandafter\ifx\csname pdfoutput\endcsname\relax\else% bg or 3 + \ifcase\pdfoutput\else\@mn@pdfmodetrue\fi% bg ed 4 + \fi% ed 3 + \else% or 2 + \ifnum \pdftexversion<140% bg 3 + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname pdfoutput\endcsname\relax\else% bg or 4 + \ifcase\pdfoutput\else\@mn@pdfmodetrue\fi% bg ed 5 + \fi% ed 4 + \else% or 3 + \@mn@pdfmodetrue + \fi% ed 3 + \fi% ed 2 + \fi% ed 1 \if@mn@verbose \if@mn@pdfmode \PackageInfo{marginnote}{% @@ -457,6 +465,7 @@ \newcommand{\@mn@@@marginnote}{} \def\@mn@@@marginnote[#1]#2[#3]{% % \end{macrocode} +% \changes{v1.1b}{2009/02/16}{use \cs{mn@vadjust} instead of \cs{vadjust}}% % All changes (but change of counters that are global because of using the % \LaTeX{} commands to change them an \cs{gdef} and \cs{xdef}) should be % local. In h-mode a \cs{strut} will be used to fix base line. The margin @@ -467,9 +476,9 @@ % to leave v-mode first. % \begin{macrocode} \begingroup - \ifmmode\strut\let\@tempa\vadjust\else + \ifmmode\strut\let\@tempa\mn@vadjust\else \if@inlabel\leavevmode\fi - \ifhmode\strut\let\@tempa\vadjust\else\let\@tempa\mn@vlap\fi + \ifhmode\strut\let\@tempa\mn@vadjust\else\let\@tempa\mn@vlap\fi \fi \@tempa{% % \end{macrocode} @@ -535,7 +544,7 @@ % \end{macrocode} % Here's the correction of the vertical position. The rest is simple. % \begin{macrocode} - \kern-\baselineskip\kern-\parskip + \kern-\parskip \marginfont\raggedrightmarginnote\hspace{\z@}\strut#2\endgraf \vss}% \vss}% @@ -548,7 +557,7 @@ % \end{macrocode} % Same like above for left margins. % \begin{macrocode} - \kern-\baselineskip\kern-\parskip + \kern-\parskip \marginfont\raggedleftmarginnote\hspace{\z@}\strut#1\endgraf \vss}% \vss}% @@ -635,6 +644,35 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\mn@zbox} +% \changes{v1.1b}{2009/02/16}{new (internal)} +% This macro is used to set a horizontal box without height, depth and width. +% \begin{macrocode} +\newcommand{\mn@zbox}[1]{% + \bgroup + \setbox\@tempboxa\vbox{#1}% + \ht\@tempboxa\ht\strutbox + \dp\@tempboxa\dp\strutbox + \wd\@tempboxa\z@ + \box\@tempboxa + \egroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mn@vadjust} +% \changes{v1.1b}{2009/02/16}{new (internal)} +% This macro is used to set a vertical box at horizontal mode. +% \begin{macrocode} +\newcommand{\mn@vadjust}[1]{% + \mn@zbox{\kern-\parskip + \leavevmode\vadjust{#1}% + \kern\parskip + }% +} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\marginfont} % \changes{v1.0a}{2006/02/06}{Use \cs{providecommand} to define it.} % \begin{macro}{\raggedleftmarginnote} diff --git a/Master/texmf-dist/source/latex/marginnote/marginnote.ins b/Master/texmf-dist/source/latex/marginnote/marginnote.ins index f1198f17a72..e59a8318c8f 100644 --- a/Master/texmf-dist/source/latex/marginnote/marginnote.ins +++ b/Master/texmf-dist/source/latex/marginnote/marginnote.ins @@ -1,7 +1,7 @@ % % marginnote.ins % -%% Copyright (c) Markus Kohm 2005-2006 +%% Copyright (c) Markus Kohm 2005-2009 %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/tex/latex/marginnote/marginnote.sty b/Master/texmf-dist/tex/latex/marginnote/marginnote.sty index f5d37b57e71..cdab2dba136 100644 --- a/Master/texmf-dist/tex/latex/marginnote/marginnote.sty +++ b/Master/texmf-dist/tex/latex/marginnote/marginnote.sty @@ -12,7 +12,7 @@ %% without the source ot the work. See below about more informations %% about the files the work consists of. %% -%% Copyright (c) Markus Kohm 2005-2008 +%% Copyright (c) Markus Kohm 2005-2009 %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -35,7 +35,7 @@ %% the Work (see ``Important Recommendations'' at lppl.txt). %% \ProvidesPackage{marginnote}[% - 2008/11/10 v1.1a non floating margin notes for LaTeX] + 2009/02/16 v1.1b non floating margin notes for LaTeX] \newif\if@mn@verbose\@mn@verbosetrue \DeclareOption{verbose}{\@mn@verbosetrue} \DeclareOption{quiet}{\@mn@verbosefalse} @@ -45,22 +45,24 @@ \newif\if@mn@pdfmode\@mn@pdfmodefalse \AtBeginDocument{% \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdflastxpos\endcsname\relax\else - \expandafter\ifx\csname pdftexversion\endcsname\relax + \expandafter\ifx\csname pdflastxpos\endcsname\relax\else% bg or 1 + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname pdftexversion\endcsname\relax% bg 2 \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdfoutput\endcsname\relax\else - \ifcase\pdfoutput\else\@mn@pdfmodetrue\fi - \fi - \else - \ifnum \pdftexversion<140 - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdfoutput\endcsname\relax\else - \ifcase\pdfoutput\else\@mn@pdfmodetrue\fi - \fi - \else - \@mn@pdfmodetrue - \fi - \fi + \expandafter\ifx\csname pdfoutput\endcsname\relax\else% bg or 3 + \ifcase\pdfoutput\else\@mn@pdfmodetrue\fi% bg ed 4 + \fi% ed 3 + \else% or 2 + \ifnum \pdftexversion<140% bg 3 + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname pdfoutput\endcsname\relax\else% bg or 4 + \ifcase\pdfoutput\else\@mn@pdfmodetrue\fi% bg ed 5 + \fi% ed 4 + \else% or 3 + \@mn@pdfmodetrue + \fi% ed 3 + \fi% ed 2 + \fi% ed 1 \if@mn@verbose \if@mn@pdfmode \PackageInfo{marginnote}{% @@ -180,9 +182,9 @@ \newcommand{\@mn@@@marginnote}{} \def\@mn@@@marginnote[#1]#2[#3]{% \begingroup - \ifmmode\strut\let\@tempa\vadjust\else + \ifmmode\strut\let\@tempa\mn@vadjust\else \if@inlabel\leavevmode\fi - \ifhmode\strut\let\@tempa\vadjust\else\let\@tempa\mn@vlap\fi + \ifhmode\strut\let\@tempa\mn@vadjust\else\let\@tempa\mn@vlap\fi \fi \@tempa{% \vbox to\z@{% @@ -235,7 +237,7 @@ \vbox to\z@{\kern\marginnotevadjust\kern #3 \vbox to\z@{% \hsize\marginparwidth - \kern-\baselineskip\kern-\parskip + \kern-\parskip \marginfont\raggedrightmarginnote\hspace{\z@}\strut#2\endgraf \vss}% \vss}% @@ -245,7 +247,7 @@ \vbox to\z@{\kern #3 \vbox to\z@{% \hsize\marginparwidth - \kern-\baselineskip\kern-\parskip + \kern-\parskip \marginfont\raggedleftmarginnote\hspace{\z@}\strut#1\endgraf \vss}% \vss}% @@ -301,6 +303,21 @@ \setbox\@tempboxa\vbox to \ht\strutbox{#1\vss}% \box\@tempboxa\vskip-\baselineskip } +\newcommand{\mn@zbox}[1]{% + \bgroup + \setbox\@tempboxa\vbox{#1}% + \ht\@tempboxa\ht\strutbox + \dp\@tempboxa\dp\strutbox + \wd\@tempboxa\z@ + \box\@tempboxa + \egroup +} +\newcommand{\mn@vadjust}[1]{% + \mn@zbox{\kern-\parskip + \leavevmode\vadjust{#1}% + \kern\parskip + }% +} \providecommand*{\marginfont}{} \newcommand*{\raggedleftmarginnote}{\raggedleft} \newcommand*{\raggedrightmarginnote}{\raggedright} -- cgit v1.2.3