summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/linegoal
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-05-07 23:21:59 +0000
committerKarl Berry <karl@freefriends.org>2010-05-07 23:21:59 +0000
commit26a9a99cce2d8eea612686e05061b1c05f9149db (patch)
treeb5c09c539b67f39ff790badfbdd0505c5a09d175 /Master/texmf-dist/tex/latex/linegoal
parentf82352406dc717f2af0a1e0e8c541bfbb9320d83 (diff)
new latex package linegoal (7may10)
git-svn-id: svn://tug.org/texlive/trunk@18149 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/linegoal')
-rw-r--r--Master/texmf-dist/tex/latex/linegoal/linegoal.sty69
1 files changed, 69 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/linegoal/linegoal.sty b/Master/texmf-dist/tex/latex/linegoal/linegoal.sty
new file mode 100644
index 00000000000..2c7116f05b1
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/linegoal/linegoal.sty
@@ -0,0 +1,69 @@
+%%
+%% This is file `linegoal.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% linegoal.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% linegoal : 2010/05/07 v1.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
+%% version 1.3 of this license or (at your option) any later
+%% version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%%
+%% This work consists of the main source file linegoal.dtx
+%% and the derived files
+%% linegoal.sty, linegoal.pdf, linegoal.ins,
+%%
+%% linegoal : linegoal : a new dimen corresponding to the remainder of the line
+%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
+%%
+\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
+ [2005/12/01]% LaTeX must be 2005/12/01 or younger (see kvsetkeys.dtx).
+\ProvidesPackage{linegoal}
+ [2010/05/07 v1.0 - A new dimen corresponding to the remainder of the line]
+\def\LNGL@pkg@name{linegoal}
+\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}%
+ \expandafter\endinput
+\fi
+\RequirePackage{etex,zref,zref-savepos}
+\zref@newprop*{LNGL@page}[0]{\the\c@page}
+\globcount\LNGL@unique
+\def\linegoal{linegoal}
+\def\set@linegoal#1#2{%
+ \@bsphack
+ \if@filesw
+ \global\advance\LNGL@unique\@ne
+ \pdfsavepos
+ \zref@labelbyprops{linegoal.\the\LNGL@unique}{posx,LNGL@page}%
+ #1=\dimexpr\linewidth-\zposx{linegoal.\the\LNGL@unique}sp%
+ +\ifodd\zref@extractdefault{linegoal.\the\LNGL@unique}{LNGL@page}{0}
+ \oddsidemargin
+ \else \evensidemargin
+ \fi
+ +1in+\hoffset
+ \relax
+ \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
+
+\endinput
+%%
+%% End of file `linegoal.sty'.