diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/marginnote/marginnote.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/marginnote/marginnote.dtx | 82 |
1 files changed, 60 insertions, 22 deletions
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 @@ %</driver> %<package>\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|package> %<*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} |