diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-25 23:07:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-25 23:07:02 +0000 |
commit | 7df33fd1a4e61f23710ae0167ae14e4a01c1d483 (patch) | |
tree | cd84819c8b0a3db635563f7a6deced9726216c8c | |
parent | 8e702cd6feaf0a000bfa3a3cdb0bcd66c114a0fe (diff) |
new latex package catchfilebetweentags (25oct10)
git-svn-id: svn://tug.org/texlive/trunk@20204 c570f23f-e606-0410-a88d-b1316a301751
9 files changed, 907 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/catchfilebetweentags/README b/Master/texmf-dist/doc/latex/catchfilebetweentags/README new file mode 100644 index 00000000000..b910bc82b29 --- /dev/null +++ b/Master/texmf-dist/doc/latex/catchfilebetweentags/README @@ -0,0 +1,15 @@ +catchfilebetweentags + +If you know the package catchfile, upon which catchfilebetweentags +is written, you've understood yet the purpose of this package. + +The macro \catchfilebetweentags acts like \catchfile but extract +a portion of the file instead of the complete file. The extracted +portion can be delimited by strings or by docstrip tags : + %<*tag> .... .... %</tag> + +Comments inside the portion can be ignored or catched. + +ExecuteMetaData is a shortcut to execute immediately the extracted portion. + +(c) lppl 2010 (FC)
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/catchfilebetweentags/catchfilebetweentags.pdf b/Master/texmf-dist/doc/latex/catchfilebetweentags/catchfilebetweentags.pdf Binary files differnew file mode 100644 index 00000000000..c60ed199b59 --- /dev/null +++ b/Master/texmf-dist/doc/latex/catchfilebetweentags/catchfilebetweentags.pdf diff --git a/Master/texmf-dist/source/latex/catchfilebetweentags/catchfilebetweentags.drv b/Master/texmf-dist/source/latex/catchfilebetweentags/catchfilebetweentags.drv new file mode 100644 index 00000000000..5c922e253fd --- /dev/null +++ b/Master/texmf-dist/source/latex/catchfilebetweentags/catchfilebetweentags.drv @@ -0,0 +1,66 @@ +%% +%% This is file `catchfilebetweentags.drv', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% catchfilebetweentags.dtx (with options: `driver') +%% +%% This is a generated file. +%% +%% catchfilebetweentags : 2010/06/20 v1.0 - catchfilebetweentags : catch file between delimiters or tags +%% +%% 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 catchfilebetweentags.dtx +%% and the derived files +%% catchfilebetweentags.sty, catchfilebetweentags.pdf, catchfilebetweentags.ins, +%% +%% catchfilebetweentags : catchfilebetweentags : a new dimen corresponding to the remainder of the line +%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%% +\edef\thisfile{\jobname} +\def\thisinfo{catch file between delimiters or tags (\FC)} +\def\thisdate{2010/06/20} +\def\thisversion{1.0} +\def\CTANbaseurl{http://www.ctan.org/tex-archive/macros/latex} +\def\CTANdisplay{CTAN:macros/latex} +\makeatletter\protected\def\CTANhref{\@ifstar\CTANhrefstar\CTANhrefnost}\makeatother +\newcommand*\CTANhrefstar[3][/contrib/]{\href{\CTANbaseurl#1#2}{#3}} +\newcommand*\CTANhrefnost[2][/contrib/]{\href{\CTANbaseurl#1#2}{\nolinkurl{\CTANdisplay#1#2}}} +\let\loadclass\LoadClass +\def\LoadClass#1{\loadclass[abstracton]{scrartcl}\let\scrmaketitle\maketitle\AtEndOfClass{\let\maketitle\scrmaketitle}} +\documentclass[a4paper,oneside]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage[american]{babel} +\usepackage[T1]{fontenc} +\usepackage{etoolbox,geometry,lastpage,titlesec,tocloft,graphicx,xcolor,xspace,tabularx,fancyhdr,bbding,embedfile,framed,multirow,txfonts,makecell,enumitem,arydshln,atveryend,catchfile} +\usepackage{interfaces} +\usepackage[hyperindex=false,pdfusetitle,colorlinks,pdfpagelabels,pdfencoding=auto]{hyperref} +\csname endofdump\endcsname +\usepackage{holtxdoc} +\CodelineNumbered +\usepackage{fancyvrb} +\lastlinefit999 +\geometry{top=1.2cm,headheight=1cm,headsep=.3cm,bottom=1.4cm,footskip=.5cm,left=2.5cm,right=1cm} +\hypersetup{% + pdftitle={The catchfilebetweentags package}, + pdfsubject={catch file between delimiters or tags}, + pdfauthor={Florent CHERVET}, + colorlinks,linkcolor=reflink, + pdfstartview={FitH}, + hyperindex=true, + pdfkeywords={tex, e-tex, latex, package, catchfilebetweentags, catchfile, docstrip}, + bookmarksopen=true,bookmarksopenlevel=2} +\usepackage{bookmark} +\embedfile{\thisfile.dtx} +\begin{document} + \DocInput{\thisfile.dtx} +\end{document} +\endinput +%% +%% End of file `catchfilebetweentags.drv'. diff --git a/Master/texmf-dist/source/latex/catchfilebetweentags/catchfilebetweentags.dtx b/Master/texmf-dist/source/latex/catchfilebetweentags/catchfilebetweentags.dtx new file mode 100644 index 00000000000..cd8af61b31f --- /dev/null +++ b/Master/texmf-dist/source/latex/catchfilebetweentags/catchfilebetweentags.dtx @@ -0,0 +1,626 @@ +% \iffalse meta-comment +% catchfilebetweentags : 2010/06/20 v1.0 - catchfilebetweentags : catch file between delimiters or tags] +% +% 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 catchfilebetweentags.dtx +% and the derived files +% catchfilebetweentags.sty, catchfilebetweentags.pdf, catchfilebetweentags.ins +% +% Unpacking: +% (a) If catchfilebetweentags.ins is present: +% etex catchfilebetweentags.ins +% (b) Without catchfilebetweentags.ins: +% etex catchfilebetweentags.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{catchfilebetweentags.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (pdf)latex catchfilebetweentags.dtx +% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%<*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 +%</ignore> +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: 2010/06/20 v1.0 - catchfilebetweentags : catch file between delimiters or tags} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +catchfilebetweentags : 2010/06/20 v1.0 - catchfilebetweentags : catch file between delimiters or tags + +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 catchfilebetweentags.dtx +and the derived files + catchfilebetweentags.sty, catchfilebetweentags.pdf, catchfilebetweentags.ins, + +catchfilebetweentags : catchfilebetweentags : a new dimen corresponding to the remainder of the line +Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{catchfilebetweentags.ins}{\from{catchfilebetweentags.dtx}{install}}% + \file{catchfilebetweentags.sty}{\from{catchfilebetweentags.dtx}{package}}% +} + +\askforoverwritetrue +\generate{% + \file{catchfilebetweentags.drv}{\from{catchfilebetweentags.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{* catchfilebetweentags.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `catchfilebetweentags.dtx'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +%</install> +%<*ignore> +\fi +%</ignore> +%<*driver> +\edef\thisfile{\jobname} +\def\thisinfo{catch file between delimiters or tags (\FC)} +\def\thisdate{2010/06/20} +\def\thisversion{1.0} +\def\CTANbaseurl{http://www.ctan.org/tex-archive/macros/latex} +\def\CTANdisplay{CTAN:macros/latex} +\makeatletter\protected\def\CTANhref{\@ifstar\CTANhrefstar\CTANhrefnost}\makeatother +\newcommand*\CTANhrefstar[3][/contrib/]{\href{\CTANbaseurl#1#2}{#3}} +\newcommand*\CTANhrefnost[2][/contrib/]{\href{\CTANbaseurl#1#2}{\nolinkurl{\CTANdisplay#1#2}}} +\let\loadclass\LoadClass +\def\LoadClass#1{\loadclass[abstracton]{scrartcl}\let\scrmaketitle\maketitle\AtEndOfClass{\let\maketitle\scrmaketitle}} +\documentclass[a4paper,oneside]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage[american]{babel} +\usepackage[T1]{fontenc} +\usepackage{etoolbox,geometry,lastpage,titlesec,tocloft,graphicx,xcolor,xspace,tabularx,fancyhdr,bbding,embedfile,framed,multirow,txfonts,makecell,enumitem,arydshln,atveryend,catchfile} +\usepackage{interfaces} +\usepackage[hyperindex=false,pdfusetitle,colorlinks,pdfpagelabels,pdfencoding=auto]{hyperref} +\csname endofdump\endcsname +\usepackage{holtxdoc} +\CodelineNumbered +\usepackage{fancyvrb} +\lastlinefit999 +\geometry{top=1.2cm,headheight=1cm,headsep=.3cm,bottom=1.4cm,footskip=.5cm,left=2.5cm,right=1cm} +\hypersetup{% + pdftitle={The catchfilebetweentags package}, + pdfsubject={catch file between delimiters or tags}, + pdfauthor={Florent CHERVET}, + colorlinks,linkcolor=reflink, + pdfstartview={FitH}, + hyperindex=true, + pdfkeywords={tex, e-tex, latex, package, catchfilebetweentags, catchfile, docstrip}, + bookmarksopen=true,bookmarksopenlevel=2} +\usepackage{bookmark} +\embedfile{\thisfile.dtx} +\begin{document} + \DocInput{\thisfile.dtx} +\end{document} +%</driver> +% \fi +% +% \CheckSum{0} +% +% \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} +% \DoNotIndex{\DocInput,\documentclass,\EnableCrossrefs,\end,\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,\newrobustcmd,\renewrobustcmd,\providerobustcmd} +% \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} +% \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} +% \DoNotIndex{\KVS@CommaComma,\KVS@CommaSpace,\KVS@EqualsSpace,\KVS@Equals,\KVS@Global,\KVS@SpaceEquals,\KVS@SpaceComma,\KVS@Comma} +% \DoNotIndex{\DefineShortVerb,\DeleteShortVerb,\UndefineShortVerb,\MakeShortVerb,\endinput} +% \makeatletter +% \newrobustcmd\ClearPage{\@ifstar\clearpage{}} +% \makeatletter +% \newrobustcmd*\FC{{\color{copper}\usefont{T1}{fts}xn FC}} +% ^^A\MakeShortVerb{\+}\DefineShortVerb{\|} +% \DeleteShortVerb{\|}\DeleteShortVerb{\+} +% \catcode`\§ \active \def§{\@ifnextchar §{\par\nobreak\vskip-2\parskip}{\par\nobreak\vskip-\parskip}} +% \def\pkgcolor{\color{teal}} +% \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}}} +% \def\Underbrace#1_#2{$\underbrace{\vtop to2ex{}\hbox{#1}}_{\footnotesize\hbox{#2}}$} +% +% \parindent\z@\parskip.4\baselineskip\topsep\parskip\partopsep\z@ +% \g@addto@macro\macro@font{\macrocodecolor\let\AltMacroFont\macro@font} +% \g@addto@macro\@list@extra{\parsep\parskip\topsep\z@\itemsep\z@} +% \DefineVerbatimEnvironment{VerbLines}{Verbatim}{gobble=1,frame=lines,framesep=6pt,fontfamily=txtt,fontseries=m} +% \DefineVerbatimEnvironment{Verb}{Verbatim}{gobble=1,fontfamily=txtt,fontseries=m} +% \DefineVerbatimEnvironment{Verb*}{Verbatim}{gobble=1,fontfamily=txtt,fontseries=m,commandchars=$()} +% \def\smex{\leavevmode\hb@xt@2em{\hfil$\longrightarrow$\hfil}} +% \newrobustcmd\verbfont{\usefont{T1}{\ttdefault}{\f@series}{n}} \let\vb\verbfont +% \newrobustcmd\vbbf{\usefont{T1}{\ttdefault}bn} +% \renewrobustcmd\#[1]{{\usefont{T1}{pcr}{bx}{n}\char`\##1}} +% \newrobustcmd\csred[1]{\textcolor{red}{\cs{#1}}} +% \renewrobustcmd\cs[2][]{\mbox{\vb#1\expandafter\@gobble\string\\#2}} +% \newrobustcmd\CSbf[1]{\textbf{\CS{#1}}} +% \newrobustcmd\csbf[2][]{\textbf{\cs[{#1}]{#2}}} +% \newrobustcmd\textttbf[1]{\textbf{\texttt{#1}}} +% \renewrobustcmd*\bf{\bfseries}\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}} +% \newrobustcmd\rrbf{\color{red}\bfseries} +% \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.75,0.00,0.00} \let\dr\red +% \definecolor{lk}{rgb}{0.2,0.2,0.2} \newrobustcmd\lk{\color{lk}} +% \newrobustcmd\bk{\color{black}}\newcommand\md{\mdseries} +% \newrobustcmd\ie{\emph{ie.}} +% \newrobustcmd\textt[2][]{\texttt{#1#2}} +% \newcommand\cellstrut{}\let\cellstrut\bottopstrut +% \def\M{\@ifstar{\M@i\@firstofone}{\M@i\meta}} +% \def\M@i#1{\@ifnextchar[^^A] +% {\M@square#1} +% {\@ifnextchar(^^A) +% {\M@paren#1} +% {\M@brace#1}}^^A +% } +% \def\M@square#1[#2]{\M@Bracket[{#1{#2}}]} +% \def\M@paren#1(#2){\M@Bracket({#1{#2}})} +% \def\M@brace#1#2{\M@Bracket\{{#1{#2}}\}} +% \def\M@Bracket#1#2#3{{\ttfamily#1#2#3}} +% \renewrobustcmd\declcs[2][]{^^A +% \par\addvspace{0ex plus 1ex}\noindent +% \hspace{-\leftmargini}^^A +% \def\*{\unskip\,\texttt{*}}^^A +% \begin{tabular}{|l|}^^A +% \hline +% \expandafter\SpecialUsageIndex\csname #2\endcsname +% \cs[{#1}]{#2}^^A +% } +% \pagesetup{ +% head/font=\color[gray]{.35}\footnotesize, +% foot/font=\color[gray]{.35}\scriptsize, +% head/rule/font=\color[gray]{.35},% +% head/rule/width=.4pt, +% foot/rule=.0pt, +% head/left=The \thispackage package -- \thisinfo, +% foot/left=\thispackage\,[rev.\thisversion]\,\copyright\,\oldstylenums{2010}\,\lower.3ex\hbox{\pkgcolor\NibRight}\,\FC, +% foot/right=\oldstylenums{\thepage} / \oldstylenums{\pageref{LastPage}}} +% \pagestyle{fancy} +% \pagesetup[plain]{ +% foot/right=\oldstylenums{\arabic{page}} / \oldstylenums{\pageref{LastPage}}} +% +% \newrobustcmd*\macrocodecolor{\color{macrocode}}\definecolor{macrocode}{rgb}{0.18,0.00,0.45} +% \newrobustcmd*\IMPLEMENTATION{% +% \hypersetup{bookmarksopenlevel=1} +% \bookmarksetup{bold=true,italic=true} +% \newgeometry{top=1.2cm,headheight=1cm,headsep=.3cm,bottom=1.4cm,footskip=.5cm,left=4cm,right=.5cm} +% \section{Implementation} \label{sec:implementation} +% \bookmarksetup{bold=false,italic=false}} +% \def\macro@llap#1{\setbox\z@\hbox{#1}\ifdim\wd\z@>3cm\hbox to\z@{\hss\hbox to3cm{#1\hss}}\else\hbox to\z@{\hss#1}\fi\setbox\z@\box\voidb@x} +% \pretocmd\macro{\let\llap\macro@llap}{}{} +% \apptocmd\endmacro{\goodbreak}{}{} +% +% \newcommand\reflinkcolor{\color{reflink}}\definecolor{reflink}{rgb}{0.49,0.00,0.00} +% \newrobustcmd\stform{\@ifnextchar*{\@stform[]\textasteriskcentered\@gobble}\@stform} +% \newrobustcmd\@stform[2][\string]{\textttbf{\rred#1#2}\xspace} +% +% \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} +% ^^A\subject{\thisinfo} +% \enlargethispage{\baselineskip} +% \maketitle +% +% \makeatletter\begingroup\let\@thefnmark\@empty\let\@makefntext\@firstofone +% \footnotetext{\noindent +% This documentation is produced with the \xpackage{DocStrip} utility.\loggingall {\topsep=0pt\relax^^A\showthe\partopsep\showthe\parskip +% \begin{tabbing} +% \qquad\=\smex\=To get the documentation, \= run (thrice):\quad\= \texttt{pdflatex \thisfile.dtx} \\ +% \qquad\>\>To get the index, \> run:\>\texttt{makeindex -s gind.ist \thisfile.idx} \\ +% \>\smex\>To get the package, \> run:\> \texttt{etex \thisfile.dtx} +% \end{tabbing}}§\tracingnone +% 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} +% \vspace*{-26pt} +% \begin{abstract}\parindent0pt\noindent\leftskip1cm\rightskip\leftskip\lastlinefit0\advance\linewidth by-2\leftskip +% +% \thispackage provides a macro \csbf{CatchFileBetweenTags} to capture the content of a file between two +% docstrip tags, and a macro \cs{CatchFileBetweenDelims} to capture between two strings (delimiters): +% +% +% {\def\theadfont{\large\scshape\db}\noindent +% \begin{tabularx}\linewidth{*{2}{>{\centering\arraybackslash}X}} +% \thead{docstrip tags example} & \thead{delimiters example} \cr +% \csbf[\copper]{CatchFileBetweenTags} & \csbf[\copper]{CatchFileBetweenDelims} \\[.5ex] +% \makecell[{{>{\ttfamily}c}}]{\dg\%<*meta> \kern2cm\cr +% something \cr +% to \cr +% capture \cr +% \dr\%</meta>\kern2cm} +% & +% \makecell[{{>{\ttfamily}c}}]{\dg<meta> \kern2cm\cr +% something \cr +% to \cr +% capture \cr +% \dr</meta>\kern2cm} \cr +% \end{tabularx}} +% +% \bigskip +% +% Alternatively, it is possible to execute the content of a captured-part with \csbf{ExecuteMetaData}. +% \medskip +% +% This packages requires \eTeX, and the \Xpackage[oberdiek/catchfile]{catchfile} package. +% +% This is the first version. +% +% \end{abstract} +% +% \sectionformat\section{% +% label=\arabic{section}\,\hbox{\color{teal}\small\HandRight},% +% labelsep=.5em +% } +% \tocsetup{% +% title/bottom=0pt,% +% twocolumns, +% section/skip=4pt plus2pt minus2pt,% +% subsection/skip=0pt plus2pt minus2pt, +% section/leaders,section/dotsep,% +% after=\vskip\baselineskip\hrule height3.4pt depth-3pt\relax +% } +% \gdef\contentsname{Contents\quad\leaders\vrule height3.4pt depth-3pt\hfill\null\kern0pt} +% \tableofcontents +% +% \hypersetup{bookmarksopenlevel=2} +% +% \MakeShortVerb{\+} +% +% \bookmarksetup{bold=true} +% \section{User interface} +% \label{userinterface} +% +% \bookmarksetup{color=copper} +% \subsection[\cs{CatchFileBetweenTags}]{\cs[\copper]{CatchFileBetweenTags}} +% +% \begin{declcs}[\red]{CatchFileBetweenTags}\stform[\phantom]*\M{cs-name}\M{file-name}\M{tag}\\ +% \cs[\red]{CatchFileBetweenTags}\stform*\M{cs-name}\M{file-name}\M{tag} +% \end{declcs} +% +% This command will catch the file given its name \meta{file-name} and store the (first) part of this file +% found between the two tags: +% \begin{Verb}[commandchars=$(),fontseries=b] +% %<*$meta(tag)> ($nnn and) %</$meta(tag)> +% \end{Verb} +% +% If there is no such tags, the result is empty. +% +% The capture is made inside \cs{makeatletter} ... \cs{makeatother}. +% More precisely, the result is retokenized (under the current catcode regime) +% with \string @ considered as a letter in all cases. +% +% The result is stored into either: +% \begin{itemize} +% \item if \meta{cs-name} is a token register: into this register +% \item otherwise \meta{cs-name} will be defined or redefined as a parameterless macro containing the catched part. +% \end{itemize} +% +% \def\interitem{\item[]\hskip-\leftmargin} +% \textbf{Comments inside the catched-part of the file are ignored} unless:§ +% \begin{enumerate}[label=\arabic*)] +% \item This is a \textit{line-comment}: the first character on the line is \%, not followed by \% +% \interitem \textbf{\color{red}and} +% \item \cs{CatchFileBetweenTags}\stform* is used +% \end{enumerate} +% In this case, \textit{line-comments} are read as if they were not commented, \ie the first character \% is removed. +% +% Non line-comments are always ignored. +% +% \subsection[\cs{ExecuteMetaData}]{\cs[\copper]{ExecuteMetaData}} +% +% \begin{declcs}[\red]{ExecuteMetaData}\M[filename]\M{tag}\\ +% \cs[\red]{ExecuteMetaData}\stform*\M[filename]\M{tag} +% \end{declcs} +% +% This macro will capture the contents of the current (main) file (\ie \cs{jobname}) between the two tags: +% \begin{Verb}[commandchars=$(),fontseries=b] +% %<*tag> ($nnn and) %</tag> +%\end{Verb} +% +% Then the code found is immediately expanded. {\small(You may say for example: \cs{AtBeginDocument}\cs{ExecuteMetaData}).} +% +% This is a wrapper for: +% \begin{Verb}[commandchars=$()] +% \CatchFileBetweenTags\temptoken{\jobname}{meta} +% \the\temptoken +% \global\temptoken{} +% \end{Verb} +% +% \cs{ExecuteMetaData}\stform* will keep the lines that begin with one (not two) \% character. +% +% Alternatively, it is possible to execute meta datas from an external file with:§ +% \qquad \cs{ExecuteMetaData}\M[file]\M{tag} +% +% +% \subsection[\cs{CatchFileBetweenDelims}]{\cs[\copper]{CatchFileBetweenDelims}} +% +% \begin{declcs}{CatchFileBetweenDelims}\M{cs-name}\M{file-name}\M{start-delimiter}\M{stop-delimiter}\M[setup] +% \end{declcs} +% +% This command will catch the file given its name \meta{file-name} and store the (first) part of this file +% found between the two string delimiters \meta{start-delimiter} and \meta{stop-delimiter} into either: +% \begin{itemize} +% \item if \meta{cs-name} is a token register: into this register +% \item otherwise \meta{cs-name} will be defined as a parameterless macro (a string) containing the catched part. +% \end{itemize} +% +% The optional parameter \M[setup] may be used to change \cs{catcodes} or end-of-line characters before the \cs{input} of +% \meta{file-name}. +% +% By default, \M[setup] is \cs{makeatletter}. +% +% \bookmarksetup{bold=false,color=black} +% +% \StopEventually{ +% } +% +% \IMPLEMENTATION +% +% \subsection{Identification} +% +% The package namespace is \textttbf{\db CatchFBT@}. +% +% \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{catchfilebetweentags} + [2010/06/20 v1.0 - Catch file between tags (FOC)] +% \end{macrocode} +% +% \subsection{Requirements} +% +% \begin{macrocode} +\RequirePackage{etex,etoolbox,ltxcmds} +\RequirePackage{catchfile} +% \end{macrocode} +% +% \subsection{Some constants} +% +% \begin{macrocode} +\globtoks\CatchFBT@tok +% \end{macrocode} +% +% \subsection{User macros} +% +%\begin{macro}{\CatchFileBetweenDelims} \quad\\ +% {\small\begin{tabular}{c@{\,=\,}l} +% \#1 &store-cs \cr +% \#2 &fname \cr +% \#3 &start \cr +% \#4 &end \cr +% [\#5] &setup +% \end{tabular}} +% \begin{macrocode} +\newrobustcmd*\CatchFileBetweenDelims[4]{% + \begingroup + \edef\CatchFileBetweenDelims{\endgroup + \noexpand\@testopt + {\CatchFBT@Work{\noexpand#1}{#2}{#3}{#4}} + {\noexpand\makeatletter}% + }\CatchFileBetweenDelims +}% \CatchFileBetweenDelims +% \end{macrocode} +% \end{macro} +% +%\begin{macro}{\CatchFileBetweenTags} \quad\\ +% {\small\begin{tabular}{c@{\,=\,}l} +% \#1 &store-cs\cr +% \#2 &fname\cr +% \#3 &tag\cr +% [\#4] &setup (for \cs{CatchFBT@Final}) +% \end{tabular}} +% \begin{macrocode} +\newcommand\CatchFileBetweenTags{} +\begingroup +\@makeother\<% +\@makeother\>% +\@makeother\*% +\catcode`\: 14% +\@makeother\%: +\gdef\CatchFileBetweenTags#1#2#3{: + \CatchFileBetweenDelims\CatchFBT@tok{#2}{%<*#3>}{%</#3>}[\CatchFBT@sanitize]: + \CatchFBT@Final{#1}: +}:% \CatchFileBetweenTags +\endgroup +% \end{macrocode} +%\end{macro} +% +% +%\begin{macro}{\ExecuteMetaData} +% \begin{macrocode} +\newrobustcmd*\ExecuteMetaData[2][\jobname]{% + \CatchFileBetweenTags\CatchFBT@tok{#1}{#2}% + \global\expandafter\CatchFBT@tok\expandafter{% + \expandafter}\the\CatchFBT@tok +}% \ExecuteMetaData +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Implementation macros} +% +% \begin{macro}{\CatchFBT@Work} +% {\small\begin{tabular}[t]{c@{\,=\,}l} +% \#1 &store-cs\cr +% \#2 &fname\cr +% \#3 &start\cr +% \#4 &end\cr +% [\#5] &setup (optional)\cr +% \end{tabular}} +% \begin{macrocode} +\long\protected\def\CatchFBT@Work#1#2#3#4[#5]{% + \def\CatchFBT@setup{#5% + \long\def\CatchFile@Do####1#3{\CatchFBT@catchthepart}% discard before start-delim + \long\edef\CatchFBT@catchthepart####1#4{% capture until end-delim + \CatchFBT@tok{\endgroup + \CatchFBT@IsAToken#1 + {\global\noexpand#1{####1}} + {\xdef\noexpand#1{\noexpand\unexpanded{####1}}}}% + \noexpand\CatchFBT@discardtherest}% + \long\expandafter\def + \expandafter\CatchFBT@discardtherest + \expandafter####\expandafter1\CatchFile@EOF{}% + \everyeof{#3#4}% + \everyeof\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\everyeof\CatchFile@EOF + \expandafter\the\expandafter\CatchFBT@tok\noexpand}}% + \CatchFileDef#1{#2}\CatchFBT@setup +}% \CatchFBT@Work +% \end{macrocode} +% \end{macro} +% +%\begin{macro}{\CatchFBT@sanitize} \quad \thispackage special setup for \cs{CatchFileBetweenDelims}: +% \begin{macrocode} +\def\CatchFBT@sanitize{% + \@sanitize + \@makeother\{% + \@makeother\}% + \endlinechar=`\^^J% +}% \CatchFBT@sanitize +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\CatchFBT@Final} retokenize under the current catcode regime (like standard \cs{input}): +% \begin{macrocode} +\newrobustcmd*\CatchFBT@Final[1]{\@testopt + {\CatchFBT@Fin@l{#1}}{}% +}% \CatchFBT@Final +\def\CatchFBT@Fin@l#1[#2]{% + \begingroup + \endlinechar\m@ne \makeatletter #2% + \scantokens\expandafter{% + \expandafter\CatchFBT@tok\expandafter{\the\CatchFBT@tok}}% + \CatchFBT@IsAToken{#1} + {\global#1\expandafter{\the\CatchFBT@tok}} + {\xdef#1{\the\CatchFBT@tok}}% + \ifx\CatchFBT@tok#1\else\global\CatchFBT@tok{}\fi + \endgroup +}% \CatchFBT@Final +% \end{macrocode} +%\end{macro} +% +% \begin{macro}{\CatchFBT@IsAToken} \quad A helper macro to decide if the result should be stored as a token register or as a macro. +% \begin{macrocode} +\def\CatchFBT@IsAToken#1{% + \expandafter\expandafter + \expandafter\CatchFBT@Is@Token + \expandafter\meaning\expandafter#1\string\toks + \\\\{first}{second}\\\\% +}% \CatchFBT@IsAToken +\expandafter\def\expandafter\CatchFBT@Is@Token + \expandafter#\expandafter1\string\toks#2#3\\#4#5#6\\\\{% + \csname ltx@% + \if\relax\detokenize{#1}\relax#5% + \else second\fi oftwo% + \endcsname +}% \CatchFBT@Is@Token +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</package> +% \end{macrocode} +% +% \DeleteShortVerb{\+} +% \restoregeometry +% \global\labelindent=0pt\global\itemindent\labelindent +% \begin{History} +% +% \begin{Version}{2010/06/20 v1.0} +% \item First version. +% \end{Version} +% +% \end{History} +% +% \begin{thebibliography}{9} +% +% \bibitem{docstrip} +% \textit{The \xpackage{docstrip} program}; +% 2009/09/25 v2.5d; +% \CTAN{macros/latex/base/}. +% +% \end{thebibliography} +% +% \PrintIndex +% +% \Finale diff --git a/Master/texmf-dist/source/latex/catchfilebetweentags/catchfilebetweentags.ins b/Master/texmf-dist/source/latex/catchfilebetweentags/catchfilebetweentags.ins new file mode 100644 index 00000000000..58e4f94a788 --- /dev/null +++ b/Master/texmf-dist/source/latex/catchfilebetweentags/catchfilebetweentags.ins @@ -0,0 +1,86 @@ +%% +%% This is file `catchfilebetweentags.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% catchfilebetweentags.dtx (with options: `install') +%% +%% This is a generated file. +%% +%% catchfilebetweentags : 2010/06/20 v1.0 - catchfilebetweentags : catch file between delimiters or tags +%% +%% 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 catchfilebetweentags.dtx +%% and the derived files +%% catchfilebetweentags.sty, catchfilebetweentags.pdf, catchfilebetweentags.ins, +%% +%% catchfilebetweentags : catchfilebetweentags : a new dimen corresponding to the remainder of the line +%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%% +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: 2010/06/20 v1.0 - catchfilebetweentags : catch file between delimiters or tags} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +catchfilebetweentags : 2010/06/20 v1.0 - catchfilebetweentags : catch file between delimiters or tags + +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 catchfilebetweentags.dtx +and the derived files + catchfilebetweentags.sty, catchfilebetweentags.pdf, catchfilebetweentags.ins, + +catchfilebetweentags : catchfilebetweentags : a new dimen corresponding to the remainder of the line +Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{catchfilebetweentags.ins}{\from{catchfilebetweentags.dtx}{install}}% + \file{catchfilebetweentags.sty}{\from{catchfilebetweentags.dtx}{package}}% +} + +\askforoverwritetrue +\generate{% + \file{catchfilebetweentags.drv}{\from{catchfilebetweentags.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{* catchfilebetweentags.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `catchfilebetweentags.dtx'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +\endinput +%% +%% End of file `catchfilebetweentags.ins'. diff --git a/Master/texmf-dist/tex/latex/catchfilebetweentags/catchfilebetweentags.sty b/Master/texmf-dist/tex/latex/catchfilebetweentags/catchfilebetweentags.sty new file mode 100644 index 00000000000..e201739d3f7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/catchfilebetweentags/catchfilebetweentags.sty @@ -0,0 +1,111 @@ +%% +%% This is file `catchfilebetweentags.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% catchfilebetweentags.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% catchfilebetweentags : 2010/06/20 v1.0 - catchfilebetweentags : catch file between delimiters or tags +%% +%% 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 catchfilebetweentags.dtx +%% and the derived files +%% catchfilebetweentags.sty, catchfilebetweentags.pdf, catchfilebetweentags.ins, +%% +%% catchfilebetweentags : catchfilebetweentags : 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 +\ProvidesPackage{catchfilebetweentags} + [2010/06/20 v1.0 - Catch file between tags (FOC)] +\RequirePackage{etex,etoolbox,ltxcmds} +\RequirePackage{catchfile} +\globtoks\CatchFBT@tok +\newrobustcmd*\CatchFileBetweenDelims[4]{% + \begingroup + \edef\CatchFileBetweenDelims{\endgroup + \noexpand\@testopt + {\CatchFBT@Work{\noexpand#1}{#2}{#3}{#4}} + {\noexpand\makeatletter}% + }\CatchFileBetweenDelims +}% \CatchFileBetweenDelims +\newcommand\CatchFileBetweenTags{} +\begingroup +\@makeother\<% +\@makeother\>% +\@makeother\*% +\catcode`\: 14% +\@makeother\%: +\gdef\CatchFileBetweenTags#1#2#3{: + \CatchFileBetweenDelims\CatchFBT@tok{#2}{%<*#3>}{%</#3>}[\CatchFBT@sanitize]: + \CatchFBT@Final{#1}: +}:% \CatchFileBetweenTags +\endgroup +\newrobustcmd*\ExecuteMetaData[2][\jobname]{% + \CatchFileBetweenTags\CatchFBT@tok{#1}{#2}% + \global\expandafter\CatchFBT@tok\expandafter{% + \expandafter}\the\CatchFBT@tok +}% \ExecuteMetaData +\long\protected\def\CatchFBT@Work#1#2#3#4[#5]{% + \def\CatchFBT@setup{#5% + \long\def\CatchFile@Do####1#3{\CatchFBT@catchthepart}% discard before start-delim + \long\edef\CatchFBT@catchthepart####1#4{% capture until end-delim + \CatchFBT@tok{\endgroup + \CatchFBT@IsAToken#1 + {\global\noexpand#1{####1}} + {\xdef\noexpand#1{\noexpand\unexpanded{####1}}}}% + \noexpand\CatchFBT@discardtherest}% + \long\expandafter\def + \expandafter\CatchFBT@discardtherest + \expandafter####\expandafter1\CatchFile@EOF{}% + \everyeof{#3#4}% + \everyeof\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\everyeof\CatchFile@EOF + \expandafter\the\expandafter\CatchFBT@tok\noexpand}}% + \CatchFileDef#1{#2}\CatchFBT@setup +}% \CatchFBT@Work +\def\CatchFBT@sanitize{% + \@sanitize + \@makeother\{% + \@makeother\}% + \endlinechar=`\^^J% +}% \CatchFBT@sanitize +\newrobustcmd*\CatchFBT@Final[1]{\@testopt + {\CatchFBT@Fin@l{#1}}{}% +}% \CatchFBT@Final +\def\CatchFBT@Fin@l#1[#2]{% + \begingroup + \endlinechar\m@ne \makeatletter #2% + \scantokens\expandafter{% + \expandafter\CatchFBT@tok\expandafter{\the\CatchFBT@tok}}% + \CatchFBT@IsAToken{#1} + {\global#1\expandafter{\the\CatchFBT@tok}} + {\xdef#1{\the\CatchFBT@tok}}% + \ifx\CatchFBT@tok#1\else\global\CatchFBT@tok{}\fi + \endgroup +}% \CatchFBT@Final +\def\CatchFBT@IsAToken#1{% + \expandafter\expandafter + \expandafter\CatchFBT@Is@Token + \expandafter\meaning\expandafter#1\string\toks + \\\\{first}{second}\\\\% +}% \CatchFBT@IsAToken +\expandafter\def\expandafter\CatchFBT@Is@Token + \expandafter#\expandafter1\string\toks#2#3\\#4#5#6\\\\{% + \csname ltx@% + \if\relax\detokenize{#1}\relax#5% + \else second\fi oftwo% + \endcsname +}% \CatchFBT@Is@Token +\endinput +%% +%% End of file `catchfilebetweentags.sty'. diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index df06148379a..1b51098d0d0 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -63,7 +63,8 @@ my @TLP_working = qw( bracketkey braille braket breakcites breakurl bullcntr bundledoc bussproofs bytefield c-pascal cachepic calctab calligra calrsfs cals calxxxx calxxxx-yyyy cancel - capt-of captcont captdef caption carlisle carolmin-ps cases casyl catechis + capt-of captcont captdef caption carlisle carolmin-ps cases casyl + catchfilebetweentags catechis cbcoptic cbfonts cc-pl ccaption ccfonts ccicons cclicenses cd cd-cover cdpbundl diff --git a/Master/tlpkg/tlpsrc/catchfilebetweentags.tlpsrc b/Master/tlpkg/tlpsrc/catchfilebetweentags.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/catchfilebetweentags.tlpsrc diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index 2df9ab4cda2..e58549bb525 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -74,6 +74,7 @@ depend captcont depend captdef depend cases depend casyl +depend catchfilebetweentags depend catechis depend cbcoptic depend ccaption |