texlive[73274] Master/texmf-dist: ffcode (2jan25)

commits+karl at tug.org commits+karl at tug.org
Thu Jan 2 21:33:38 CET 2025


Revision: 73274
          https://tug.org/svn/texlive?view=revision&revision=73274
Author:   karl
Date:     2025-01-02 21:33:38 +0100 (Thu, 02 Jan 2025)
Log Message:
-----------
ffcode (2jan25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/ffcode/DEPENDS.txt
    trunk/Master/texmf-dist/doc/latex/ffcode/LICENSE.txt
    trunk/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf
    trunk/Master/texmf-dist/source/latex/ffcode/ffcode.dtx
    trunk/Master/texmf-dist/source/latex/ffcode/ffcode.ins
    trunk/Master/texmf-dist/tex/latex/ffcode/ffcode.sty

Modified: trunk/Master/texmf-dist/doc/latex/ffcode/DEPENDS.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ffcode/DEPENDS.txt	2025-01-02 20:33:29 UTC (rev 73273)
+++ trunk/Master/texmf-dist/doc/latex/ffcode/DEPENDS.txt	2025-01-02 20:33:38 UTC (rev 73274)
@@ -1,9 +1,10 @@
 hard listings
 hard pgfopts
 hard tcolorbox
-soft etoolbox
 soft docshots
 soft environ
+soft etoolbox
+soft fvextra
 soft href-ul
 soft hypdoc
 soft iexec
@@ -15,7 +16,7 @@
 soft pgf
 soft pgfopts
 soft scheme-basic
+soft silence
 soft tools
-soft xetex
-soft fvextra
-soft upquote
\ No newline at end of file
+soft upquote
+soft xetex
\ No newline at end of file

Modified: trunk/Master/texmf-dist/doc/latex/ffcode/LICENSE.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ffcode/LICENSE.txt	2025-01-02 20:33:29 UTC (rev 73273)
+++ trunk/Master/texmf-dist/doc/latex/ffcode/LICENSE.txt	2025-01-02 20:33:38 UTC (rev 73274)
@@ -1,6 +1,6 @@
 (The MIT License)
 
-Copyright (c) 2021-2024 Yegor Bugayenko
+Copyright (c) 2021-2025 Yegor Bugayenko
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the 'Software'), to deal

Modified: trunk/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/ffcode/ffcode.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/ffcode/ffcode.dtx	2025-01-02 20:33:29 UTC (rev 73273)
+++ trunk/Master/texmf-dist/source/latex/ffcode/ffcode.dtx	2025-01-02 20:33:38 UTC (rev 73274)
@@ -1,7 +1,7 @@
 % \iffalse meta-comment
 % (The MIT License)
 %
-% Copyright (c) 2021-2024 Yegor Bugayenko
+% Copyright (c) 2021-2025 Yegor Bugayenko
 %
 % Permission is hereby granted, free of charge, to any person obtaining a copy
 % of this software and associated documentation files (the 'Software'), to deal
@@ -50,7 +50,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{ffcode}
 %<*package>
-[2024-03-23 0.9.3 Fixed Font Code]
+[2025/01/02 0.10.0 Fixed Font Code]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
@@ -107,8 +107,17 @@
 % \end{document}
 % \end{docshot}
 
+% \DescribeMacro{\ffinput}
+% There is also |\ffinput| command that reads the content from a file
+% and places it into the document, formatted exactly the same way as
+% it would be, if the |ffcode| environment would be used.
+
 % \section{Package Options}
 
+% \DescribeMacro{samepage}
+% If you want to avoid page breaks inside |ffcode| blocks, use the |samepage|
+% package option.
+
 % \DescribeMacro{noframes}
 % If you want to omit the light gray frames around |\ff|
 % texts, use the package option |noframes|.
