From 36e4bf755052bf5d5cef33cc2ffbad8f00b22163 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 27 Sep 2010 00:38:14 +0000 Subject: linegoal 2 (26sep10) git-svn-id: svn://tug.org/texlive/trunk@19903 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/linegoal/linegoal.drv | 7 +- .../texmf-dist/source/latex/linegoal/linegoal.dtx | 149 +++++++++++++-------- .../texmf-dist/source/latex/linegoal/linegoal.ins | 6 +- 3 files changed, 100 insertions(+), 62 deletions(-) (limited to 'Master/texmf-dist/source/latex/linegoal') diff --git a/Master/texmf-dist/source/latex/linegoal/linegoal.drv b/Master/texmf-dist/source/latex/linegoal/linegoal.drv index a5bb496c203..f8edebf3b23 100644 --- a/Master/texmf-dist/source/latex/linegoal/linegoal.drv +++ b/Master/texmf-dist/source/latex/linegoal/linegoal.drv @@ -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 @@ -25,8 +25,8 @@ %% \edef\thisfile{\jobname} \def\thisinfo{A new ``dimen'' corresponding to the remainder of the line} -\def\thisdate{2010/06/06} -\def\thisversion{1.1} +\def\thisdate{2010/09/25} +\def\thisversion{2.0} \def\CTANbaseurl{http://www.ctan.org/tex-archive/macros/latex} \def\CTANdisplay{CTAN:macros/latex} \makeatletter\protected\def\CTANhref{\@ifstar\CTANhrefstar\CTANhrefnost}\makeatother @@ -40,6 +40,7 @@ \usepackage[T1]{fontenc} \usepackage{etex,etoolbox,geometry,lastpage,tocloft,graphicx,xspace,tabularx,fancyhdr,color,bbding,embedfile,framed,multirow,txfonts,multirow,makecell,enumitem,arydshln,atveryend,catchfile} \usepackage[hyperindex=false,pdfusetitle,colorlinks,pdfpagelabels,pdfencoding=auto]{hyperref} +\csname endofdump\endcsname \usepackage{holtxdoc} \RequirePackage{grffile,eso-pic}% to include the example \CodelineNumbered diff --git a/Master/texmf-dist/source/latex/linegoal/linegoal.dtx b/Master/texmf-dist/source/latex/linegoal/linegoal.dtx index 08a6339c1eb..9304d037154 100644 --- a/Master/texmf-dist/source/latex/linegoal/linegoal.dtx +++ b/Master/texmf-dist/source/latex/linegoal/linegoal.dtx @@ -1,5 +1,5 @@ % \iffalse meta-comment -% 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 @@ -37,7 +37,7 @@ \tracingall \tracingonline=0 \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: 2010/06/06 v1.1 - linegoal : a new dimen corresponding to the remainder of the line} +\Msg{* Package: 2010/09/25 v2.0 - linegoal : a new dimen corresponding to the remainder of the line} \Msg{************************************************************************} \keepsilent @@ -48,7 +48,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 @@ -100,8 +100,8 @@ Copyright (C) 2010 by Florent Chervet %<*driver> \edef\thisfile{\jobname} \def\thisinfo{A new ``dimen'' corresponding to the remainder of the line} -\def\thisdate{2010/06/06} -\def\thisversion{1.1} +\def\thisdate{2010/09/25} +\def\thisversion{2.0} \def\CTANbaseurl{http://www.ctan.org/tex-archive/macros/latex} \def\CTANdisplay{CTAN:macros/latex} \makeatletter\protected\def\CTANhref{\@ifstar\CTANhrefstar\CTANhrefnost}\makeatother @@ -115,6 +115,7 @@ Copyright (C) 2010 by Florent Chervet \usepackage[T1]{fontenc} \usepackage{etex,etoolbox,geometry,lastpage,tocloft,graphicx,xspace,tabularx,fancyhdr,color,bbding,embedfile,framed,multirow,txfonts,multirow,makecell,enumitem,arydshln,atveryend,catchfile} \usepackage[hyperindex=false,pdfusetitle,colorlinks,pdfpagelabels,pdfencoding=auto]{hyperref} +\csname endofdump\endcsname \usepackage{holtxdoc} \RequirePackage{grffile,eso-pic}% to include the example \CodelineNumbered @@ -138,7 +139,7 @@ Copyright (C) 2010 by Florent Chervet % % \fi % -% \CheckSum{75} +% \CheckSum{133} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -215,6 +216,7 @@ Copyright (C) 2010 by Florent Chervet % \newrobustcmd\ie{\emph{ie.}} % \newrobustcmd\textt[2][]{\texttt{#1#2}} % \newcommand\cellstrut{}\let\cellstrut\bottopstrut +% \DefineVerbatimEnvironment{Verb*}{Verbatim}{gobble=1,fontfamily=txtt,fontseries=m,commandchars=$()} % % \fancyhf{}\fancyhead[L]{\footnotesize\color[gray]{.35} The \thispackage package -- \thisinfo} % \fancyfoot[L]{\color[gray]{.35}\scriptsize\thispackage\quad[rev.\thisversion]\quad\copyright\oldstylenums{2010}\,\lower.3ex\hbox{\NibRight}\,Florent Chervet} @@ -254,19 +256,29 @@ Copyright (C) 2010 by Florent Chervet % % \deffootnote{1em}{0pt}{\rlap{\thefootnotemark.}\kern1em} % \vspace*{-26pt} -% \begin{abstract}\parindent0pt\noindent\leftskip1cm\rightskip\leftskip\lastlinefit0% +% \begin{abstract}\parskip\medskipamount\parindent0pt\noindent\lastlinefit0\relax\linewidth\dimexpr\hsize-\leftmargin-\rightmargin\relax % % \thispackage provides a macro \csbf{linegoal} which expands to the dimension of the remainder of the line. % It requires pdf\TeX{} for its \cs{pdfsavepos} primitive. Two compilations (at least) are necessary to get % the correct line goal. -% \medskip % -% More precisely: \cs{setlength} is overloaded so that:§ -% \hfil\cs{setlength}\cs{mydimen}\{\cs{linegoal}\}\hfil\null§ -% sets \cs{mydimen} to be the (horizontal) length of the remainder of the current line. This can be useful for +% Saying:\par\vskip-2\parskip +% \begin{Verb*} +% \somedimen=\linegoal +% ($nnn or:) +% \setlength\somedimen{\linegoal} +% \end{Verb*} +% sets \cs{somedimen} to be the (horizontal) length of the remainder of the current line. This can be useful for % use with \xpackage{tabularx} or \xpackage{tabular*} for example (see \nameref{userinterface}). -% \medskip -% +% +% More precisely: +% +% \begin{tabularx}\linewidth{lX} +% At first run: &\cs{linegoal} expands to \cs{linewidth} and writes the correct line goal into the \xext{aux} file. \\ +% Other runs: &\cs{linegoal} expands to the value read in the \xext{aux} file and (eventually) updates the +% correct line-goal into the \xext{aux} file, it its value has changed. +% \end{tabularx} +% % \thispackage requires pdf\TeX{} and uses the \xpackage{zref-savepos} module of \Xpackage[/oberdiek/]{zref} package. % % \end{abstract} @@ -288,7 +300,7 @@ Copyright (C) 2010 by Florent Chervet % % \section{User interface} % \label{userinterface} -% +% % \begin{VerbLines} % This is a tabular that fills the remainder of the line: % \begin{tabularx}\linegoal{|l|X|}\hline @@ -296,10 +308,10 @@ Copyright (C) 2010 by Florent Chervet % Something & Something else \\\hline % \end{tabularx} % \end{VerbLines} -% +% % \DeleteShortVerb{\+} % \tracingtabularx -% +% % This is a tabular that fills the remainder of the line: % \ifcsname ver@linegoal.sty\endcsname % \begin{tabularx}\linegoal{|l|X|}\hline @@ -312,8 +324,8 @@ Copyright (C) 2010 by Florent Chervet % Something & Something else \\\hline % \end{tabularx}% % \fi -% -% +% +% % \StopEventually{ % } % @@ -333,71 +345,96 @@ Copyright (C) 2010 by Florent Chervet \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] % \end{macrocode} % % \subsection{Requirements} % % The package requires \xpackage{zref} and its module \xpackage{zref-savepos}. % +% It requires \xpackage{srclfile} for a patch when using the \xpackage{calc} package. +% % \begin{macrocode} \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} +\RequirePackage{etex,zref,zref-savepos,scrlfile} % \end{macrocode} -% +% % \subsection{zref property : page as arabic number} -% -% \begin{macrocode} -\zref@newprop*{LNGL@page}[0]{\the\c@page} -% \end{macrocode} % % \subsection{The linegoal macro} % %\begin{macro}{\linegoal} % \begin{macrocode} +\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 + \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.\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 - \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 + \else\LNGL@noauxerr \fi - \@esphack + \@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 -% \end{macrocode} -%\end{macro} - -% \begin{macrocode} +\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 % % \end{macrocode} +%\end{macro} % % \DeleteShortVerb{\+} % \begin{History} -% +% +% \begin{Version}{2010/09/25 v2.0} +% \item New approach: \cs{setlength} is not used anymore. \\ +% \cs{linegoal} behaves more like a real dimen. \\ +% code like: \cs{hspace}\textasteriskcentered\cs{linegoal} is now possible. +% \end{Version} +% +% \begin{Version}{2010/06/20 v1.2} +% \item Modification in warning message... +% \end{Version} +% % \begin{Version}{2010/06/06 v1.1} % \item The first release required some small corrections ! % \end{Version} @@ -417,7 +454,7 @@ Copyright (C) 2010 by Florent Chervet % \CTAN{macros/latex/contrib/oberdiek/}. % % \end{thebibliography} -% +% \clearpage % \PrintIndex % % \Finale \ No newline at end of file diff --git a/Master/texmf-dist/source/latex/linegoal/linegoal.ins b/Master/texmf-dist/source/latex/linegoal/linegoal.ins index c36de638dd6..ad75a778b85 100644 --- a/Master/texmf-dist/source/latex/linegoal/linegoal.ins +++ b/Master/texmf-dist/source/latex/linegoal/linegoal.ins @@ -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 @@ -27,7 +27,7 @@ \tracingall \tracingonline=0 \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: 2010/06/06 v1.1 - linegoal : a new dimen corresponding to the remainder of the line} +\Msg{* Package: 2010/09/25 v2.0 - linegoal : a new dimen corresponding to the remainder of the line} \Msg{************************************************************************} \keepsilent @@ -38,7 +38,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 -- cgit v1.2.3