From e4d598c31f2635d2baf122c23c60531bd3d4b028 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 25 Oct 2022 20:13:48 +0000 Subject: docshots (25oct22) git-svn-id: svn://tug.org/texlive/trunk@64808 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/docshots/docshots.dtx | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/source/latex/docshots/docshots.dtx') diff --git a/Master/texmf-dist/source/latex/docshots/docshots.dtx b/Master/texmf-dist/source/latex/docshots/docshots.dtx index 8dfd11cf522..2e6d03614c2 100644 --- a/Master/texmf-dist/source/latex/docshots/docshots.dtx +++ b/Master/texmf-dist/source/latex/docshots/docshots.dtx @@ -50,7 +50,7 @@ %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{docshots} %<*package> -[2022-10-18 0.0.4 TeX Samples Next to Their PDF Snapshots in DTX] +[2022-10-25 0.0.5 TeX Samples Next to Their PDF Snapshots in DTX] % %<*driver> \documentclass{ltxdoc} @@ -128,9 +128,13 @@ % \begin{docshot} % \documentclass{article} % \usepackage{tikz} +% \usetikzlibrary{backgrounds} % \pagestyle{empty} % \begin{document} -% \begin{tikzpicture} +% \begin{tikzpicture}[ +% show background rectangle, +% background rectangle/.style= +% {draw=none,fill=gray!20}] % \node [circle,draw] (v0) {$v_0$}; % \node [circle,draw=orange,thick, % below right of=v0] (v1) {$v_1$}; @@ -355,6 +359,7 @@ Hello, world! % \section{Prerequisites} % \DescribeMacro{\docshotPrerequisite} +% \changes{0.0.3}{2022/10/14}{The command is added to enable copying of supplementary files into docshots snippets processing directory.} % If you need some files to be present next to the |.tex| snippet while % it's rendered by |pdflatex|, you can use |\docshotPrerequisite| with % a single mandatory argument. The argument is the name of a file you need @@ -429,8 +434,7 @@ Hello, world! % \StopEventually{} % \section{Implementation} - -% \changes{v0.0.1}{2022/10/09}{Initial version} +% \changes{0.0.1}{2022/10/09}{Initial version} % First, we include a few packages: % \begin{macrocode} @@ -439,17 +443,18 @@ Hello, world! \RequirePackage{xcolor} \RequirePackage{graphicx} \RequirePackage{tikz} -\usetikzlibrary{shadows.blur} % \end{macrocode} % Then, we process package options: +% \changes{0.0.4}{2022/10/18}{Package options "lstinputlisting" and "inputminted" introduced to enable printing of verbatim text either via listings or minted packages.} +% \changes{0.0.5}{2022/10/24}{Package option "log" added, which enables detailed logging via exec. By default, there is no logging at all.} % \begin{macrocode} \RequirePackage{pgfopts} +\def\docshots@log{} \pgfkeys{ /docshots/.cd, dtx/.store in=\docshots@dtx, - log/.store in=\docshots@log, - log/.default=, + log/.code=\def\docshots@log{log}, lstinputlisting/.store in=\docshots@lstinputlisting, inputminted/.store in=\docshots@inputminted, tmpdir/.store in=\docshots@tmpdir, @@ -472,7 +477,7 @@ Hello, world! left/.default=.3\linewidth, right/.store in=\docshots@right, right/.default=.55\linewidth, - tmpdir,pdflatex,gs,pdfcrop,margin,hspace,left,right,runs,log + tmpdir,pdflatex,gs,pdfcrop,margin,hspace,left,right,runs } \ProcessPgfOptions{/docshots} % \end{macrocode} @@ -549,7 +554,7 @@ Hello, world! % Otherwise, we ask |pdfcrop| to crop the PDF: % \begin{macrocode} \IfFileExists{\docshots@tmpdir/\jobname/\hash.crop.pdf} - {\message{docshots: on't pdfcrop, the PDF already exists + {\message{docshots: won't pdfcrop, the PDF already exists (\docshots@tmpdir/\jobname/\hash.crop.pdf)^^J}} {\iexec[\docshots@log,quiet]{\docshots@pdfcrop\space --margins \docshots@margin\space @@ -574,7 +579,7 @@ Hello, world! \begingroup% \par% \tikz[baseline=(a.north)] - \node (a) [draw=gray] + \node (a) [draw=gray,inner sep=0] {\includegraphics[width=\docshots@left] {\docshots@tmpdir/\jobname/\hash.crop.pdf}};% \hspace{\docshots@hspace}% -- cgit v1.2.3