summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ffcode
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-01-11 03:01:30 +0000
committerNorbert Preining <norbert@preining.info>2024-01-11 03:01:30 +0000
commitb14090c9f3c7797e26fed9eb2b83ce144dcb16a3 (patch)
tree95ddb409d32efce7b7e9c8353ccdbe648b86ae1f /macros/latex/contrib/ffcode
parentcdb8117b8f1ac752d1927b82759c5be9f0ec0ab5 (diff)
CTAN sync 202401110301
Diffstat (limited to 'macros/latex/contrib/ffcode')
-rw-r--r--macros/latex/contrib/ffcode/DEPENDS.txt19
-rw-r--r--macros/latex/contrib/ffcode/LICENSE.txt2
-rw-r--r--macros/latex/contrib/ffcode/README.md4
-rw-r--r--macros/latex/contrib/ffcode/ffcode.dtx95
-rw-r--r--macros/latex/contrib/ffcode/ffcode.ins4
-rw-r--r--macros/latex/contrib/ffcode/ffcode.pdfbin574072 -> 514867 bytes
6 files changed, 54 insertions, 70 deletions
diff --git a/macros/latex/contrib/ffcode/DEPENDS.txt b/macros/latex/contrib/ffcode/DEPENDS.txt
index d55ae167dd..2b69ddd2b9 100644
--- a/macros/latex/contrib/ffcode/DEPENDS.txt
+++ b/macros/latex/contrib/ffcode/DEPENDS.txt
@@ -1,3 +1,20 @@
+hard listings
hard pgfopts
-hard minted
hard tcolorbox
+soft docshots
+soft environ
+soft href-ul
+soft hypdoc
+soft iexec
+soft l3build
+soft libertine
+soft mathtools
+soft microtype
+soft pdfcrop
+soft pgf
+soft pgfopts
+soft scheme-basic
+soft tools
+soft xetex
+soft fvextra
+soft upquote \ No newline at end of file
diff --git a/macros/latex/contrib/ffcode/LICENSE.txt b/macros/latex/contrib/ffcode/LICENSE.txt
index bd949ffdab..1f211e0287 100644
--- a/macros/latex/contrib/ffcode/LICENSE.txt
+++ b/macros/latex/contrib/ffcode/LICENSE.txt
@@ -1,6 +1,6 @@
(The MIT License)
-Copyright (c) 2021-2022 Yegor Bugayenko
+Copyright (c) 2021-2024 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
diff --git a/macros/latex/contrib/ffcode/README.md b/macros/latex/contrib/ffcode/README.md
index f62fa0aa99..36252a3dfa 100644
--- a/macros/latex/contrib/ffcode/README.md
+++ b/macros/latex/contrib/ffcode/README.md
@@ -3,7 +3,7 @@
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/ffcode/blob/master/LICENSE.txt)
This LaTeX package helps you write source code in your academic papers
-and make sure it looks neat. The package uses [`minted`](https://ctan.org/pkg/minted)
+and make sure it looks neat. The package uses [`listings`](https://ctan.org/pkg/listings)
and [`tcolorbox`](https://ctan.org/pkg/tcolorbox) packages.
First, [install it](https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages)
@@ -23,7 +23,7 @@ void r() {
\end{document}
```
-Otherwise, you can download [`ffcode.sty`](https://raw.githubusercontent.com/yegor256/ffcode/gh-pages/ffcode/ffcode.sty) and add to your project.
+Otherwise, you can download [`ffcode.sty`](https://yegor256.github.io/ffcode/ffcode.sty) and add to your project.
If you want to contribute yourself, make a fork, then create a branch,
then run `l3build ctan` in the root directory.
diff --git a/macros/latex/contrib/ffcode/ffcode.dtx b/macros/latex/contrib/ffcode/ffcode.dtx
index e8c71aa8ed..ffd57f6d02 100644
--- a/macros/latex/contrib/ffcode/ffcode.dtx
+++ b/macros/latex/contrib/ffcode/ffcode.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
% (The MIT License)
%
-% Copyright (c) 2021-2022 Yegor Bugayenko
+% Copyright (c) 2021-2024 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>
-[2022-12-02 0.8.0 Fixed Font Code]
+[2024-01-10 0.9.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);
% }
@@ -109,12 +109,6 @@
% \section{Package Options}
-% \DescribeMacro{nopygments}
-% You have to run |pdflatex| with |--shell-escape| flag
-% in order to let |minted| (the package we use) to run Pygments
-% and format the code. If you don't want this to happen,
-% just use |nopygments| option.
-
% \DescribeMacro{noframes}
% If you want to omit the light gray frames around |\ff|
% texts, use the package option |noframes|.
@@ -194,7 +188,7 @@
% You can highlight some lines in your |ffcode| environment,
% or can use any other additional configuration parameters from
-% |minted| package:
+% |fancyvrb| and |fvextra| packages:
% \docshotOptions{firstline=6,lastline=13}
% \begin{docshot}
% \documentclass{article}
@@ -202,19 +196,19 @@
% \usepackage{ffcode}
% \pagestyle{empty}
% \begin{document}
-% \begin{ffcode*}{highlightlines={1,4-5}}
+% \begin{ffcode}[backgroundcolor=\color{gray!20}]
% while (true) {
-% print("Hello!")
+% (*@\textcolor{red}{print("Hi!")}@*)
% print("Enter your name:")
% scan(x)
-% print("You name is " + x)
+% print("You name | " + x)
% }
-% \end{ffcode*}
+% \end{ffcode}
% \end{document}
% \end{docshot}
-% Using this second argument of |ffcode*| (with the trailing asterisk),
-% you can provide any other options from |minted| package to the
+% Using this second argument of |ffcode|,
+% you can provide any other options from the |listings| package to the
% snippet.
% \StopEventually{}
@@ -237,7 +231,6 @@
/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,
nobars/.store in=\ff@nobars,
@@ -247,59 +240,33 @@
\ProcessPgfPackageOptions{/ff}
% \end{macrocode}
-% Then, we disable pygments for \href{https://ctan.org/pkg/minted}{minted}, if necessary:
-% \begin{macrocode}
-\makeatletter\ifdefined\ff@nopygments
- \PassOptionsToPackage{draft=true}{minted}
-\fi\makeatother
-% \end{macrocode}
-
-% Then, we configure \href{https://ctan.org/pkg/minted}{minted} package:
+% 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{minted}
-\setminted{breaklines}
-\setminted{escapeinside=||,mathescape}
-\setminted{highlightcolor=gray!25}
-\usemintedstyle{bw}
+\RequirePackage{xcolor}
+\RequirePackage{listings}
% \end{macrocode}
% \begin{macro}{ffcode}
-% Then, we define |ffcode| environment:
+% Then, we define the |ffcode| environment and its supplementary |ffcode*| counterpart:
% \begin{macrocode}
-\makeatletter\ifdefined\ff@nonumbers
- \ifdefined\ff@nobars
- \newminted[ffcode]{text}{}
- \else
- \newminted[ffcode]{text}{framesep=6pt,
- framerule=1pt,rulecolor=gray,frame=leftline}
- \fi
-\else
- \renewcommand{\theFancyVerbLine}{\textcolor{gray}%
- {\tiny\oldstylenums{\ttfamily\arabic{FancyVerbLine}}}}
- \ifdefined\ff@nocn
- \ifdefined\ff@nobars
- \newminted[ffcode]{text}{
- linenos,numbersep=2pt
- }
- \else
- \newminted[ffcode]{text}{
- framesep=6pt,framerule=1pt,rulecolor=gray,
- frame=leftline,linenos,numbersep=2pt
- }
- \fi
- \else
- \ifdefined\ff@nobars
- \newminted[ffcode]{text}{
- firstnumber=last,linenos,numbersep=2pt
- }
- \else
- \newminted[ffcode]{text}{
- framesep=6pt,framerule=1pt,rulecolor=gray,
- frame=leftline,firstnumber=last,linenos,numbersep=2pt
- }
+\makeatletter
+\lstnewenvironment{ffcode}[1][]
+ {
+ \lstset{breaklines}
+ \lstset{escapeinside={(*@}{@*)}}
+ \lstset{basicstyle={\ttfamily}}
+ \lstset{columns=fullflexible}
+ \ifdefined\ff@nonumbers\else
+ \lstset{numbers=left,numbersep=5pt,numberstyle={\tiny\sffamily\color{gray}}}
\fi
- \fi
-\fi\makeatother
+ \ifdefined\ff@nobars\else
+ \lstset{frame=leftline,framerule=.3pt,rulecolor={\color{gray}}}
+ \ifdefined\ff@nocn\else\fi
+ \lstset{#1}
+ }
+ {}
+\makeatother
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/ffcode/ffcode.ins b/macros/latex/contrib/ffcode/ffcode.ins
index 9e7c56593e..4e64b55d73 100644
--- a/macros/latex/contrib/ffcode/ffcode.ins
+++ b/macros/latex/contrib/ffcode/ffcode.ins
@@ -1,6 +1,6 @@
%% (The MIT License)
%%
-%% Copyright (c) 2021-2022 Yegor Bugayenko
+%% Copyright (c) 2021-2024 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-2022 Yegor Bugayenko
+Copyright (c) 2021-2024 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
diff --git a/macros/latex/contrib/ffcode/ffcode.pdf b/macros/latex/contrib/ffcode/ffcode.pdf
index 81e04f3bf7..5729a423d3 100644
--- a/macros/latex/contrib/ffcode/ffcode.pdf
+++ b/macros/latex/contrib/ffcode/ffcode.pdf
Binary files differ