summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/marginnote/marginnote.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-02-22 00:20:00 +0000
committerKarl Berry <karl@freefriends.org>2009-02-22 00:20:00 +0000
commit11e32119fc9aed18b083f92d64463e1342c285e9 (patch)
treec4738c0e154f33f81811570708dc6a1849aa4f86 /Master/texmf-dist/tex/latex/marginnote/marginnote.sty
parent22862769b10e5e0de5117786a9e51daa8391deaf (diff)
marginnote update (20feb09)
git-svn-id: svn://tug.org/texlive/trunk@12203 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/marginnote/marginnote.sty')
-rw-r--r--Master/texmf-dist/tex/latex/marginnote/marginnote.sty59
1 files changed, 38 insertions, 21 deletions
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}