% \iffalse meta-comment % linegoal : 2011/02/25 v2.9 - 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 % % Unpacking: % (a) If linegoal.ins is present: % etex linegoal.ins % (b) Without linegoal.ins: % etex linegoal.dtx % (c) If you insist on using LaTeX % latex \let\install=y\input{linegoal.dtx} % (quote the arguments according to the demands of your shell) % % Documentation: % (pdf)latex linegoal.dtx % Copyright (C) 2010 by Florent Chervet %<*ignore> \begingroup \def\x{LaTeX2e}% \expandafter\endgroup \ifcase 0\ifx\install y1\fi\expandafter \ifx\csname processbatchFile\endcsname\relax\else1\fi \ifx\fmtname\x\else 1\fi\relax \else\csname fi\endcsname % %<*install> \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} \Msg{* Package: 2011/02/25 v2.9 - linegoal : a new dimen corresponding to the remainder of the line} \Msg{************************************************************************} \keepsilent \askforoverwritefalse \let\MetaPrefix\relax \preamble This is a generated file. linegoal : 2011/02/25 v2.9 - 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 \endpreamble \let\MetaPrefix\DoubleperCent \generate{% \file{linegoal.ins}{\from{linegoal.dtx}{install}}% \file{linegoal.sty}{\from{linegoal.dtx}{package}}% } \askforoverwritefalse \generate{% \file{linegoal.drv}{\from{linegoal.dtx}{driver}}% } \obeyspaces \Msg{************************************************************************} \Msg{*} \Msg{* To finish the installation you have to move the following} \Msg{* file into a directory searched by TeX:} \Msg{*} \Msg{* linegoal.sty} \Msg{*} \Msg{* To produce the documentation run the file `linegoal.dtx'} \Msg{* through LaTeX.} \Msg{*} \Msg{* Happy TeXing!} \Msg{*} \Msg{************************************************************************} \endbatchfile % %<*ignore> \fi % %<*driver> \let\microtypeYN=y \edef\thisfile{\jobname} \def\thisinfo{Measuring the remaining width of the line} \def\thisdate{2011/02/25} \def\thisversion{2.9} \def\CTANbaseurl{http://www.ctan.org/tex-archive/} \def\CTANhref#1#2{\href{\CTANbaseurl/help/Catalogue/entries/#1.html}{\nolinkurl{CTAN:help/Catalogue/entries/#1.html}}} \let\loadclass\LoadClass \def\LoadClass#1{\loadclass[abstracton]{scrartcl}\let\scrmaketitle\maketitle\AtEndOfClass{\let\maketitle\scrmaketitle}} \PassOptionsToPackage{svgnames}{xcolor} {\makeatletter{\endlinechar`\^^J\obeyspaces \gdef\ErrorUpdate#1=#2,{\@ifpackagelater{#1}{#2}{}{\let\CheckDate\errmessage\toks@\expandafter{\the\toks@ \thisfile-documentation: updates required ! package #1 must be later than #2 to compile this documentation.}}}}% \gdef\CheckDate#1{{\let\CheckDate\relax\toks@{}\@for\x:=\thisfile=\thisdate,#1\do{\expandafter\ErrorUpdate\x,}\CheckDate\expandafter{\the\toks@}}}} \AtBeginDocument{\CheckDate{interfaces=2011/02/12,tabu=2011/02/25}} \documentclass[a4paper,oneside,american,latin1,T1]{ltxdoc} \AtBeginDocument{\DeleteShortVerb{\|}} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{hologo} % bug: must be loaded before graphicx... \usepackage{ltxnew,etoolbox,geometry,graphicx,xcolor,needspace,ragged2e} % general tools \usepackage{lmodern,bbding,hologo,relsize,moresize,manfnt,pifont,upgreek} % fonts \usepackage[official]{eurosym} % font \ifx y\microtypeYN % \usepackage[expansion=all,stretch=20,shrink=60]{microtype}\fi % font (microtype) \usepackage{xspace,tocloft,titlesec,fancyhdr,lastpage,enumitem,marginnote} % paragraphs & pages management \usepackage{holtxdoc,bookmark,hypbmsec,enumitem-zref} % hyper-links \usepackage{array,delarray,longtable,colortbl,multirow,makecell,booktabs} % tabulars \usepackage{tabularx}\tracingtabularx % tabularx \usepackage{txfonts,framed} \usepackage{interfaces} \usepackage{nccfoots} \usepackage[linegoal,delarray]{tabu} \CodelineNumbered\lastlinefit999 \usepackage{embedfile} \usepackage{fancyvrb}\fvset{gobble=1,listparameters={\topsep=0pt}} \usepackage{listings} \lstset{ gobble=1, language=[LaTeX]TeX, basicstyle=\ttfamily, breaklines=true, upquote=true, % prebreak={\%\,\ding{229}}, backgroundcolor=\color[gray]{0.90}, keywordstyle=\color{blue}\bfseries, keywordstyle=[2]{\color{ForestGreen}}, commentstyle=\ttfamily\color{violet}, keywordstyle=[3]{\color{black}\bfseries}, keywordstyle=[4]{\color{red}\bfseries}, keywordstyle=[5]{\color{blue}\bfseries}, keywordstyle=[6]{\color{green}\bfseries}, keywordstyle=[7]{\color{yellow}\bfseries}, %extendedchars={true}, alsoletter={&}, morekeywords=[1]{ \lstdefinestyle, \lstinputlisting,\lstset, \color, \geometry,\lasthline,\firsthline, \cmidrule,\toprule,\bottomrule, \everyrow,\tabulinestyle,\tabureset,\savetabu,\usetabu,\preamble, \taburulecolor,\taburowcolors}, morekeywords=[2]{ tabular, caption, table, tabu}, morekeywords=[3]{ &}, morekeywords=[4]{\linegoal}, morekeywords=[5]{blue}, morekeywords=[6]{green}, morekeywords=[7]{yellow}, } \csname endofdump\endcsname \hypersetup{% pdftitle={The linegoal package}, pdfsubject={A new dimen corresponding to the remainder of the line}, pdfauthor={Florent CHERVET}, colorlinks,linkcolor=reflink, pdfstartview=FitH, pdfkeywords={TeX, LaTeX, e-TeX, pdfTeX, package, zref, linegoal}} \embedfile{\thisfile.dtx} \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{153} % % \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 % Lower-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 % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % % \DoNotIndex{\begin,\CodelineIndex,\CodelineNumbered,\def,\DisableCrossrefs,\~,\@ifpackagelater,\z@,\@ne,\end,\endinput} % \DoNotIndex{\DocInput,\documentclass,\EnableCrossrefs,\GetFileInfo} % \DoNotIndex{\NeedsTeXFormat,\OnlyDescription,\RecordChanges,\usepackage} % \DoNotIndex{\ProvidesClass,\ProvidesPackage,\ProvidesFile,\RequirePackage} % \DoNotIndex{\filename,\fileversion,\filedate,\let} % \DoNotIndex{\@listctr,\@nameuse,\csname,\else,\endcsname,\expandafter} % \DoNotIndex{\gdef,\global,\if,\item,\newcommand,\nobibliography} % \DoNotIndex{\par,\providecommand,\relax,\renewcommand,\renewenvironment} % \DoNotIndex{\stepcounter,\usecounter,\nocite,\fi} % \DoNotIndex{\@fileswfalse,\@gobble,\@ifstar,\@unexpandable@protect} % \DoNotIndex{\AtBeginDocument,\AtEndDocument,\begingroup,\endgroup} % \DoNotIndex{\frenchspacing,\MessageBreak,\newif,\PackageWarningNoLine} % \DoNotIndex{\protect,\string,\xdef,\ifx,\texttt,\@biblabel,\bibitem} % \DoNotIndex{\z@,\wd,\wheremsg,\vrule,\voidb@x,\verb,\bibitem,\globcount,\globdimen} % \DoNotIndex{\FrameCommand,\MakeFramed,\FrameRestore,\hskip,\hfil,\hfill,\hsize,\hspace,\hss,\hbox,\hb@xt@,\endMakeFramed,\escapechar} % \DoNotIndex{\do,\date,\if@tempswa,\@tempdima,\@tempboxa,\@tempswatrue,\@tempswafalse,\ifdefined,\ifhmode,\ifmmode,\cr} % \DoNotIndex{\box,\author,\advance,\multiply,\Command,\outer,\next,\leavevmode,\kern,\title,\toks@,\trcg@where,\tt} % \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 % \parindent\z@\parskip.4\baselineskip\topsep\parskip\partopsep\z@ % \newrobustcmd*\FC{{\color{copper}\usefont{T1}{fts}xn FC}} % \newrobustcmd\ClearPage{\@ifstar\clearpage{}} % \newrobustcmd*\CTANentry[1]{\href{http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/#1.html}{\xpackage{#1}}} % \def\M{\@ifstar{\M@i\@firstofone}{\M@i\meta}} % \def\M@i#1{\@ifnextchar[\M@square % {\ifx (\@let@token^^A) % \expandafter\M@paren % \else\ifx |\@let@token % \expandafter\expandafter\expandafter\M@bar % \else \expandafter\expandafter\expandafter\M@brace % \fi\fi#1}} % \def\M@square #1[#2]{\M@Bracket[{#1{#2}}]} % \def\M@paren #1(#2){\M@Bracket({#1{#2}})} % \def\M@bar #1|#2|{\M@Bracket\textbar{#1{#2}}\textbar} % \def\M@brace #1#2{\M@Bracket\{{#1{#2}}\}} % \def\M@Bracket#1#2#3{{\ttfamily#1#2#3}} % \def\pkgcolor{\color{pkgcolor}}\colorlet{pkgcolor}{teal} % % \catcode`\§ \active \def§{\@ifnextchar §{\par\nobreak\vskip-2\parskip}{\par\nobreak\vskip-\parskip}} % \def\thispackage{\xpackage{{\pkgcolor\thisfile}}\xspace} % \def\ThisPackage{\Xpackage{\thisfile}\xspace} % \def\Xpackage{\@dblarg\X@package} % \def\X@package[#1]#2{\@testopt{\X@@package{#1}{#2}}{}} % \def\X@@package#1#2[#3]{\xpackage{#2\footnote{\noindent\xpackage{#2}: \CTANhref{#1}#3}}\xspace} % \def\XPackage#1{\href{\CTANbaseurl/help/Catalogue/entries/#1.html}{\xpackage{#1}}} % \newrobustcmd*\thisyear{\begingroup % \def\thisyear##1/##2\@nil{\endgroup % \oldstylenums{\ifnum##1=2010\else 2010\,\textendash\,\fi ##1}^^A % }\expandafter\thisyear\thisdate\@nil % } % \newrobustcmd*\TabU[1][\pkgcolor]{\quitvmode\hbox{{#1{\larger[3]\usefont{U}{eur}mn\char"1C}$_\aleph \mkern.1666mu b\,$\rotatebox[origin=c]{-90}{\sf\smaller U}}}\xspaceverb} % \newrobustcmd*\TABU[1][\pkgcolor]{\quitvmode\hbox{{#1{\larger[8]\usefont{U}{eur}mn\char"1C}$_\aleph \mkern.1666mu b\,$\rotatebox[origin=c]{-90}{\sf\smaller U}}}\xspaceverb} % \newcommand\macrocodecolor{\color{macrocode}}\definecolor{macrocode}{rgb}{0.08,0.00,0.15} % \newcommand\reflinkcolor{\color{reflink}}\colorlet{reflink}{DarkSlateBlue} % \newrobustcmd*\stform{\ifincsname\else\expandafter\@stform\fi} % \newrobustcmd*\@stform{\@ifnextchar*{\@@stform[]\textasteriskcentered\@gobble}\@@stform} % \newrobustcmd*\@@stform[2][\string]{\texttbf{#1#2}\xspaceverb} % \newrobustcmd*\xspaceverb{\ifnum\catcode`\ =\active\else\expandafter\xspace\fi} % \DefineVerbatimEnvironment{VerbLines}{Verbatim}{gobble=1,frame=lines,framesep=6pt,fontfamily=\ttdefault,fontseries=m} % \DefineVerbatimEnvironment{Verb*}{Verbatim}{gobble=1,fontfamily=\ttdefault,fontseries=m,commandchars=$()} % \def\smex{\leavevmode\hb@xt@2em{\hfil$\longrightarrow$\hfil}} % \newcommand\texorpdf[2]{\texorpdfstring{#1{#2}}{#2}} % \renewrobustcmd\#[1]{{\usefont{T1}{pcr}{bx}{n}\char`\##1}} % \newrobustcmd*\grabcs{\leavevmode\hbox\bgroup\bgroup\makeatletter\aftergroup\endgrabcs} % \def\endgrabcs{\egroup\xspaceverb} % \renewrobustcmd*\cs{\grabcs\cs@} % \newrobustcmd*\cs@[2][]{\begingroup\escapechar\m@ne\def\x ##1{\endgroup\@maybehyperlink{##1}{\texttt{#1{\@backslashchar##1}}}}\expandafter\x\expandafter{\string#2}\egroup} % \newrobustcmd*\@maybehyperlink [2]{\ifcsname @declcs.\detokenize{#1}\endcsname \hyperref{}{declcs}{#1}{#2}\else #2\fi} % \newcommand*\cs@pdf[1]{\@backslashchar\if\@backslashchar\string#1 \else\string#1\fi} % \newrobustcmd*\csbf{\cs[\textbf]} % \newrobustcmd*\csref[2][]{{\escapechar\m@ne\edef\my@tempa{\string#2}\edef\x ##1{\noexpand\hyperref{}{declcs}{\my@tempa}{\noexpand\cs[{##1}]{\my@tempa}}}\expandafter}\x{#1}} % \newcommand\env{\texorpdfstring \env@ \env@pdf} % \newcommand*\env@pdf[1]{#1} % \newrobustcmd*\env@{\@ifstar {\env@starsw[environment]}{\env@starsw[]}} % \new\def\env@starsw[#1]#2{\textt{#2}\ifblank{#1}{}{ #1}\xspaceverb} % \newcommand\textt[1]{\texorpdf\texttt{#1}} % \newcommand\texttbf[1]{\textt{\bfseries#1}} % \newcommand\nnn{\normalfont\mdseries\upshape}\newcommand\nbf{\normalfont\bfseries\upshape} % \newrobustcmd*\blue{\color{blue}}\newcommand*\red{\color{dr}}\newcommand*\green{\color{green}}\newcommand\rred{\color{red}} % \definecolor{copper}{rgb}{0.67,0.33,0.00} \newcommand\copper{\color{copper}} % \definecolor{dg}{rgb}{0.02,0.29,0.00} \newcommand\dg{\color{dg}} % \definecolor{db}{rgb}{0,0,0.502} \newcommand\db{\color{db}} % \definecolor{dr}{rgb}{0.49,0.00,0.00} \let\dr\red % \definecolor{lk}{rgb}{0.2,0.2,0.2} \newrobustcmd\lk{\color{lk}} % \newrobustcmd\bk{\color{black}} % \newrobustcmd\ie{\emph{ie.}} % \let\cellstrut\bottopstrut % \newrobustcmd*\csanchor[2][]{^^A % \immediate\write\@mainaux{\csgdef{@declcs.\string\detokenize{#2}}{}}^^A % \raisedhyperdef[14pt]{declcs}{#2}{\cs[{#1}]{#2}}^^A % } % \renewrobustcmd\declcs[2][]{^^A % \if@nobreak \par\nobreak % \else \par\addvspace\parskip % \Needspace{.08\textheight}\fi % \changefont{size+=2.5pt,spread=1,fam=\ttdefault}^^A % \def\*{\unskip\,\texttt{*}}\noindent % \hskip-\leftmargini % \begin{tabu}{|l|}\hline % \expandafter\SpecialUsageIndex\csname #2\endcsname % \csanchor[{#1}]{#2}} % \renewcommand\enddeclcs{% % \crcr \hline \end{tabu}\nobreak % \par \nobreak \noindent % \ignorespacesafterend % } % % \let\plainllap\llap % \newrobustcmd\macro@llap[1]{{\global\let\llap\plainllap % \setbox0=\hbox\bgroup \raisedhyperdef{macro}{\saved@macroname}{#1}\egroup % \ifdim\wd0>20mm % \hbox to\z@ \bgroup\hss \hbox to20mm{\unhcopy0\hss}\egroup % \edef\@tempa{\hskip\dimexpr\the\wd0-20mm}\global\everypar\expandafter{\the\expandafter\everypar % \@tempa \global\everypar{}}^^A % \else \llap{\unhbox0}\fi}} % \AtBeginEnvironment{macro}{\if@nobreak\else\Needspace{2\baselineskip}\fi % \MacrocodeTopsep\z@skip \MacroTopsep\z@skip \parsep\z@ \topsep\z@ \itemsep\z@ \partopsep\z@ % \let\llap\macro@llap} % \AtEndEnvironment{macro}{\goodbreak\vskip.3\parskip} % % \sectionformat\section[hang]{ % bookmark={color=MidnightBlue}, % bottom=\smallskipamount,top=\medskipamount, % } % \sectionformat\subsection{ % bookmark={color=MidnightBlue}, % } % \pagesetup{% % norules, % font=\scriptsize\color[gray]{.55}, % head/font+=\sffamily, % head/left=\moveleft1cm\vbox to\z@{\vss\setbox0=\null\ht0=\z@\wd0=\paperwidth\dp0=\headheight\rlap{\colorbox{Ivory}{\box0}}}\vskip-\headheight{\color{pkgcolor!60}\bfseries l\,i\,n\,e\,g\,o\,a\,l}, % head/right/font+=\color{pkgcolor!40}\mdseries, % 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,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} % % \title{\vspace*{-28pt}\href{http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/linegoal.html}{\HUGE\bfseries\sffamily\color{CornflowerBlue}\@backslashchar\,l\,i\,n\,e\,g\,o\,a\,l}\Footnotemark{*}\vspace*{6pt}} % \author{\small\thisdate~--~\hyperref[\thisversion]{version \thisversion}} % \date{} % \subtitle{\begin{tabu}{X[c]}\LARGE A ``dimen'' measuring the remainder of the line\\[1ex] requires \hologo{pdfTeX} or \hologo{XeTeX}\\ \small\FC \end{tabu}\vspace*{-12pt}} % \makeatother % \maketitle % % \makeatletter\begingroup % \Footnotetext{\rlap{*}\kern1em}{\noindent % This documentation is produced with the \textt{DocStrip} utility.\par % \begin{tabu}{X[-3]X[-1]X} % \smex To get the package, &run: &\texttt{etex \thisfile.dtx} \\ % \smex To get the documentation &run (thrice): &\textt{pdflatex \thisfile.dtx} \\ % \leavevmode\hphantom\smex To get the index, &run: &\texttt{makeindex -s gind.ist \thisfile.idx} % \end{tabu}§ % The \xext{dtx} file is embedded into this pdf file thank to \XPackage{embedfile} by H. Oberdiek.} % \endgroup\makeatother % % \deffootnote{1em}{0pt}{\rlap{\thefootnotemark.}\kern1em}\setcounter{footnote}{0} % {\vspace*{-12mm}\let\quotation \relax \let\endquotation \relax % \begin{abstract}\parskip\medskipamount\parindent0pt\lastlinefit0\relax\rightskip1.5cm\leftskip\rightskip\advance\linewidth by-2\leftskip % % \thispackage provides a single macro: \cs\linegoal \, which expands to the dimension of the remainder of the line. % It requires \hologo{pdfTeX} (or \hologo{XeTeX}) for its \cs\pdfsavepos primitive. % With \hologo{pdfTeX}, \cs\pdfsavepos works in \textt{pdf} mode (\cs\pdfoutput$>0$) \textbf{and also in} \textt{dvi} mode (\cs\pdfoutput$=0$). % Two compilations (at least) are necessary to get the correct ``line goal''.§ % {\centering\extrarowsep=.3\parskip % \begin{tabu*}{ll} % Saying: &\cs\somedimen = \cs\linegoal \quad\footnote{Note that only this syntax allows the \cs\global preffix in case the \XPackage{calc} package is loaded.} \\ % or: &\cs\setlength \cs\somedimen \M*{\cs\linegoal} % \end{tabu*} % \par % } % % sets \cs\somedimen to be the (horizontal) length from the current position to the right margin. This can be useful for % use with \XPackage{tabu},\, \XPackage{tabularx},\, or\, \textt{tabular\stform*}\, for example.§ % {\centering\extrarowheight\parskip % \begin{tabu} to\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, if the value has changed. % \end{tabu}\par} % % Limitation when using \cs\linegoal inside \xpackage{calc} of \hologo{eTeX} expressions: % % If \cs\linegoal is used inside an expression with \cs\dimexpr, \cs\glueexpr or % inside \cs\setlength (package \xpackage{calc}), then \cs\linegoal \textbf{must appear at the very last position in the expression}: % % \begin{tabu*}spread0pt .{X}\} % \begin{Verbatim} % \begin{tabu} to\dimexpr-2in + .5\linegoal{XX} .... % \setlength \dimen@ {-2in + .5\linegoal} % \end{tabu} % \end{Verbatim} %\end{tabu*} %\, are admissible. % % \thispackage requires \hologo{pdfTeX} (in \textt{pdf} or \textt{dvi} mode) % or \hologo{XeTeX} and the module \xpackage{zref-savepos} of \XPackage{zref}. % % \end{abstract}} % % \tocsetup{% % section/skip=4pt plus2pt minus2pt, % subsection/skip=0pt plus2pt minus2pt, % section/dotsep,subsection/dotsep=,subsection/pagenumbers=off, % dotsep=1.5mu, % dot=\hbox{\scriptsize.}, % title={\pkgcolor\leaders\vrule height3.4pt depth-3pt\hfill\null}\quad Contents of \thisfile\quad{\pkgcolor\leaders\vrule height3.4pt depth-3pt\hfill\null}, % title/bottom=6pt, % after=\leavevmode{\pkgcolor\hrule}, % columns=2, % } % % \tableofcontents % % \clearpage \bookmarksetup{bold*} % % \section{User interface} % \label{userinterface} % % \subsection{\cs{linegoal}: a macro which behaves mostly like a \textt{dimen}} % % \begin{declcs}{linegoal} % \end{declcs} % % 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 (which is supplied by \hologo{XeTeX} as well). % For convenience, \thispackage loads and uses the \xpackage{zref-savepos} package from H. Oberdiek. % % \cs\pdfsavepos is supplied by \hologo{pdfTeX} (and \hologo{XeTeX}) in both \textt{pdf} and \textt{dvi} modes. % If the document is not compiled with \hologo{pdfTeX} or \hologo{XeTeX} then \cs\linegoal will expand to \cs\linewidth % in any case. % % {\fontname\font \hologo{XeTeX} {\changefont{fam=cmr}\hologo{XeTeX}}} % % \begin{VerbLines}[commandchars=£()] % This is a tabularx that fills the remainder of the line: % \begin{tabularx}(£rred(\linegoal)){|l|X|}\hline % Something & Something else \\ % Something & Something else \\\hline % \end{tabularx} % \end{VerbLines} % % \textbf{Typical application is for tabulars of variable width} like \CTANentry{tabularx} or \CTANentry{tabu}. % Package \TabU has a \textt{linegoal} option to use \cs\linegoal as the default target for the whole tabular. % % % 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{tabularx} % % {\smaller % \begin{lstlisting}[caption={This is a \env{tabu} that fills the half of the remainder of the line}] % \tabulinestyle{red} % $\begin{tabu} to .5\linegoal {|X[$c]|X[2$c]|} \tabucline- % \alpha & \beta \\ \tabucline[on2pt red]- % \gamma & \delta \\ \tabucline- % \end{tabu}$ % \end{lstlisting} % } % % This is a \textt{tabu} that fills the half of the remainder of the line: % {\tabulinestyle{red} % $\begin{tabu}to .5\linegoal{|X[$c]|X[2$c]|} \tabucline- % \alpha & \beta \\ \tabucline[on 2pt,red]- % \gamma & \delta \\ \tabucline- % \end{tabu}$ % } % % Please, refer to \CTANentry{tabu} documentation % for more information on the preamble and the command \cs\tabucline used here as an example. % % \subsection{The \textt{verbose} package option} % % You can load \thispackage with the \M*[verbose] option to get the line-goals % as information in the \xext{log} file. % % \StopEventually{ % } % % \bookmarksetup{bold*} % \sectionformat\subsection{ % bookmark={color=gray}, % } % \section{Implementation} \label{sec:implementation} % \csdef{HDorg@PrintMacroName}#1{\hbox to4em{\strut \MacroFont \string #1\ \hss}} % % \subsection{Identification} % % \begin{itemize} % \item The package namespace is \cs\LNGL@ % \end{itemize} % % \begin{macrocode} %<*package> \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} [2011/02/25 v2.9 - Measuring the remaining width of the line] % \end{macrocode} % % \subsection{Requirements} % % The package requires \xpackage{zref} and its module \xpackage{zref-savepos}. % % \begin{macrocode} \ifdefined\pdfsavepos\else % works also in dvi mode \PackageWarning{linegoal} {This package requires pdfTeX for its \string\pdfsavepos\space primitive\MessageBreak pdfTeX has not been detected and \string\linegoal\space will expand\MessageBreak to \string\linewidth\space in any case} \gdef\linegoal{\linewidth}% \expandafter\endinput \fi \RequirePackage{etex,zref,zref-savepos} % \end{macrocode} % % \subsection{zref properties} % % \begin{macrocode} \zref@newprop*{linegoal}[\linewidth]{\dimexpr \linewidth -\the\pdflastxpos sp +\ifodd\zref@extractdefault{linegoal/posx.\the\LNGL@unique}{page}\c@page \oddsidemargin \else\evensidemargin \fi +1in+\hoffset \relax }% linegoal zref-property % \end{macrocode} % % \subsection{The linegoal macro} % % \begin{macro}{\linegoal} % % \cs\linegoal first expands to the current value (\cs\linewidth or the line goal stored % in the \xext{aux} file as a \xpackage{zref} property). % % Thereafter, \cs\LNGL@setlinegoal is expanded in order to set the new value of the \xpackage{zref} property, % to be used for the next compilation. The case is slightly different when using the \xpackage{calc} package, % for \cs\setlength is modified by the \xpackage{calc} package. % % \begin{macrocode} \newcommand*\linegoal{% \zref@extract{linegoal.\the\LNGL@unique}{linegoal}\LNGL@setlinegoal }% \linegoal \globcount \LNGL@unique \globdimen \LNGL@tempdim \def\LNGL@setlinegoal {\relax \LNGL@set@linegoal} \protected\def\LNGL@set@linegoal{\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/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/posx.\the\LNGL@unique}{page}\c@page\relax \fi \global\advance\LNGL@unique\@ne \else\LNGL@noauxerr \fi \@esphack }% \LNGL@set % \end{macrocode} % \end{macro} % % \subsection{Error, Warning and Info} % % \begin{macrocode} \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 has changed \MessageBreak since last run. Please rerun to get \MessageBreak the correct value}% }% \LNGL@warn \def\LNGL@@info{\message{Package linegoal Info: \string\linegoal=\the\LNGL@tempdim\on@line, page \the\c@page}} \let\LNGL@info\@empty % \end{macrocode} % % \subsection{The \textt{verbose} package option} % % \begin{macro}{\verbose (package option)} % \begin{macrocode} \DeclareOption{verbose}{\let\LNGL@info \LNGL@@info} \ProcessOptions % \end{macrocode} % \end{macro} % % \begin{macrocode} % % \end{macrocode} % % \DeleteShortVerb{\+} % % \addtocontents{toc}{\tocsetup{subsection/font+=\smaller}} % \begin{History} % \sectionformat\subsection{font=\normalsize\pkgcolor,bottom=0pt,top=\smallskipamount} % % \begin{Version}{2011/02/25 v2.9}\HistLabel{2.9} % \item Modification of \cs\LNGL@setlinegoal in order to be able to use \cs\linegoal inside the argument of tabulars (or \cs\multicolumn) % \texttbf p (or \texttbf m or \texttbf b) columns when the \xpackage{calc} package is loaded.\\ % \xfile{array.sty} unfortunately expands the argument of \texttbf p, \texttbf m of \texttbf b columns during the rewritting process... \\ \par\vskip-\baselineskip % {\centering % \begin{tabu} .{>\small l}\} % \cs\edef\cs\x\M*{\cs\linegoal} \\ % \cs\setlength\cs\somedimen \M*{\cs\x} % \end{tabu} % now works...\par} % \end{Version} % % \begin{Version}{2011/01/15 v2.8}\HistLabel{2.8} % \item Banner modification. % \end{Version} % % \begin{Version}{2010/12/07 v2.7}\HistLabel{2.7} % \item Updated documentation. Compatibility with \xpackage{tabu} package (version \textt{1.5 -- 2010/12/07}). % \end{Version} % % \begin{Version}{2010/11/30 v2.6}\HistLabel{2.6} % \item Added the \textt{verbose} package option. % \end{Version} % % \begin{Version}{2010/11/19 v2.2}\HistLabel{2.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}\HistLabel{2.1} % \item \thispackage works also without \hologo{pdfTeX}, but \cs\linegoal % is replaced by \cs\linewidth in any case. \\ % A warning is displayed. % \end{Version} % % \begin{Version}{2010/09/25 v2.0}\HistLabel{2.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}\HistLabel{1.2} % \item Modification in warning message... % \end{Version} % % \begin{Version}{2010/06/06 v1.1}\HistLabel{1.1} % \item The first release required some small corrections ! % \end{Version} % % \begin{Version}{2010/05/07 v1.0}\HistLabel{1.0} % \item First version. % \end{Version} % % \end{History} % % \begin{thebibliography}{9} % % \bibitem{zref} % \textit{The \CTANentry{zref} package} by Heiko Oberdiek \\ % 2010/05/01 v2.17 New reference scheme for LaTeX2e \\ % % \bibitem{tabu} % \textit{The \CTANentry{tabu} package} by \FC \\ % 2011/02/24 v2.6 - flexible LaTeX tabulars \\ % % \end{thebibliography} % % \bookmarksetup{openlevel=1} % \PrintIndex % % \Finale