texlive[69410] Master/texmf-dist: docshots (13jan24)
commits+karl at tug.org
commits+karl at tug.org
Sat Jan 13 22:23:02 CET 2024
Revision: 69410
https://tug.org/svn/texlive?view=revision&revision=69410
Author: karl
Date: 2024-01-13 22:23:02 +0100 (Sat, 13 Jan 2024)
Log Message:
-----------
docshots (13jan24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/docshots/docshots.pdf
trunk/Master/texmf-dist/source/latex/docshots/docshots.dtx
trunk/Master/texmf-dist/tex/latex/docshots/docshots.sty
Modified: trunk/Master/texmf-dist/doc/latex/docshots/docshots.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/docshots/docshots.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/docshots/docshots.dtx 2024-01-13 21:22:52 UTC (rev 69409)
+++ trunk/Master/texmf-dist/source/latex/docshots/docshots.dtx 2024-01-13 21:23:02 UTC (rev 69410)
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{docshots}
%<*package>
-[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]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -466,16 +466,37 @@
% \section{Implementation}
% \changes{0.0.1}{2022/10/09}{Initial version}
-% First, we include a few packages:
+% First, we include \href{https://ctan.org/pkg/iexec}{iexec}
+% in order to execute shell commands, such as |pdflatex| and |pdfcrop|:
% \begin{macrocode}
\RequirePackage{iexec}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/fancyvrb}{fancyvrb}
+% in order to render verbatim texts:
+% \begin{macrocode}
\RequirePackage{fancyvrb}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/xcolor}{xcolor}
+% in order to make borders gray:
+% \begin{macrocode}
\RequirePackage{xcolor}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/graphicx}{graphicx}
+% in order to be able to use |\includegraphics| command:
+% \begin{macrocode}
\RequirePackage{graphicx}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/tikz}{tikz}
+% in order to be able to position elements:
+% \begin{macrocode}
\RequirePackage{tikz}
% \end{macrocode}
-% Then, we process package options:
+% Then, we process package options with the help of \href{https://ctan.org/pkg/pgfopts}{pgfopts}:
% \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.}
% \changes{0.2.0}{2022/10/26}{New package option "nocrop" added to allow disabling of "pdfcrop" execution.}
@@ -540,10 +561,13 @@
% \begin{macro}{\docshots at mdfive}
% \changes{0.1.1}{2022/10/26}{New supplementary command added to calculate MD5 sum of a file.}
-% Then, we define a command for MD5 hash calculating of a file:
+% Then, we define a command for MD5 hash calculating of a file, with
+% the help of \href{https://ctan.org/pkg/pdftexcmds}{pdftexcmds}:
% \begin{macrocode}
\RequirePackage{pdftexcmds}
-\makeatletter\newcommand\docshots at mdfive[1]{\pdf at filemdfivesum{#1}}\makeatother
+\makeatletter
+\newcommand\docshots at mdfive[1]{\pdf at filemdfivesum{#1}}
+\makeatother
% \end{macrocode}
% \end{macro}
@@ -550,7 +574,8 @@
% \begin{macro}{docshot}
% Then, we define |docshot| environment:
% \begin{macrocode}
-\makeatletter\newenvironment{docshot}
+\makeatletter
+\newenvironment{docshot}
{\VerbatimEnvironment\begin{VerbatimOut}
{\docshots at tmpdir/\jobname/verbatim.tex}}
{\end{VerbatimOut}%
@@ -620,26 +645,8 @@
"\docshots at tmpdir/\jobname/\hash.pdf"
"\docshots at tmpdir/\jobname/\hash.crop.pdf"}%
\fi}%
+ \message{docshots: the PDF is ready from line no. \the\inputlineno^^J}%
% \end{macrocode}
-% We configure |fancyvrb|:
-% \begin{macrocode}
- \def\docshots at xopts{
- numbers=left,numbersep=3pt,
- frame=leftline,framerule=.2pt,rulecolor=\color{gray},
- samepage=true,
- commandchars=none,
- baselinestretch=1
- }%
- \ifdefined\docshots at small%
- \edef\docshots at xopts{\unexpanded\expandafter{\docshots at xopts},fontsize=\small}%
- \fi%
- \ifdefined\docshots at tiny%
- \edef\docshots at xopts{\unexpanded\expandafter{\docshots at xopts},fontsize=\scriptsize}%
- \fi%
- \ifdefined\docshots at opts
- \edef\docshots at xopts{\unexpanded\expandafter{\docshots at xopts},\docshots at opts}
- \fi
-% \end{macrocode}
% Finally, we render the two-column content:
% \begin{macrocode}
\begingroup%
@@ -660,8 +667,21 @@
{\docshots at inputminted}
{\docshots at tmpdir/\jobname/\hash.tex}%
\else%
- \expandafter\VerbatimInput\expandafter[\docshots at xopts]
- {\docshots at 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 at small%
+ \fvset{fontsize=\small}%
+ \fi%
+ \ifdefined\docshots at tiny%
+ \fvset{fontsize=\scriptsize}%
+ \fi%
+ \ifdefined\docshots at opts%
+ \fvset{\docshots at opts}%
+ \fi%
+ \VerbatimInput{\docshots at tmpdir/\jobname/\hash.tex}%
\fi\fi%
\vspace{0pt}%
\end{minipage}%
@@ -668,7 +688,8 @@
\par%
\endgroup%
\docshotOptions{}%
-}\makeatother
+}
+\makeatother
% \end{macrocode}
% \end{macro}
@@ -675,11 +696,13 @@
% \begin{macro}{\docshotPrerequisite}
% Then, we define |\docshotPrerequisite| command:
% \begin{macrocode}
-\makeatletter\newcommand\docshotPrerequisite[1]{
+\makeatletter
+\newcommand\docshotPrerequisite[1]{
\iexec[\docshots at log,quiet]{cp #1 "\docshots at tmpdir/\jobname"}%
\message{docshots: File '#1' copied to
'\docshots at tmpdir/\jobname/#1'^^J}%
-}\makeatother
+}
+\makeatother
% \end{macrocode}
% \end{macro}
@@ -686,12 +709,14 @@
% \begin{macro}{\docshotAfter}
% Then, we define |\docshotAfter| command:
% \begin{macrocode}
-\makeatletter\newcommand\docshotAfter[1]{
+\makeatletter
+\newcommand\docshotAfter[1]{
\iexec[\docshots at log,quiet]{/bin/echo -n '\detokenize{#1}'
> "\docshots at tmpdir/\jobname/after.sh"}%
\message{docshots: File
'\docshots at tmpdir/\jobname/after.sh' created^^J}%
-}\makeatother
+}
+\makeatother
% \end{macrocode}
% \end{macro}
@@ -703,7 +728,8 @@
\gdef\docshots at opts{}
\newcommand\docshotOptions[1]{%
\gdef\docshots at opts{#1}%
-}\makeatother
+}
+\makeatother
% \end{macrocode}
% \end{macro}
Modified: trunk/Master/texmf-dist/tex/latex/docshots/docshots.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/docshots/docshots.sty 2024-01-13 21:22:52 UTC (rev 69409)
+++ trunk/Master/texmf-dist/tex/latex/docshots/docshots.sty 2024-01-13 21:23:02 UTC (rev 69410)
@@ -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 at tmpdir/\jobname"}%
\RequirePackage{pdftexcmds}
-\makeatletter\newcommand\docshots at mdfive[1]{\pdf at filemdfivesum{#1}}\makeatother
+\makeatletter
+\newcommand\docshots at mdfive[1]{\pdf at filemdfivesum{#1}}
+\makeatother
-\makeatletter\newenvironment{docshot}
+\makeatletter
+\newenvironment{docshot}
{\VerbatimEnvironment\begin{VerbatimOut}
{\docshots at tmpdir/\jobname/verbatim.tex}}
{\end{VerbatimOut}%
@@ -166,22 +173,7 @@
"\docshots at tmpdir/\jobname/\hash.pdf"
"\docshots at tmpdir/\jobname/\hash.crop.pdf"}%
\fi}%
- \def\docshots at xopts{
- numbers=left,numbersep=3pt,
- frame=leftline,framerule=.2pt,rulecolor=\color{gray},
- samepage=true,
- commandchars=none,
- baselinestretch=1
- }%
- \ifdefined\docshots at small%
- \edef\docshots at xopts{\unexpanded\expandafter{\docshots at xopts},fontsize=\small}%
- \fi%
- \ifdefined\docshots at tiny%
- \edef\docshots at xopts{\unexpanded\expandafter{\docshots at xopts},fontsize=\scriptsize}%
- \fi%
- \ifdefined\docshots at opts
- \edef\docshots at xopts{\unexpanded\expandafter{\docshots at xopts},\docshots at opts}
- \fi
+ \message{docshots: the PDF is ready from line no. \the\inputlineno^^J}%
\begingroup%
\par%
\tikz[baseline=(a.north)]
@@ -200,8 +192,21 @@
{\docshots at inputminted}
{\docshots at tmpdir/\jobname/\hash.tex}%
\else%
- \expandafter\VerbatimInput\expandafter[\docshots at xopts]
- {\docshots at 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 at small%
+ \fvset{fontsize=\small}%
+ \fi%
+ \ifdefined\docshots at tiny%
+ \fvset{fontsize=\scriptsize}%
+ \fi%
+ \ifdefined\docshots at opts%
+ \fvset{\docshots at opts}%
+ \fi%
+ \VerbatimInput{\docshots at tmpdir/\jobname/\hash.tex}%
\fi\fi%
\vspace{0pt}%
\end{minipage}%
@@ -208,26 +213,32 @@
\par%
\endgroup%
\docshotOptions{}%
-}\makeatother
+}
+\makeatother
-\makeatletter\newcommand\docshotPrerequisite[1]{
+\makeatletter
+\newcommand\docshotPrerequisite[1]{
\iexec[\docshots at log,quiet]{cp #1 "\docshots at tmpdir/\jobname"}%
\message{docshots: File '#1' copied to
'\docshots at tmpdir/\jobname/#1'^^J}%
-}\makeatother
+}
+\makeatother
-\makeatletter\newcommand\docshotAfter[1]{
+\makeatletter
+\newcommand\docshotAfter[1]{
\iexec[\docshots at log,quiet]{/bin/echo -n '\detokenize{#1}'
> "\docshots at tmpdir/\jobname/after.sh"}%
\message{docshots: File
'\docshots at tmpdir/\jobname/after.sh' created^^J}%
-}\makeatother
+}
+\makeatother
\makeatletter
\gdef\docshots at opts{}
\newcommand\docshotOptions[1]{%
\gdef\docshots at opts{#1}%
-}\makeatother
+}
+\makeatother
More information about the tex-live-commits
mailing list.