summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/changebar
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-12-26 21:02:15 +0000
committerKarl Berry <karl@freefriends.org>2023-12-26 21:02:15 +0000
commitda3d3c074cb252bb820563d7b502dddb7236111d (patch)
treea9f34489e599612a5643efb47fac33332b1a6bf6 /Master/texmf-dist/tex/latex/changebar
parentdf89a8fae0f1087e7523e0510ff678dfa8cdf814 (diff)
changebar (26dec23)
git-svn-id: svn://tug.org/texlive/trunk@69220 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/changebar')
-rw-r--r--Master/texmf-dist/tex/latex/changebar/changebar.sty189
1 files changed, 175 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/changebar/changebar.sty b/Master/texmf-dist/tex/latex/changebar/changebar.sty
index 31b64ec3ccd..7150d4ab383 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-2022 Johannes Braams, All rights reserved.
+%% Copyright (C) 1994-2023 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-2022 (C) Johannes Braams. All rights reserved.
+%% Copyright 1994-2023 (C) Johannes Braams. All rights reserved.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{changebar}
- [2022-05-06 v3.6d Indicate changes with marginal bars]
+ [2023/12/24 v3.7a Indicate changes with marginal bars]
\def\cb@maxpoint{80}
\def\cb@minpoint{1}
\def\cb@nil{0}
@@ -135,10 +135,25 @@
\expandafter\gdef\csname cb@##1.##2\endcsname{##3,##4,##5}}
\gdef\sec@nd@ftw@##1 ##2{##2}
\fi}
-\def\cb@xetexerror{\PackageError
+\DeclareOption{luaTeX}{\cb@luatexcheck}
+\DeclareOption{luatex}{\cb@luatexcheck}
+\def\cb@luatexcheck{%
+ \ifx\directlua\@undefined \cb@luatexerror
+ \else
+ \global\chardef\cb@driver@setup=8\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}}
+ \fi}
+\def\cb@luatexerror{\PackageError
{changebar}%
- {XeTeX option cannot be used}%
- {You are not using XeLaTeX}}
+ {luaTeX option cannot be used}%
+ {You are not using luaLaTeX}}
\DeclareOption{outerbars}{\def\cb@barsplace{1}}
\DeclareOption{innerbars}{\def\cb@barsplace{0}}
\DeclareOption{leftbars}{\def\cb@barsplace{2}}
@@ -225,6 +240,7 @@
\def\VTeX{VTEX}%
\def\pdfTeX{PDFTEX}%
\def\xeTeX{XETEX}
+ \def\luaTeX{LUATEX}
\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
@@ -234,6 +250,7 @@
\ifx\tempa\VTeX \global\chardef\cb@driver@setup=5\fi
\ifx\tempa\pdfTeX \cb@pdftexcheck\fi
\ifx\tempa\xeTeX \cb@xetexcheck\fi
+ \ifx\tempa\luaTeX \cb@luatexcheck\fi
\egroup}
{\def\do{\noexpand\do\noexpand}
\xdef\@preamblecmds{\@preamblecmds \do\driver}
@@ -364,7 +381,8 @@
\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}}%
+ \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}%
@@ -421,6 +439,7 @@
\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
@@ -432,8 +451,8 @@
\begingroup
\cb@dima=\cb@pdfz
\advance\cb@dima by-\cb@pdfx
- \advance\cb@dima by1in
- \cb@dima=0.996264009963\cb@dima\relax
+ \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}%
@@ -443,8 +462,8 @@
\edef\cb@temp{\expandafter\cb@removedim\the\cb@dima\space}%
\cb@dima=\cb@pdftopy
\advance\cb@dima-\cb@pdfy\relax
- \cb@dima=0.996264009963\cb@dima\relax
- ##3=0.996264009963##3\relax
+ \cb@dima=\cb@pdf@scale\cb@dima\relax
+ ##3=\cb@pdf@scale##3\relax
\pdfliteral direct{\expandafter\cb@removedim\the##3 w
\cb@temp 0 m
\cb@temp \expandafter\cb@removedim\the\cb@dima\space l S Q}%
@@ -495,13 +514,15 @@
\ifx\cb@pdfpoints\@empty\else
\ifnum##2<0\relax
\else
- \edef\cb@temp{\noexpand\cb@pdffind{##1}{##2}\cb@pdfpoints\relax{}}%
+ \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}}%
+ \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}%
@@ -570,7 +591,7 @@
\begingroup
\cb@dima=\cb@pdfz
\advance\cb@dima by-\cb@pdfx
- \advance\cb@dima by1in
+ \advance\cb@dima by1in%
\cb@dima=\cb@pdf@scale\cb@dima\relax
\ifx\cb@current@color\@undefined
\def\cb@temp{\cb@cvtpct\c@changebargrey}%
@@ -615,6 +636,146 @@
}
\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{\pdfextension 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@
+ \savepos
+ \edef\cb@temp{\write\@auxout
+ {\string\cb@pdfxy\point
+ {\the\lastxpos}{\the\lastypos}{\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 \cb@current@color}%
+ \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}%
+ \ifdim##3sp=\cb@pdfx\relax
+ \ifdim##4sp=\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}