@@ -226,6 +235,7 @@
 % \changes{v0.7.0}{2021/11/28}{Package option \texttt{bold} added, to make all \texttt{\char`\\ff} pieces look bolder than usual.}
 % \changes{v0.7.0}{2021/11/28}{Package option \texttt{sf} added, to make all \texttt{\char`\\ff} pieces be printed as \texttt{\char`\\sffamily}.}
 % \changes{v0.9.2}{2024/02/04}{All lengths and sizes are in "em" instead of "pt".}
+% \changes{v0.10.0}{2025/01/02}{Package option \texttt{samepage} added, to keep all \texttt{ffcode} blocks on the same page.}
 %    \begin{macrocode}
 \RequirePackage{pgfopts}
 \pgfkeys{
@@ -232,6 +242,7 @@
   /ff/.cd,
   bold/.store in=\ff at bold,
   sf/.store in=\ff at sf,
+  samepage/.store in=\ff at samepage,
   noframes/.store in=\ff at noframes,
   nonumbers/.store in=\ff at nonumbers,
   nobars/.store in=\ff at nobars,
@@ -241,10 +252,14 @@
 \ProcessPgfPackageOptions{/ff}
 %    \end{macrocode}
 
+% Then, we include the \href{https://ctan.org/pkg/xcolor}{xcolor} package:
+%    \begin{macrocode}
+\RequirePackage{xcolor}
+%    \end{macrocode}
+
 % Then, we configure the \href{https://ctan.org/pkg/listings}{listings} package:
 % \changes{v0.9.0}{2024/01/09}{The \texttt{minted} package is replaced by the \texttt{listings} package.}
 %    \begin{macrocode}
-\RequirePackage{xcolor}
 \RequirePackage{listings}
 \makeatletter
 % See \href{https://tex.stackexchange.com/questions/706858}{the explanation}:
@@ -252,32 +267,54 @@
 \makeatother
 %    \end{macrocode}
 
+% Then, we define a supplementary command \texttt{\char`\\ff at set}:
+%    \begin{macrocode}
+\makeatletter
+\newcommand\ff at set[1]{
+  \lstset{breaklines}
+  \lstset{escapeinside={(*@}{@*)}}
+  \lstset{basicstyle={\ttfamily}}
+  \lstset{columns=fullflexible}
+  \ifdefined\ff at nonumbers\else
+    \lstset{numbers=left,numbersep=.8em,numberstyle={\tiny\sffamily\color{gray}}}
+  \fi
+  \ifdefined\ff at nobars\else
+    \lstset{frame=leftline,framerule=.05em,rulecolor={\color{gray}}}
+  \fi
+  \ifdefined\ff at nocn\else
+    \lstset{firstnumber=last}
+  \fi
+  \lstset{#1}
+}
+\makeatother
+%    \end{macrocode}
+
 % \begin{macro}{ffcode}
 % Then, we define the |ffcode| environment and its supplementary |ffcode*| counterpart:
 %    \begin{macrocode}
 \makeatletter
 \lstnewenvironment{ffcode}[1][]
-  {
-    \lstset{breaklines}
-    \lstset{escapeinside={(*@}{@*)}}
-    \lstset{basicstyle={\ttfamily}}
-    \lstset{columns=fullflexible}
-    \ifdefined\ff at nonumbers\else
-      \lstset{numbers=left,numbersep=.8em,numberstyle={\tiny\sffamily\color{gray}}}
-    \fi
-    \ifdefined\ff at nobars\else
-      \lstset{frame=leftline,framerule=.05em,rulecolor={\color{gray}}}
-    \fi
-    \ifdefined\ff at nocn\else
-      \lstset{firstnumber=last}
-    \fi
-    \lstset{#1}
-  }
-  {}
+  {\ff at set{#1}\ifdefined\ff at samepage\begin{minipage}{\linewidth}\fi}
+  {\ifdefined\ff at samepage\end{minipage}\fi}
 \makeatother
 %    \end{macrocode}
 % \end{macro}
 
+% \begin{macro}{ffcode}
+% Then, we define the \texttt{\char`\\ffinput} command:
+% \changes{v0.10.0}{2024/12/29}{The \texttt{\char`\\ffinput} command added.}
+%    \begin{macrocode}
+\makeatletter
+\newcommand\ffinput[2][]{%
+  \ff at set{#1}%
+  \ifdefined\ff at samepage\begin{minipage}{\linewidth}\fi%
+  \lstinputlisting[#1]{#2}%
+  \ifdefined\ff at samepage\end{minipage}\fi%
+}
+\makeatother
+%    \end{macrocode}
+% \end{macro}
+
 % \begin{macro}{\ff at print}
 % Then, we define a supplementary macro |\ff at print|:
 % \changes{v0.5.1}{2022/10/30}{Now, the command \texttt{ff} ignores italic and bold and always prints \texttt{\char`\\texttt} as it should be.}

Modified: trunk/Master/texmf-dist/source/latex/ffcode/ffcode.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/ffcode/ffcode.ins	2025-01-02 20:33:29 UTC (rev 73273)
+++ trunk/Master/texmf-dist/source/latex/ffcode/ffcode.ins	2025-01-02 20:33:38 UTC (rev 73274)
@@ -1,6 +1,6 @@
 %% (The MIT License)
 %%
-%% Copyright (c) 2021-2024 Yegor Bugayenko
+%% Copyright (c) 2021-2025 Yegor Bugayenko
 %%
 %% Permission is hereby granted, free of charge, to any person obtaining a copy
 %% of this software and associated documentation files (the 'Software'), to deal
@@ -26,7 +26,7 @@
 \preamble
 (The MIT License)
 
-Copyright (c) 2021-2024 Yegor Bugayenko
+Copyright (c) 2021-2025 Yegor Bugayenko
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the 'Software'), to deal

Modified: trunk/Master/texmf-dist/tex/latex/ffcode/ffcode.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/ffcode/ffcode.sty	2025-01-02 20:33:29 UTC (rev 73273)
+++ trunk/Master/texmf-dist/tex/latex/ffcode/ffcode.sty	2025-01-02 20:33:38 UTC (rev 73274)
@@ -7,7 +7,7 @@
 %% ffcode.dtx  (with options: `package')
 %% (The MIT License)
 %% 
-%% Copyright (c) 2021-2024 Yegor Bugayenko
+%% Copyright (c) 2021-2025 Yegor Bugayenko
 %% 
 %% Permission is hereby granted, free of charge, to any person obtaining a copy
 %% of this software and associated documentation files (the 'Software'), to deal
@@ -31,7 +31,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{ffcode}
-[2024-03-23 0.9.3 Fixed Font Code]
+[2025/01/02 0.10.0 Fixed Font Code]
 
 
 
@@ -50,11 +50,14 @@
 
 
 
+
+
 \RequirePackage{pgfopts}
 \pgfkeys{
   /ff/.cd,
   bold/.store in=\ff at bold,
   sf/.store in=\ff at sf,
+  samepage/.store in=\ff at samepage,
   noframes/.store in=\ff at noframes,
   nonumbers/.store in=\ff at nonumbers,
   nobars/.store in=\ff at nobars,
@@ -64,6 +67,7 @@
 \ProcessPgfPackageOptions{/ff}
 
 \RequirePackage{xcolor}
+
 \RequirePackage{listings}
 \makeatletter
 \lst at AddToHook{Init}{\setlength{\lineskip}{0pt}}
@@ -70,27 +74,40 @@
 \makeatother
 
 \makeatletter
+\newcommand\ff at set[1]{
+  \lstset{breaklines}
+  \lstset{escapeinside={(*@}{@*)}}
+  \lstset{basicstyle={\ttfamily}}
+  \lstset{columns=fullflexible}
+  \ifdefined\ff at nonumbers\else
+    \lstset{numbers=left,numbersep=.8em,numberstyle={\tiny\sffamily\color{gray}}}
+  \fi
+  \ifdefined\ff at nobars\else
+    \lstset{frame=leftline,framerule=.05em,rulecolor={\color{gray}}}
+  \fi
+  \ifdefined\ff at nocn\else
+    \lstset{firstnumber=last}
+  \fi
+  \lstset{#1}
+}
+\makeatother
+
+\makeatletter
 \lstnewenvironment{ffcode}[1][]
-  {
-    \lstset{breaklines}
-    \lstset{escapeinside={(*@}{@*)}}
-    \lstset{basicstyle={\ttfamily}}
-    \lstset{columns=fullflexible}
-    \ifdefined\ff at nonumbers\else
-      \lstset{numbers=left,numbersep=.8em,numberstyle={\tiny\sffamily\color{gray}}}
-    \fi
-    \ifdefined\ff at nobars\else
-      \lstset{frame=leftline,framerule=.05em,rulecolor={\color{gray}}}
-    \fi
-    \ifdefined\ff at nocn\else
-      \lstset{firstnumber=last}
-    \fi
-    \lstset{#1}
-  }
-  {}
+  {\ff at set{#1}\ifdefined\ff at samepage\begin{minipage}{\linewidth}\fi}
+  {\ifdefined\ff at samepage\end{minipage}\fi}
 \makeatother
 
 \makeatletter
+\newcommand\ffinput[2][]{%
+  \ff at set{#1}%
+  \ifdefined\ff at samepage\begin{minipage}{\linewidth}\fi%
+  \lstinputlisting[#1]{#2}%
+  \ifdefined\ff at samepage\end{minipage}\fi%
+}
+\makeatother
+
+\makeatletter
 \newcommand\ff at print[1]{%
   \textnormal{%
     \ifdefined\ff at sf\sffamily\else\ttfamily\fi%



More information about the tex-live-commits mailing list.