From 8d4f9772f3f51150aebafbbb1863d8064a94f502 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 21 Nov 2010 23:50:05 +0000 Subject: linegoal (20nov10) git-svn-id: svn://tug.org/texlive/trunk@20517 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/linegoal/linegoal.pdf | Bin 138395 -> 151030 bytes Master/texmf-dist/doc/latex/linegoal/linegoal.tex | 2 +- .../texmf-dist/source/latex/linegoal/linegoal.drv | 13 +-- .../texmf-dist/source/latex/linegoal/linegoal.dtx | 105 +++++++++++++-------- .../texmf-dist/source/latex/linegoal/linegoal.ins | 6 +- Master/texmf-dist/tex/latex/linegoal/linegoal.sty | 6 +- 6 files changed, 81 insertions(+), 51 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/linegoal/linegoal.pdf b/Master/texmf-dist/doc/latex/linegoal/linegoal.pdf index 91691926dd6..891efc72463 100644 Binary files a/Master/texmf-dist/doc/latex/linegoal/linegoal.pdf and b/Master/texmf-dist/doc/latex/linegoal/linegoal.pdf differ diff --git a/Master/texmf-dist/doc/latex/linegoal/linegoal.tex b/Master/texmf-dist/doc/latex/linegoal/linegoal.tex index fc06c52d02e..7e2bd362c0a 100644 --- a/Master/texmf-dist/doc/latex/linegoal/linegoal.tex +++ b/Master/texmf-dist/doc/latex/linegoal/linegoal.tex @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% linegoal : 2010/10/31 v2.1 - linegoal : a new dimen corresponding to the remainder of the line +%% linegoal : 2010/11/19 v2.2 - 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 diff --git a/Master/texmf-dist/source/latex/linegoal/linegoal.drv b/Master/texmf-dist/source/latex/linegoal/linegoal.drv index ba5d669a429..ec2d1fee15a 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/10/31 v2.1 - linegoal : a new dimen corresponding to the remainder of the line +%% linegoal : 2010/11/19 v2.2 - 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 @@ -24,9 +24,9 @@ %% Copyright (C) 2010 by Florent Chervet %% \edef\thisfile{\jobname} -\def\thisinfo{A new ``dimen'' corresponding to the remainder of the line (\FC)} -\def\thisdate{2010/10/31} -\def\thisversion{2.1} +\def\thisinfo{A new ``dimen'' corresponding to the remainder of the line} +\def\thisdate{2010/11/19} +\def\thisversion{2.2} \def\CTANbaseurl{http://www.ctan.org/tex-archive/macros/latex} \def\CTANdisplay{CTAN:macros/latex} \makeatletter\protected\def\CTANhref{\@ifstar\CTANhrefstar\CTANhrefnost}\makeatother @@ -40,12 +40,13 @@ \usepackage{inputenc,babel} \usepackage[T1]{fontenc} \usepackage{etoolbox,geometry,xcolor,bbding,txfonts,xspace,hologo,graphicx} -\usepackage{lastpage,fancyhdr,enumitem,framed,tocloft,tabu,multirow,makecell} +\usepackage{lastpage,fancyhdr,enumitem,framed,tocloft,tabu,multirow,makecell,tabularx} \usepackage{embedfile} \usepackage{interfaces} \csname endofdump\endcsname \CodelineNumbered\lastlinefit999 \usepackage{holtxdoc,bookmark} +\usepackage{linegoal} \usepackage{fancyvrb}\fvset{gobble=1,listparameters={\topsep=0pt}} \hypersetup{% pdftitle={The linegoal package}, @@ -55,7 +56,7 @@ pdfstartview=FitH, pdfkeywords={TeX, LaTeX, e-TeX, pdfTeX, package, zref, linegoal}} \embedfile{\thisfile.dtx} -\geometry{top=0pt,headheight=1cm,includehead,headsep=.6cm,bottom=1.4cm,footskip=.5cm,left=2.5cm,right=1cm} +\geometry{top=0pt,headheight=.6cm,includehead,headsep=.6cm,bottom=1.4cm,footskip=.5cm,left=2.5cm,right=1cm} \begin{document} \DocInput{\thisfile.dtx} \end{document} diff --git a/Master/texmf-dist/source/latex/linegoal/linegoal.dtx b/Master/texmf-dist/source/latex/linegoal/linegoal.dtx index d4ca46b44bc..c6bb851d6d4 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/10/31 v2.1 - linegoal : a new dimen corresponding to the remainder of the line] +% linegoal : 2010/11/19 v2.2 - 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/10/31 v2.1 - linegoal : a new dimen corresponding to the remainder of the line} +\Msg{* Package: 2010/11/19 v2.2 - linegoal : a new dimen corresponding to the remainder of the line} \Msg{************************************************************************} \keepsilent @@ -48,7 +48,7 @@ This is a generated file. -linegoal : 2010/10/31 v2.1 - linegoal : a new dimen corresponding to the remainder of the line +linegoal : 2010/11/19 v2.2 - 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 @@ -99,9 +99,9 @@ Copyright (C) 2010 by Florent Chervet % %<*driver> \edef\thisfile{\jobname} -\def\thisinfo{A new ``dimen'' corresponding to the remainder of the line (\FC)} -\def\thisdate{2010/10/31} -\def\thisversion{2.1} +\def\thisinfo{A new ``dimen'' corresponding to the remainder of the line} +\def\thisdate{2010/11/19} +\def\thisversion{2.2} \def\CTANbaseurl{http://www.ctan.org/tex-archive/macros/latex} \def\CTANdisplay{CTAN:macros/latex} \makeatletter\protected\def\CTANhref{\@ifstar\CTANhrefstar\CTANhrefnost}\makeatother @@ -115,12 +115,13 @@ Copyright (C) 2010 by Florent Chervet \usepackage{inputenc,babel} \usepackage[T1]{fontenc} \usepackage{etoolbox,geometry,xcolor,bbding,txfonts,xspace,hologo,graphicx} -\usepackage{lastpage,fancyhdr,enumitem,framed,tocloft,tabu,multirow,makecell} +\usepackage{lastpage,fancyhdr,enumitem,framed,tocloft,tabu,multirow,makecell,tabularx} \usepackage{embedfile} \usepackage{interfaces} \csname endofdump\endcsname \CodelineNumbered\lastlinefit999 \usepackage{holtxdoc,bookmark} +\usepackage{linegoal} \usepackage{fancyvrb}\fvset{gobble=1,listparameters={\topsep=0pt}} \hypersetup{% pdftitle={The linegoal package}, @@ -130,14 +131,14 @@ Copyright (C) 2010 by Florent Chervet pdfstartview=FitH, pdfkeywords={TeX, LaTeX, e-TeX, pdfTeX, package, zref, linegoal}} \embedfile{\thisfile.dtx} -\geometry{top=0pt,headheight=1cm,includehead,headsep=.6cm,bottom=1.4cm,footskip=.5cm,left=2.5cm,right=1cm} +\geometry{top=0pt,headheight=.6cm,includehead,headsep=.6cm,bottom=1.4cm,footskip=.5cm,left=2.5cm,right=1cm} \begin{document} \DocInput{\thisfile.dtx} \end{document} % % \fi % -% \CheckSum{143} +% \CheckSum{141} % % \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 @@ -175,7 +176,7 @@ Copyright (C) 2010 by Florent Chervet % \DoNotIndex{\the,\width,\star,\space,\section,\subsection,\textasteriskcentered,\textwidth} % \DoNotIndex{\",\:,\@empty,\@for,\@gtempa,\@latex@error,\@namedef,\@nameuse,\@tempa,\@testopt,\@width,\\,\m@ne,\makeatletter,\makeatother} % \DoNotIndex{\maketitle,\parindent,\setbox,\x,\kernel@ifnextchar} -% \makeatletter +% \makeatletter % \parindent\z@\parskip.4\baselineskip\topsep\parskip\partopsep\z@ % \newrobustcmd*\FC{{\color{copper}\usefont{T1}{fts}xn FC}} % \newrobustcmd\ClearPage{\@ifstar\clearpage{}} @@ -205,7 +206,7 @@ Copyright (C) 2010 by Florent Chervet % \g@addto@macro\macro@font{\macrocodecolor\let\AltMacroFont\macro@font} % \g@addto@macro\@list@extra{\parsep\parskip\topsep\z@\itemsep\z@} % \newcommand\macrocodecolor{\color{macrocode}}\definecolor{macrocode}{rgb}{0.08,0.00,0.15} -% \newcommand\reflinkcolor{\color{reflink}}\definecolor{reflink}{rgb}{0.49,0.00,0.00} +% \newcommand\reflinkcolor{\color{reflink}}\colorlet{reflink}{DarkSlateBlue} % \newrobustcmd\stform{\@ifnextchar*{\@stform[]\textasteriskcentered\@gobble}\@stform} % \newrobustcmd\@stform[2][\string]{\texttbf{#1#2}\xspace} % \DefineVerbatimEnvironment{VerbLines}{Verbatim}{gobble=1,frame=lines,framesep=6pt,fontfamily=\ttdefault,fontseries=m} @@ -228,28 +229,32 @@ Copyright (C) 2010 by Florent Chervet % \newrobustcmd\ie{\emph{ie.}} % \let\cellstrut\bottopstrut % \pagesetup{% -% head/rule/width=.1pt, -% head/rule/font=\color[gray]{.55}, +% norules, % font=\scriptsize\color[gray]{.55}, -% head/left=The \thispackage package -- \thisinfo, +% head/color=pkgcolor, +% head/left=\moveleft1cm\vbox to\z@{\vss\setbox0=\null\ht0=\z@\wd0=\paperwidth\dp0=\headheight\rlap{\colorbox{Ivory}{\box0}}}\vskip-\headheight\thispackage, +% head/right=\thisinfo, % foot/left=\vbox to\baselineskip{\vss{{\rotatebox[origin=l]{90}{\thispackage\,[rev.\thisversion]\,\copyright\,\thisyear\,\lower.4ex\hbox{\pkgcolor\NibRight}\,\FC}}}}, % left/offset=1.5cm, +% right/offset=.5cm, % foot/right=\oldstylenums{\arabic{page}}/\oldstylenums{\pageref{LastPage}}, % } % \pagestyle{fancy} % \pagesetup[plain]{% -% norules, +% norules,font=\scriptsize, +% left/offset=1.5cm, % foot/right/font=\scriptsize\color[gray]{.55}, % foot/right=\oldstylenums{\arabic{page}}/\oldstylenums{\pageref{LastPage}}, +% foot/left=\vbox to\baselineskip{\vss{{\rotatebox[origin=l]{90}{\thispackage\,[rev.\thisversion]\,\copyright\,\thisyear\,\lower.4ex\hbox{\pkgcolor\NibRight}\,\FC\quad \xemail{florent.chervet at free.fr}}}}}, % } % \bookmarksetup{openlevel=3} % \makeatother % % \deffootnote{1em}{0pt}{\rlap{\textsuperscript{\thefootnotemark}}\kern1em} % \title{\vspace*{-28pt}\mdseries The {\bfseries\thispackage\footnotemark}\kern.6em package} -% \author{\tiny\xemail{florent.chervet at free.fr}} -% \date{\thisdate~--~version \thisversion} -% \subtitle{\thisinfo} +% \author{\small\thisdate~--~version \thisversion} +% \date{} +% \subtitle{\LARGE A new ``dimen'' corresponding to the remainder of the line\endgraf{\small\FC}} % \maketitle % % \makeatletter\begingroup\let\@thefnmark\@empty\let\@makefntext\@firstofone @@ -276,7 +281,7 @@ Copyright (C) 2010 by Florent Chervet % Saying: &\Verb+\somedimen = \linegoal+ \\ % or: &\Verb+\setlength \somedimen {\linegoal}+ % \end{tabular}\par} -% +% % sets \cs{somedimen} to be the (horizontal) length of the remainder of the current line. This can be useful for % use with \textt{tabularx},\, \textt{tabular\stform*}\, or\, \textt{tabu}\, for example.§ % {\centering\extrarowheight\parskip @@ -294,43 +299,62 @@ Copyright (C) 2010 by Florent Chervet % section/skip=4pt plus2pt minus2pt, % subsection/skip=0pt plus2pt minus2pt, % section/dotsep, -% dotsep=1mu, -% dot=\hbox{$\scriptscriptstyle\ldotp$}, +% dotsep=1.5mu, +% dot=\hbox{\scriptsize.}, % title=Contents\quad\leaders\vrule height3.4pt depth-3pt\hfill\null, % title/bottom=6pt, % after=\leavevmode\hrule, % } -% ^^A\vskip-.8\baselineskip -% \tableofcontents % -% \def\B#1{\texttt{[}\meta{#1}\texttt{]}} +% \tableofcontents % % \ClearPage* % % \section{User interface} % \label{userinterface} % +% The first aim of \cs{linegoal} is to give a facility to get the length of the remainder of the line. +% This is possible with \hologo{pdfTeX} and its \cs{pdfsavepos} primitive. For convenience, \thispackage loads +% and uses the \xpackage{zref-savepos} package from H. Oberdiek. +% +% \cs{pdfsavepos} is supplied by \hologo{pdfTeX} in both \textt{pdf} and \textt{dvi} modes. If the document +% is not compiled with \hologo{pdfTeX} then \cs{linegoal} will expand to \cs{linewidth} in any case. +% % \begin{VerbLines} -% This is a tabular that fills the remainder of the line: +% This is a tabularx that fills the remainder of the line: % \begin{tabularx}\linegoal{|l|X|}\hline % Something & Something else \\ % Something & Something else \\\hline % \end{tabularx} % \end{VerbLines} % +% \textbf{Typical application is for tabular of variable width} like \xpackage{tabularx} or \xpackage{tabu}. +% Package \xpackage{tabu} has a \textt{linegoal} option to use \cs{linegoal} as default target for the whole +% tabular. % -% This is a tabular that fills the remainder of the line: -% \ifcsname ver@linegoal.sty\endcsname -% \begin{tabu}\linegoal{|l|X|}\hline -% Something & Something else \\ -% Something & Something else \\\hline -% \end{tabu} -% \else -% \begin{tabu} to279.6pt{|l|X|}\hline +% +% This is a \textt{tabularx} that fills the remainder of the line: +% \begin{tabularx}\linegoal{|l|X|}\hline % Something & Something else \\ % Something & Something else \\\hline -% \end{tabu}% -% \fi +% \end{tabularx} +% +% \begin{VerbLines} +% This is a tabu that fills the half of the remainder of the line: +% $\begin{tabu}to .5\linegoal{|[red]X[$c]|[red]X[2$c]|[red]} \tabucline[red]- +% \alpha & \beta \\ \tabucline[on 2pt,red]- +% \gamma & \delta \\ \tabucline[red]- +% \end{tabu}$ +% \end{VerbLines} +% +% This is a \textt{tabu} that fills the half of the remainder of the line: +% $\begin{tabu}to .5\linegoal{|[red]X[$c]|[red]X[2$c]|[red]} \tabucline[red]- +% \alpha & \beta \\ \tabucline[on 2pt,red]- +% \gamma & \delta \\ \tabucline[red]- +% \end{tabu}$ +% +% Please, refer to \xpackage{tabu} documentation for more information on the preamble and +% the command \cs{tabucline} used here as an example. % % % \StopEventually{ @@ -350,7 +374,7 @@ 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/10/31 v2.1 - A new dimen corresponding to the remainder of the line] + [2010/11/19 v2.2 - A new dimen corresponding to the remainder of the line] % \end{macrocode} % % \subsection{Requirements} @@ -380,7 +404,7 @@ Copyright (C) 2010 by Florent Chervet \newcommand*\linegoal{% \zref@extract{linegoal.\the\LNGL@unique}{linegoal}\LNGL@setlinegoal }% \linegoal -\zref@newprop*{linegoal}[\the\linewidth]{\the\dimexpr +\zref@newprop*{linegoal}[\linewidth]{\dimexpr \linewidth-\the\pdflastxpos sp +\ifodd\zref@extractdefault{linegoal/page.\the\LNGL@unique}{page}\c@page \oddsidemargin @@ -432,6 +456,11 @@ Copyright (C) 2010 by Florent Chervet % \DeleteShortVerb{\+} % \begin{History} % +% \begin{Version}{2010/11/19 v2.2} +% \item Fix a bug when using a syntax like \textt{.5\cs{linegoal}}. \\ +% Hence a better fitting with \xpackage{tabu} package (version \textt{1.4 -- 2010/11/20}). +% \end{Version} +% % \begin{Version}{2010/10/31 v2.1} % \item \thispackage works also without \hologo{pdfTeX}, but \cs{linegoal} % is replaced by \cs{linewidth} in any case. \\ @@ -467,7 +496,7 @@ Copyright (C) 2010 by Florent Chervet % \CTAN{macros/latex/contrib/oberdiek/}. % % \end{thebibliography} -% ^^A\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 4b671c4eb41..413dc823432 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/10/31 v2.1 - linegoal : a new dimen corresponding to the remainder of the line +%% linegoal : 2010/11/19 v2.2 - 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/10/31 v2.1 - linegoal : a new dimen corresponding to the remainder of the line} +\Msg{* Package: 2010/11/19 v2.2 - linegoal : a new dimen corresponding to the remainder of the line} \Msg{************************************************************************} \keepsilent @@ -38,7 +38,7 @@ This is a generated file. -linegoal : 2010/10/31 v2.1 - linegoal : a new dimen corresponding to the remainder of the line +linegoal : 2010/11/19 v2.2 - 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 diff --git a/Master/texmf-dist/tex/latex/linegoal/linegoal.sty b/Master/texmf-dist/tex/latex/linegoal/linegoal.sty index 9ce40a1714e..ec9347476fc 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/10/31 v2.1 - linegoal : a new dimen corresponding to the remainder of the line +%% linegoal : 2010/11/19 v2.2 - 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/10/31 v2.1 - A new dimen corresponding to the remainder of the line] + [2010/11/19 v2.2 - 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 @@ -39,7 +39,7 @@ \newcommand*\linegoal{% \zref@extract{linegoal.\the\LNGL@unique}{linegoal}\LNGL@setlinegoal }% \linegoal -\zref@newprop*{linegoal}[\the\linewidth]{\the\dimexpr +\zref@newprop*{linegoal}[\linewidth]{\dimexpr \linewidth-\the\pdflastxpos sp +\ifodd\zref@extractdefault{linegoal/page.\the\LNGL@unique}{page}\c@page \oddsidemargin -- cgit v1.2.3