summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/marginnote/marginnote.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/marginnote/marginnote.dtx')
-rw-r--r--Master/texmf-dist/source/latex/marginnote/marginnote.dtx143
1 files changed, 112 insertions, 31 deletions
diff --git a/Master/texmf-dist/source/latex/marginnote/marginnote.dtx b/Master/texmf-dist/source/latex/marginnote/marginnote.dtx
index f0b79ab571d..42328574023 100644
--- a/Master/texmf-dist/source/latex/marginnote/marginnote.dtx
+++ b/Master/texmf-dist/source/latex/marginnote/marginnote.dtx
@@ -1,9 +1,9 @@
-% \CheckSum{662}
+% \CheckSum{757}
% \iffalse meta-comment
%
% marginnote.dtx
%
-%% Copyright (c) Markus Kohm 2005-2009
+%% Copyright (c) Markus Kohm 2005-2010
%%
%% 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>
- 2009/05/06 v1.1d non floating margin notes for LaTeX]
+ 2010/01/05 v1.1f non floating margin notes for LaTeX]
%</driver|package>
%<*driver>
\documentclass{ltxdoc}
@@ -64,6 +64,8 @@
% \cs{marginpar}. But there might be other problems \dots
% \end{abstract}
%
+% \tableofcontents
+%
% \changes{v1.0b}{2006/14/03}{spelling fixes}
%
% \section{How to Use \textsf{marginnote} Package}
@@ -72,7 +74,24 @@
% \begin{verbatim}
% \usepackage{marginnote}
% \end{verbatim}\vskip-\baselineskip
-% to do so.
+% to do so. You may also use one of the following options for a global change
+% of the behaviour of \textsf{marginnote}:
+% \begin{description}
+% \item[\texttt{fulladjust}] adjusts the margin note at the height and depth of
+% the current line. Note, that this may sometimes result in extra height and
+% depth of the current line, but results in the best vertical
+% alignment. This is the default.
+% \item[\texttt{heightadjust}] adjusts the margin note at the height of the
+% current line but not the depth. Note, that this may sometimes result in
+% extra height of the current line and in vertical misplacement.
+% \item[\texttt{depthadjust}] adjusts the margin note at the depth of the
+% current line but not height. Note, that this may sometimes result in extra
+% depth of the current line and very often in vertical misplacement.
+% \item[\texttt{noadjust}] does not adjust the margin note at the height or
+% depth of the current line. Note, that this often results in vertical
+% misplacement but seldom in vertical extra space before or after the current
+% line.
+% \end{description}
%
% \DescribeMacro{\marginnote}
% The command \cs{marginnote}\oarg{left}\marg{right}\oarg{voffset} my be used
@@ -176,9 +195,10 @@
% margin note at the correct position. But under some circumstances this may
% fail. You may adjust the vertical position of the margin note using the
% second optional argument of \cs{marginnote}. Sometimes even the text outside
-% \cs{marginnote} will be moved because of using \cs{marginnote}. There's
-% currently no other solution for this problem then moving the \cs{marginnote}
-% command.
+% \cs{marginnote} will be moved because of using \cs{marginnote}. You may use
+% one of the package options \texttt{fulladjust}, \texttt{heightadjust},
+% \texttt{depthajust} or \texttt{noajust} to change the global adjustment or
+% a local redefinition of |\mn@strut| or |\mn@zbox|.
%
% Note: The margin note will be placed at the current vertical line. This
% means, if you are using two \cs{marginnote} commands at the same line, they
@@ -204,7 +224,8 @@
% Sometimes lines are stretched vertically using \cs{marginnote}, e.g.\ if
% you're using \cs{marginnote} at a list \emph{and} upper case umlauts like
% ``\"U'' or if \verb|\lineskiplimit>0pt|. In this case
-% \verb|\lineskiplimit=-\maxdimen| should help.
+% \verb|\lineskiplimit=0pt| or \verb|\lineskiplimit=-\maxdimen|, or one of the
+% options may help.
%
% You should not use \cs{marginnote} at the optional argument of \cs{item}.
%
@@ -257,8 +278,78 @@
% \end{macrocode}
% \end{macro}
%
+% \changes{v1.1e}{2009/06/06}{new options \texttt{fulladjust},
+% \texttt{heightadjust}, \texttt{depthadjust}, and \texttt{noadjust}}
+% \begin{macro}{\mn@strut}
+% \changes{v1.1e}{2009/06/06}{new (semi internal)}
+% The package needs to adjust the margin note at the current line. Sometimes
+% this provocates extra vertical line spacing. To avoid this you may redefine
+% \cs{mn@strut}. The default value is \cs{strut}.
+% \begin{macrocode}
+\newcommand*{\mn@strut}{}
+% \end{macrocode}
+% \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]{}
+% \end{macrocode}
+% The options do redefine both, \cs{mn@strut} and \cs{mn@zbox}.
+% \begin{macrocode}
+\DeclareOption{fulladjust}{%
+ \renewcommand*{\mn@strut}{\strut}%
+ \renewcommand{\mn@zbox}[1]{%
+ \bgroup
+ \setbox\@tempboxa\vbox{#1}%
+ \ht\@tempboxa\ht\strutbox
+ \dp\@tempboxa\dp\strutbox
+ \wd\@tempboxa\z@
+ \box\@tempboxa
+ \egroup
+ }%
+}
+\DeclareOption{heightadjust}{%
+ \renewcommand*{\mn@strut}{\begingroup\dp\strutbox\z@\strut\endgroup}%
+ \renewcommand{\mn@zbox}[1]{%
+ \bgroup
+ \setbox\@tempboxa\vbox{#1}%
+ \ht\@tempboxa\ht\strutbox
+ \dp\@tempboxa\dp\z@
+ \wd\@tempboxa\z@
+ \box\@tempboxa
+ \egroup
+ }%
+}
+\DeclareOption{depthadjust}{%
+ \renewcommand*{\mn@strut}{\begingroup\ht\strutbox\z@\strut\endgroup}%
+ \renewcommand{\mn@zbox}[1]{%
+ \bgroup
+ \setbox\@tempboxa\vbox{#1}%
+ \ht\@tempboxa\ht\z@
+ \dp\@tempboxa\dp\strutbox
+ \wd\@tempboxa\z@
+ \box\@tempboxa
+ \egroup
+ }%
+}
+\DeclareOption{noadjust}{%
+ \renewcommand*{\mn@strut}{\relax}%
+ \renewcommand{\mn@zbox}[1]{%
+ \bgroup
+ \setbox\@tempboxa\vbox{\kern-\ht\strutbox #1}%
+ \ht\@tempboxa\ht\z@
+ \dp\@tempboxa\dp\z@
+ \wd\@tempboxa\z@
+ \box\@tempboxa
+ \egroup
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macrocode}
-\ExecuteOptions{verbose}
+\ExecuteOptions{verbose,fulladjust}
\ProcessOptions\relax
% \end{macrocode}
%
@@ -412,7 +503,7 @@
}%
\fi
% \end{macrocode}
-% If the margin note label was not defined, it seams to be new. In this case
+% If the margin note label was not defined, it seems to be new. In this case
% the absolut page number will be used for the test instead of the saved
% real page number.
% \begin{macrocode}
@@ -524,6 +615,7 @@
\def\@mn@@@marginnote[#1]#2[#3]{%
% \end{macrocode}
% \changes{v1.1b}{2009/02/16}{use \cs{mn@vadjust} instead of \cs{vadjust}}%
+% \changes{v1.1e}{2009/06/06}{use \cs{mn@strut} instead of \cs{strut}}%
% 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
@@ -534,9 +626,9 @@
% to leave v-mode first.
% \begin{macrocode}
\begingroup
- \ifmmode\strut\let\@tempa\mn@vadjust\else
+ \ifmmode\mn@strut\let\@tempa\mn@vadjust\else
\if@inlabel\leavevmode\fi
- \ifhmode\strut\let\@tempa\mn@vadjust\else\let\@tempa\mn@vlap\fi
+ \ifhmode\mn@strut\let\@tempa\mn@vadjust\else\let\@tempa\mn@vlap\fi
\fi
\@tempa{%
% \end{macrocode}
@@ -576,7 +668,7 @@
\else
\if@mn@verbose
\PackageInfo{marginnote}{%
- xpos seams to be \@mn@currxpos,\MessageBreak
+ xpos seems to be \@mn@currxpos,\MessageBreak
\string\marginnoterightadjust
\space ignored}%
\fi
@@ -608,8 +700,13 @@
\vss}%
}%
\else
+% \end{macrocode}
+% Using the left margin.
+% \changes{v1.1f}{2010/01/05}{missing usage of \cs{marginnotevadjust} on
+% left margin fixed}
+% \begin{macrocode}
\llap{%
- \vbox to\z@{\kern #3
+ \vbox to\z@{\kern\marginnotevadjust\kern #3
\vbox to\z@{%
\hsize\marginparwidth
% \end{macrocode}
@@ -636,7 +733,7 @@
\else
\if@mn@verbose
\PackageInfo{marginnote}{%
- xpos seams to be \@mn@currxpos,\MessageBreak
+ xpos seems to be \@mn@currxpos,\MessageBreak
\string\marginnoteleftadjust
\space ignored}%
\fi
@@ -702,22 +799,6 @@
% \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.