texlive[65132] Master/texmf-dist: ffcode (28nov22)
commits+karl at tug.org
commits+karl at tug.org
Mon Nov 28 22:00:08 CET 2022
Revision: 65132
http://tug.org/svn/texlive?view=revision&revision=65132
Author: karl
Date: 2022-11-28 22:00:08 +0100 (Mon, 28 Nov 2022)
Log Message:
-----------
ffcode (28nov22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf
trunk/Master/texmf-dist/source/latex/ffcode/ffcode.dtx
trunk/Master/texmf-dist/tex/latex/ffcode/ffcode.sty
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 2022-11-28 20:59:47 UTC (rev 65131)
+++ trunk/Master/texmf-dist/source/latex/ffcode/ffcode.dtx 2022-11-28 21:00:08 UTC (rev 65132)
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{ffcode}
%<*package>
-[2022-11-16 0.6.0 Fixed Font Code]
+[2022-11-28 0.7.0 Fixed Font Code]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -97,7 +97,7 @@
% \begin{ffcode}
% int fibo(int n) {
% if (n < 2) {
-% return n; |$\label{ln:ret}$|
+% return n; |\label{ln:ret}|
% }
% return fibo(n-1)+fibo(n-2);
% }
@@ -133,6 +133,38 @@
% (stands for ``no continuous numbering'')
% option of the package.
+% \DescribeMacro{bold}
+% You can make your |\ff| pieces look bolder than usual, which may be pretty convenient for some document classes
+% (pay attention to the usage of the \href{https://ctan.org/pkg/lmodern}{lmodern} package, without it the bold won't work, as explained \href{https://tex.stackexchange.com/a/215489/1449}{here}):
+% \docshotOptions{firstline=4,lastline=10}
+% \begin{docshot}
+% \documentclass{article}
+% \usepackage[paperwidth=3in]{geometry}
+% \pagestyle{empty}
+% \usepackage{lmodern}
+% \usepackage[bold,noframes]{ffcode}
+% \begin{document}
+% Sometimes it's necessary to make
+% code pieces look bolder, like
+% the |fibo()| function in this text.
+% \end{document}
+% \end{docshot}
+
+% \DescribeMacro{sf}
+% You can change the font family of |\ff| pieces to |\sffamily|:
+% \docshotOptions{firstline=4,lastline=9}
+% \begin{docshot}
+% \documentclass{article}
+% \usepackage[paperwidth=3in]{geometry}
+% \pagestyle{empty}
+% \usepackage[sf,bold,noframes]{ffcode}
+% \begin{document}
+% Sometimes you may want them to look
+% not strictly fixed-width, but more
+% elegant, like the |fibo()| here.
+% \end{document}
+% \end{docshot}
+
% \section{Typesetting}
% By the way, the package correctly formats low-height texts, for example, just
@@ -196,10 +228,14 @@
% \changes{v0.4.0}{2022/01/09}{Package option \texttt{nobars} added.}
% \changes{v0.6.0}{2021/11/14}{We use \texttt{pgfopts} instead of \texttt{xkeyval}.}
% \changes{v0.6.0}{2021/11/14}{Package option \texttt{novert} added, to disable redefinition of vertical bar.}
+% \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}.}
% \begin{macrocode}
\RequirePackage{pgfopts}
\pgfkeys{
/ff/.cd,
+ bold/.store in=\ff at bold,
+ sf/.store in=\ff at sf,
nopygments/.store in=\ff at nopygments,
noframes/.store in=\ff at noframes,
nonumbers/.store in=\ff at nonumbers,
@@ -271,7 +307,13 @@
% \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.}
% \begin{macrocode}
\makeatletter
-\newcommand\ff at print[1]{\textnormal{\texttt{#1}}}
+\newcommand\ff at print[1]{%
+ \textnormal{%
+ \ifdefined\ff at sf\sffamily\else\ttfamily\fi%
+ \ifdefined\ff at bold\fontseries{b}\selectfont\fi%
+ #1%
+ }%
+}
\makeatother
% \end{macrocode}
% \end{macro}
Modified: trunk/Master/texmf-dist/tex/latex/ffcode/ffcode.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/ffcode/ffcode.sty 2022-11-28 20:59:47 UTC (rev 65131)
+++ trunk/Master/texmf-dist/tex/latex/ffcode/ffcode.sty 2022-11-28 21:00:08 UTC (rev 65132)
@@ -31,7 +31,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ffcode}
-[2022-11-16 0.6.0 Fixed Font Code]
+[2022-11-28 0.7.0 Fixed Font Code]
@@ -49,9 +49,13 @@
+
+
\RequirePackage{pgfopts}
\pgfkeys{
/ff/.cd,
+ bold/.store in=\ff at bold,
+ sf/.store in=\ff at sf,
nopygments/.store in=\ff at nopygments,
noframes/.store in=\ff at noframes,
nonumbers/.store in=\ff at nonumbers,
@@ -107,7 +111,13 @@
\fi\makeatother
\makeatletter
-\newcommand\ff at print[1]{\textnormal{\texttt{#1}}}
+\newcommand\ff at print[1]{%
+ \textnormal{%
+ \ifdefined\ff at sf\sffamily\else\ttfamily\fi%
+ \ifdefined\ff at bold\fontseries{b}\selectfont\fi%
+ #1%
+ }%
+}
\makeatother
\makeatletter\newcommand\ff at rule
More information about the tex-live-commits
mailing list.