summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-27 00:38:14 +0000
committerKarl Berry <karl@freefriends.org>2010-09-27 00:38:14 +0000
commit36e4bf755052bf5d5cef33cc2ffbad8f00b22163 (patch)
tree9198be602696e907e34ac521cc4dde651abf4ea4 /Master/texmf-dist/tex
parent4e856769d757755ecc9ce4e364fd1bb75ebbf408 (diff)
linegoal 2 (26sep10)
git-svn-id: svn://tug.org/texlive/trunk@19903 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/linegoal/linegoal.sty76
1 files changed, 47 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/latex/linegoal/linegoal.sty b/Master/texmf-dist/tex/latex/linegoal/linegoal.sty
index ca2e1cc6da0..d53b0c1ee0c 100644
--- a/Master/texmf-dist/tex/latex/linegoal/linegoal.sty
+++ b/Master/texmf-dist/tex/latex/linegoal/linegoal.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% linegoal : 2010/06/06 v1.1 - linegoal : a new dimen corresponding to the remainder of the line
+%% linegoal : 2010/09/25 v2.0 - linegoal : a new dimen corresponding to the remainder of the line
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -26,44 +26,62 @@
\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
[2005/12/01]% LaTeX must be 2005/12/01 or younger
\ProvidesPackage{linegoal}
- [2010/06/06 v1.1 - A new dimen corresponding to the remainder of the line]
-\def\LNGL@pkg@name{linegoal}
+ [2010/09/25 v2.0 - A new dimen corresponding to the remainder of the line]
\ifdefined\pdfsavepos\else
- \PackageWarning\LNGL@pkg@name
- {This package requires pdfTeX for its \string\pdfsavepos primitive\MessageBreak
- pdfTeX has not been detected and \LNGL@pkg@name\space will not be loaded}%
+ \PackageWarning{linegoal}
+ {This package requires pdfTeX for its \string\pdfsavepos\space primitive\MessageBreak
+ pdfTeX has not been detected and linegoal.sty will not be loaded}%
\expandafter\endinput
\fi
-\RequirePackage{etex,zref,zref-savepos}
-\zref@newprop*{LNGL@page}[0]{\the\c@page}
+\RequirePackage{etex,zref,zref-savepos,scrlfile}
+\newcommand*\linegoal{%
+ \zref@extract{linegoal.\the\LNGL@unique}{linegoal}\LNGL@setlinegoal
+}% \linegoal
+\zref@newprop*{linegoal}[\the\linewidth]{\the\dimexpr
+ \linewidth-\the\pdflastxpos sp
+ +\ifodd\zref@extractdefault{linegoal/page.\the\LNGL@unique}{page}\c@page
+ \oddsidemargin
+ \else\evensidemargin
+ \fi
+ +1in+\hoffset
+ \relax
+}% linegoal zref-property
\globcount\LNGL@unique
-\def\linegoal{linegoal}
-\def\set@linegoal#1#2{%
+\globdimen\LNGL@tempdim
+\let\LNGL@calc@stop=\relax
+\let\LNGL@calc@cleanup\relax
+\AfterPackage*{calc}{%
+ \let\LNGL@calc@stop=!%
+ \def\LNGL@calc@cleanup!{}%
+}
+\def\LNGL@setlinegoal{\relax\csname LNGL@set\ifdefined\calc@next!\fi\endcsname}
+\expandafter\def\csname LNGL@set!\endcsname!{!\LNGL@set}
+\protected\def\LNGL@set{%
\@bsphack
\if@filesw
- \global\advance\LNGL@unique\@ne
\pdfsavepos
- \zref@labelbyprops{linegoal.\the\LNGL@unique}{posx,LNGL@page}%
- #1=\dimexpr\linewidth-\zref@extractdefault{linegoal.\the\LNGL@unique}{posx}0sp
- +\ifodd\zref@extractdefault{linegoal.\the\LNGL@unique}{LNGL@page}0
- \oddsidemargin
- \else \evensidemargin
- \fi
- +1in+\hoffset
- \relax
+ \zref@refused{linegoal.\the\LNGL@unique}%
+ \LNGL@tempdim\zref@extractdefault{linegoal.\the\LNGL@unique}{linegoal}\maxdimen
+ \zref@labelbyprops{linegoal/page.\the\LNGL@unique}{page,posx}%
+ \zref@labelbyprops{linegoal.\the\LNGL@unique}{linegoal}%
+ \ifdim\zref@extract{linegoal.\the\LNGL@unique}{linegoal}=\LNGL@tempdim
+ \else \expandafter\LNGL@warn%
+ \number\zref@extractdefault{linegoal/page.\the\LNGL@unique}{page}\c@page\relax
+ \fi
+ \global\advance\LNGL@unique\@ne
+ \else\LNGL@noauxerr
\fi
\@esphack
}% \set@linegoal
-\AtBeginDocument\LNGL@AtBeginDocument@hook
-\def\LNGL@AtBeginDocument@hook{%
- \let\LNGL@ORI@setlength\setlength
- \protected\def\setlength##1##2{%
- \ifx\linegoal##2\expandafter\set@linegoal
- \else \expandafter\LNGL@ORI@setlength
- \fi{##1}{##2}%
- }% \setlength
-}% \LNGL@AtBeginDocument@hook
-
+\def\LNGL@warn#1\relax{\PackageWarning{linegoal}
+ {\string\linegoal\space value on page #1
+ \MessageBreak has changed since last run
+ \MessageBreak Please rerun to get correct values}%
+}% \LNGL@warn
+\def\LNGL@noauxerr{\PackageError{linegoal}
+ {\string\linegoal\space does not work if output file are disabled
+ \MessageBreak please check the value of \string\if@filesw!}\@ehd
+}% \LNGL@noauxerr
\endinput
%%
%% End of file `linegoal.sty'.