diff options
author | Karl Berry <karl@freefriends.org> | 2024-01-13 21:23:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-01-13 21:23:02 +0000 |
commit | 2e3dbcef4f1570cfd31ec7c541e01c6d455fd2c5 (patch) | |
tree | 1280d1dddce2619c3f65cdc6961f6eb18d12d247 /Master/texmf-dist/tex/latex/docshots | |
parent | 0e93a7788bcd0887709e2b813f0222ac73df74be (diff) |
docshots (13jan24)
git-svn-id: svn://tug.org/texlive/trunk@69410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/docshots')
-rw-r--r-- | Master/texmf-dist/tex/latex/docshots/docshots.sty | 65 |
1 files changed, 38 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/docshots/docshots.sty b/Master/texmf-dist/tex/latex/docshots/docshots.sty index 6097af42e76..daaaa933080 100644 --- a/Master/texmf-dist/tex/latex/docshots/docshots.sty +++ b/Master/texmf-dist/tex/latex/docshots/docshots.sty @@ -31,7 +31,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{docshots} -[2024-01-09 0.4.1 TeX Samples Next to Their PDF Snapshots in DTX] +[2024-01-13 0.4.2 TeX Samples Next to Their PDF Snapshots in DTX] @@ -64,9 +64,13 @@ \RequirePackage{iexec} + \RequirePackage{fancyvrb} + \RequirePackage{xcolor} + \RequirePackage{graphicx} + \RequirePackage{tikz} \RequirePackage{pgfopts} @@ -115,9 +119,12 @@ \iexec[null]{mkdir -p "\docshots@tmpdir/\jobname"}% \RequirePackage{pdftexcmds} -\makeatletter\newcommand\docshots@mdfive[1]{\pdf@filemdfivesum{#1}}\makeatother +\makeatletter +\newcommand\docshots@mdfive[1]{\pdf@filemdfivesum{#1}} +\makeatother -\makeatletter\newenvironment{docshot} +\makeatletter +\newenvironment{docshot} {\VerbatimEnvironment\begin{VerbatimOut} {\docshots@tmpdir/\jobname/verbatim.tex}} {\end{VerbatimOut}% @@ -166,22 +173,7 @@ "\docshots@tmpdir/\jobname/\hash.pdf" "\docshots@tmpdir/\jobname/\hash.crop.pdf"}% \fi}% - \def\docshots@xopts{ - numbers=left,numbersep=3pt, - frame=leftline,framerule=.2pt,rulecolor=\color{gray}, - samepage=true, - commandchars=none, - baselinestretch=1 - }% - \ifdefined\docshots@small% - \edef\docshots@xopts{\unexpanded\expandafter{\docshots@xopts},fontsize=\small}% - \fi% - \ifdefined\docshots@tiny% - \edef\docshots@xopts{\unexpanded\expandafter{\docshots@xopts},fontsize=\scriptsize}% - \fi% - \ifdefined\docshots@opts - \edef\docshots@xopts{\unexpanded\expandafter{\docshots@xopts},\docshots@opts} - \fi + \message{docshots: the PDF is ready from line no. \the\inputlineno^^J}% \begingroup% \par% \tikz[baseline=(a.north)] @@ -200,34 +192,53 @@ {\docshots@inputminted} {\docshots@tmpdir/\jobname/\hash.tex}% \else% - \expandafter\VerbatimInput\expandafter[\docshots@xopts] - {\docshots@tmpdir/\jobname/\hash.tex}% + \fvset{numbers=left,numbersep=3pt}% + \fvset{frame=leftline,framerule=.2pt,rulecolor=\color{gray}}% + \fvset{samepage=true}% + \fvset{commandchars=none}% + \fvset{baselinestretch=1}% + \ifdefined\docshots@small% + \fvset{fontsize=\small}% + \fi% + \ifdefined\docshots@tiny% + \fvset{fontsize=\scriptsize}% + \fi% + \ifdefined\docshots@opts% + \fvset{\docshots@opts}% + \fi% + \VerbatimInput{\docshots@tmpdir/\jobname/\hash.tex}% \fi\fi% \vspace{0pt}% \end{minipage}% \par% \endgroup% \docshotOptions{}% -}\makeatother +} +\makeatother -\makeatletter\newcommand\docshotPrerequisite[1]{ +\makeatletter +\newcommand\docshotPrerequisite[1]{ \iexec[\docshots@log,quiet]{cp #1 "\docshots@tmpdir/\jobname"}% \message{docshots: File '#1' copied to '\docshots@tmpdir/\jobname/#1'^^J}% -}\makeatother +} +\makeatother -\makeatletter\newcommand\docshotAfter[1]{ +\makeatletter +\newcommand\docshotAfter[1]{ \iexec[\docshots@log,quiet]{/bin/echo -n '\detokenize{#1}' > "\docshots@tmpdir/\jobname/after.sh"}% \message{docshots: File '\docshots@tmpdir/\jobname/after.sh' created^^J}% -}\makeatother +} +\makeatother \makeatletter \gdef\docshots@opts{} \newcommand\docshotOptions[1]{% \gdef\docshots@opts{#1}% -}\makeatother +} +\makeatother |