summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/changebar/changebar.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-04 21:37:38 +0000
committerKarl Berry <karl@freefriends.org>2018-02-04 21:37:38 +0000
commit46ee79bdff3d640ffdb5af64fe7d566c7a56d465 (patch)
tree60f8eb402dee5d0da22c16a4e8e01175511a0a08 /Master/texmf-dist/tex/latex/changebar/changebar.sty
parent7df71d21a634fa2ea2f83c35b0192f181cc37fb9 (diff)
changebar (4feb18)
git-svn-id: svn://tug.org/texlive/trunk@46540 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/changebar/changebar.sty')
-rw-r--r--Master/texmf-dist/tex/latex/changebar/changebar.sty193
1 files changed, 181 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/changebar/changebar.sty b/Master/texmf-dist/tex/latex/changebar/changebar.sty
index d7a6295adf8..c43be2cd1f2 100644
--- a/Master/texmf-dist/tex/latex/changebar/changebar.sty
+++ b/Master/texmf-dist/tex/latex/changebar/changebar.sty
@@ -7,7 +7,7 @@
%% changebar.dtx (with options: `package')
%% This is a generated file.
%%
-%% Copyright (C) 1994-2005 Johannes Braams, All rights reserved.
+%% Copyright (C) 1994-2018 Johannes Braams, All rights reserved.
%%
%% This file was generated from file(s) of the changebar package.
%% --------------------------------------------------------------
@@ -34,10 +34,10 @@
%% The list of derived (unpacked) files belonging to the distribution
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
-%% Copyright 1994-2005 (C) Johannes Braams. All rights reserved.
+%% Copyright 1994-2018 (C) Johannes Braams. All rights reserved.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{changebar}
- [2005/09/18 v3.5c Indicate changes with marginal bars]
+ [2018/02/04 v3.6b Indicate changes with marginal bars]
\def\cb@maxpoint{80}
\def\cb@minpoint{1}
\def\cb@nil{0}
@@ -119,6 +119,26 @@
{PDFTeX option cannot be used}%
{You are using a LaTeX run which does not generate PDF\MessageBreak
or you are using a very old version of PDFTeX}}
+\DeclareOption{XeTeX}{\cb@xetexcheck}
+\DeclareOption{xetex}{\cb@xetexcheck}
+\def\cb@xetexcheck{%
+ \expandafter\ifx\csname XeTeXrevision\endcsname\@undefined \cb@xetexerror
+ \else
+ \global\chardef\cb@driver@setup=7\relax
+ \ifx\cb@writexy\@undefined
+ \newwrite\cb@writexy
+ \newread\cb@readxy
+ \immediate\openout\cb@writexy=\jobname.cb2\relax
+ \fi
+ \gdef\cb@pdfxy##1##2##3##4##5{%
+ \immediate\write\cb@writexy{##1.##2p##3,##4,##5}%
+ \expandafter\gdef\csname cb@##1.##2\endcsname{##3,##4,##5}}
+ \gdef\sec@nd@ftw@##1 ##2{##2}
+ \fi}
+\def\cb@xetexerror{\PackageError
+ {changebar}%
+ {XeTeX option cannot be used}%
+ {You are not using XeLaTeX}}
\DeclareOption{outerbars}{\def\cb@barsplace{1}}
\DeclareOption{innerbars}{\def\cb@barsplace{0}}
\DeclareOption{leftbars}{\def\cb@barsplace{2}}
@@ -144,18 +164,22 @@
{changebar}%
{Unrecognised option `\CurrentOption'\MessageBreak
known options are dvitoln03, dvitops, dvips,\MessageBreak
- emtex, textures, pdftex and vtex,
+ emtex, textures, pdftex, vtex and xetex,
grey, color, xcolor,\MessageBreak
outerbars, innerbars, leftbars and rightbars}}
\ifx\VTeXversion\@undefined
- \ifx\pdfoutput\@undefined
- \ExecuteOptions{innerbars,traceoff,dvips,grey}
- \else
- \ifnum\pdfoutput>0
- \ExecuteOptions{innerbars,traceoff,pdftex,grey}
- \else
+ \expandafter\ifx\csname XeTeXrevision\endcsname\@undefined
+ \ifx\pdfoutput\@undefined
\ExecuteOptions{innerbars,traceoff,dvips,grey}
+ \else
+ \ifnum\pdfoutput>0
+ \ExecuteOptions{innerbars,traceoff,pdftex,grey}
+ \else
+ \ExecuteOptions{innerbars,traceoff,dvips,grey}
+ \fi
\fi
+ \else
+ \ExecuteOptions{innerbars,traceoff,xetex,grey}
\fi
\else
\ExecuteOptions{innerbars,traceoff,vtex,grey}
@@ -199,7 +223,8 @@
\def\emTeX{EMTEX}%
\def\Textures{TEXTURES}%
\def\VTeX{VTEX}%
- \def\pdfTeX{PDFTEX}
+ \def\pdfTeX{PDFTEX}%
+ \def\xeTeX{XETEX}
\global\chardef\cb@driver@setup=0\relax
\ifx\tempa\LN \global\chardef\cb@driver@setup=0\fi
\ifx\tempa\DVItoPS \global\chardef\cb@driver@setup=1\fi
@@ -208,6 +233,7 @@
\ifx\tempa\Textures \global\chardef\cb@driver@setup=4\fi
\ifx\tempa\VTeX \global\chardef\cb@driver@setup=5\fi
\ifx\tempa\pdfTeX \cb@pdftexcheck\fi
+ \ifx\tempa\xeTeX \cb@xetexcheck\fi
\egroup}
{\def\do{\noexpand\do\noexpand}
\xdef\@preamblecmds{\@preamblecmds \do\driver}
@@ -451,6 +477,144 @@
\def\cb@maxpoint{9999999}
\let\cb@resetpoints\relax
\or
+ \immediate\closeout\cb@writexy
+ \immediate\openin\cb@readxy=\jobname.cb2\relax
+ \def\cb@pdfpoints{}
+ \def\cb@pdfpagenr{0}
+ \def\cb@findpdfpoint##1##2{%
+ \edef\cb@temp
+ {\noexpand\cb@@findpdfpoint{\the##1}{\the##2}}%
+ \cb@temp
+ }
+ \def\pdfliteral##1{\special{pdf:literal ##1}}
+ \def\cb@@findpdfpoint##1##2{%
+ \ifnum##2<\cb@pdfpagenr\relax\else
+ \cb@pdfreadxy{##2}%
+ \fi
+ \let\cb@pdfx\relax
+ \ifx\cb@pdfpoints\@empty\else
+ \ifnum##2<0\relax
+ \else
+ \edef\cb@temp{\noexpand\cb@pdffind{##1}{##2}\cb@pdfpoints\relax{}}%
+ \cb@temp
+ \fi
+ \fi
+ }
+ \def\cb@pdffind##1##2##3.##4p##5,##6,##7pt##8\relax##9{%
+ \def\cb@next{\cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5,##6,##7pt}}%
+ \ifnum ##1=##3
+ \ifnum ##2=##4
+ \def\cb@pdfx{##5sp}%
+ \def\cb@pdfy{##6sp}%
+ \def\cb@pdfz{##7pt}%
+ \let\cb@next\relax
+ \gdef\cb@pdfpoints{##9##8}%
+ \fi
+ \fi
+ \ifx\relax##8\relax
+ \let\cb@next\relax
+ \fi
+ \cb@next
+ }%
+ \def\cb@pdfreadxy##1{%
+ \let\cb@next\relax
+ \ifeof\cb@readxy
+ \global\let\cb@pdfpagenr\cb@maxpoint
+ \else
+ {\endlinechar=-1\read\cb@readxy to\cb@temp
+ \ifx\cb@temp\@empty\else
+ \expandafter\cb@pdfparsexy\cb@temp
+ \ifnum\cb@pdfpg<0\else
+ \xdef\cb@pdfpoints{\cb@pdfpoints\cb@temp}%
+ \cb@trace{PDFpoints=\cb@pdfpoints}%
+ \global\let\cb@pdfpagenr\cb@pdfpg
+ \fi
+ \ifnum\cb@pdfpg>##1\else
+ \global\def\cb@next{\cb@pdfreadxy{##1}}%
+ \fi
+ \fi
+ }%
+ \fi
+ \cb@next
+ }%
+ \def\cb@pdfparsexy##1.##2p##3,##4,##5pt{%
+ \def\cb@pdfpg{##2}}%
+ \def\cb@defpoint##1##2{%
+ \if@filesw
+ \begingroup
+ \edef\point{{\the##1}{\the\cb@pagecount}}%
+ \let\the=\z@
+ \pdfsavepos
+ \edef\cb@temp{\write\@auxout
+ {\string\cb@pdfxy\point
+ {\the\pdflastxpos}{\the\pdflastypos}{\the##2}}}%
+ \cb@temp
+ \endgroup
+ \fi
+ \cb@trace@defpoint##1##2%
+ }%
+ \def\cb@cvtpct##1{%
+ \ifnum##1<0 0\else
+ \ifnum##1>99 1\else
+ \ifnum##1<10 0.0\the##1\else
+ 0.\the##1\fi\fi\fi}
+\def\cb@pdf@scale{0.996264009963}
+ \def\cb@connect##1##2##3{%
+ \cb@findpdfpoint{##1}\cb@pagecount
+ \ifx\cb@pdfx\relax\cb@rerun
+ \else
+ \let\cb@pdftopy\cb@pdfy
+ \cb@findpdfpoint{##2}\cb@pagecount
+ \ifx\cb@pdfx\relax\cb@rerun
+ \else
+ \begingroup
+ \cb@dima=\cb@pdfz
+ \advance\cb@dima by-\cb@pdfx
+ \advance\cb@dima by1in
+ \cb@dima=\cb@pdf@scale\cb@dima\relax
+ \ifx\cb@current@color\@undefined
+ \def\cb@temp{\cb@cvtpct\c@changebargrey}%
+ \pdfliteral{q \cb@temp\space g \cb@temp\space G}%
+ \else
+ \pdfliteral{q \expandafter\sec@nd@ftw@\cb@current@color\space RG
+ \expandafter\sec@nd@ftw@\cb@current@color\space rg}%
+ \fi
+ \edef\cb@temp{\expandafter\cb@removedim\the\cb@dima\space}%
+ \cb@dima=\cb@pdftopy
+ \advance\cb@dima-\cb@pdfy\relax
+ \cb@dima=\cb@pdf@scale\cb@dima\relax
+ ##3=\cb@pdf@scale##3\relax
+ \pdfliteral{\expandafter\cb@removedim\the##3 w
+ \cb@temp 0 m
+ \cb@temp \expandafter\cb@removedim\the\cb@dima\space l S Q}%
+ \endgroup
+ \cb@cntb=##1\relax
+ \ifodd\cb@cntb\advance\cb@cntb 1\else\advance\cb@cntb -1\fi
+ \cb@findpdfpoint\cb@cntb\cb@pagecount
+ \cb@cntb=##2\relax
+ \ifodd\cb@cntb\advance\cb@cntb 1\else\advance\cb@cntb -1\fi
+ \cb@findpdfpoint\cb@cntb\cb@pagecount
+ \fi
+ \fi
+ \cb@trace@connect##1##2##3%
+ }%
+ \gdef\cb@checkPdfxy##1##2##3##4##5{%
+ \cb@@findpdfpoint{##1}{##2}%
+ \ifnum##3=\cb@pdfx\relax
+ \ifnum##4=\cb@pdfy\relax
+ \ifdim##5=\cb@pdfz\relax
+ \else
+ \cb@error
+ \fi
+ \else
+ \cb@error
+ \fi
+ \else
+ \cb@error
+ \fi
+ }
+ \def\cb@maxpoint{9999999}
+ \let\cb@resetpoints\relax
\else
\PackageWarning{Changebar}{changebars not supported in unknown setup}
\def\cb@defpoint##1##2{\cb@trace@defpoint##1##2}
@@ -479,7 +643,7 @@
\newlength{\deletebarwidth}
\setlength{\deletebarwidth}{4pt}
\newlength{\changebarsep}
-\setlength{\changebarsep}{30pt}
+\setlength{\changebarsep}{0.5\marginparsep}
\newcounter{changebargrey}
\setcounter{changebargrey}{65}
\@ifpackagewith{changebar}{\csname cb@color@pkg\endcsname}{%
@@ -915,6 +1079,11 @@
\fi
\ltx@end@float}
\let\end@float\cb@end@float
+\let\ltx@@xympar\@xympar
+\def\@xympar{%
+ \let\end@float\ltx@end@float
+ \ltx@@xympar
+ \let\end@float\cb@end@float}
\let\flt@float@end\float@end
\def\float@end{%
\cb@trace@stack{end float on page \the\c@page}%