diff options
author | Norbert Preining <norbert@preining.info> | 2022-11-29 03:01:10 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-11-29 03:01:10 +0000 |
commit | d3420ed49446361fef055ad7f989ff41ce7362b6 (patch) | |
tree | b3812509ff2e55f916ddd82001b071a62f598e7b /macros/latex/contrib/ffcode | |
parent | d215ba492183a22167b7cdf9900899ab51f7dda6 (diff) |
CTAN sync 202211290301
Diffstat (limited to 'macros/latex/contrib/ffcode')
-rw-r--r-- | macros/latex/contrib/ffcode/ffcode.dtx | 48 | ||||
-rw-r--r-- | macros/latex/contrib/ffcode/ffcode.pdf | bin | 493615 -> 574021 bytes |
2 files changed, 45 insertions, 3 deletions
diff --git a/macros/latex/contrib/ffcode/ffcode.dtx b/macros/latex/contrib/ffcode/ffcode.dtx index e50bb899eb..2107516f3e 100644 --- a/macros/latex/contrib/ffcode/ffcode.dtx +++ b/macros/latex/contrib/ffcode/ffcode.dtx @@ -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@bold, + sf/.store in=\ff@sf, nopygments/.store in=\ff@nopygments, noframes/.store in=\ff@noframes, nonumbers/.store in=\ff@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@print[1]{\textnormal{\texttt{#1}}} +\newcommand\ff@print[1]{% + \textnormal{% + \ifdefined\ff@sf\sffamily\else\ttfamily\fi% + \ifdefined\ff@bold\fontseries{b}\selectfont\fi% + #1% + }% +} \makeatother % \end{macrocode} % \end{macro} diff --git a/macros/latex/contrib/ffcode/ffcode.pdf b/macros/latex/contrib/ffcode/ffcode.pdf Binary files differindex f87101ad3f..b2a318eb0d 100644 --- a/macros/latex/contrib/ffcode/ffcode.pdf +++ b/macros/latex/contrib/ffcode/ffcode.pdf |