From f1a94c819a1b45878e3d7098fdcdabcc03950dc1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 1 Dec 2010 00:22:53 +0000 Subject: linegoal (28nov10) git-svn-id: svn://tug.org/texlive/trunk@20610 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/linegoal/linegoal.sty | 41 ++++++++++++----------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'Master/texmf-dist/tex/latex/linegoal') diff --git a/Master/texmf-dist/tex/latex/linegoal/linegoal.sty b/Master/texmf-dist/tex/latex/linegoal/linegoal.sty index ec9347476fc..331e1705171 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/11/19 v2.2 - linegoal : a new dimen corresponding to the remainder of the line +%% linegoal : 2010/11/30 v2.6 - 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,7 +26,7 @@ \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/11/19 v2.2 - A new dimen corresponding to the remainder of the line] + [2010/11/30 v2.6 - A new dimen corresponding to the remainder of the line] \ifdefined\pdfsavepos\else % works also in dvi mode \PackageWarning{linegoal} {This package requires pdfTeX for its \string\pdfsavepos\space primitive\MessageBreak @@ -35,27 +35,21 @@ \gdef\linegoal{\linewidth}% \expandafter\endinput \fi -\RequirePackage{etex,zref,zref-savepos,scrlfile} -\newcommand*\linegoal{% - \zref@extract{linegoal.\the\LNGL@unique}{linegoal}\LNGL@setlinegoal -}% \linegoal +\RequirePackage{etex,zref,zref-savepos} \zref@newprop*{linegoal}[\linewidth]{\dimexpr \linewidth-\the\pdflastxpos sp - +\ifodd\zref@extractdefault{linegoal/page.\the\LNGL@unique}{page}\c@page + +\ifodd\zref@extractdefault{linegoal/posx.\the\LNGL@unique}{page}\c@page \oddsidemargin \else\evensidemargin \fi +1in+\hoffset \relax }% linegoal zref-property +\newcommand*\linegoal{% + \zref@extract{linegoal.\the\LNGL@unique}{linegoal}\LNGL@setlinegoal +}% \linegoal \globcount\LNGL@unique \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{% @@ -64,26 +58,35 @@ \pdfsavepos \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/posx.\the\LNGL@unique}{page,posx}% \zref@labelbyprops{linegoal.\the\LNGL@unique}{linegoal}% \ifdim\zref@extract{linegoal.\the\LNGL@unique}{linegoal}=\LNGL@tempdim + \LNGL@info \else \expandafter\LNGL@warn% - \number\zref@extractdefault{linegoal/page.\the\LNGL@unique}{page}\c@page\relax + \number\zref@extractdefault{linegoal/posx.\the\LNGL@unique}{page}\c@page\relax \fi \global\advance\LNGL@unique\@ne \else\LNGL@noauxerr \fi \@esphack }% \LNGL@set +\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 \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 +\def\LNGL@@info{\PackageInfo{linegoal} + {\string\linegoal=\the\LNGL@tempdim\space + (on page \number\zref@extractdefault{linegoal/posx.\the\LNGL@unique}{page}\c@page)}% +%% \showthe\linewidth +}% \LNGL@@info +\let\LNGL@info\@empty +\DeclareOption{verbose}{\let\LNGL@info \LNGL@@info} +\ProcessOptions \endinput %% %% End of file `linegoal.sty'. -- cgit v1.2.3