summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ffcode
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-09-08 03:03:50 +0000
committerNorbert Preining <norbert@preining.info>2021-09-08 03:03:50 +0000
commitf8d688cceb9bee2119c4cf3422a85bd60c0e846c (patch)
tree834572e8c0ae9477ded5eb90f59e7379e5171774 /macros/latex/contrib/ffcode
parenta7ef56f18421a8ffb9d34c16ff9f017e45e4e6d3 (diff)
CTAN sync 202109080303
Diffstat (limited to 'macros/latex/contrib/ffcode')
-rw-r--r--macros/latex/contrib/ffcode/DEPENDS.txt1
-rw-r--r--macros/latex/contrib/ffcode/README.md2
-rw-r--r--macros/latex/contrib/ffcode/ffcode.pdfbin108113 -> 118496 bytes
-rw-r--r--macros/latex/contrib/ffcode/ffcode.sty25
-rw-r--r--macros/latex/contrib/ffcode/ffcode.tex40
5 files changed, 58 insertions, 10 deletions
diff --git a/macros/latex/contrib/ffcode/DEPENDS.txt b/macros/latex/contrib/ffcode/DEPENDS.txt
index e1cb6ed564..b7535d747d 100644
--- a/macros/latex/contrib/ffcode/DEPENDS.txt
+++ b/macros/latex/contrib/ffcode/DEPENDS.txt
@@ -1,5 +1,4 @@
hard microtype
hard xkeyval
hard minted
-hard minted
hard tcolorbox
diff --git a/macros/latex/contrib/ffcode/README.md b/macros/latex/contrib/ffcode/README.md
index f6944deee4..13e012d767 100644
--- a/macros/latex/contrib/ffcode/README.md
+++ b/macros/latex/contrib/ffcode/README.md
@@ -1,4 +1,4 @@
-[![make](https://github.com/yegor256/ffcode/actions/workflows/make.yml/badge.svg)](https://github.com/yegor256/ffcode/actions/workflows/make.yml)
+[![make](https://github.com/yegor256/ffcode/actions/workflows/latexmk.yml/badge.svg)](https://github.com/yegor256/ffcode/actions/workflows/latexmk.yml)
[![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
diff --git a/macros/latex/contrib/ffcode/ffcode.pdf b/macros/latex/contrib/ffcode/ffcode.pdf
index 9e84d15f60..d10d38424d 100644
--- a/macros/latex/contrib/ffcode/ffcode.pdf
+++ b/macros/latex/contrib/ffcode/ffcode.pdf
Binary files differ
diff --git a/macros/latex/contrib/ffcode/ffcode.sty b/macros/latex/contrib/ffcode/ffcode.sty
index f478a0b5d6..f4c23b51bb 100644
--- a/macros/latex/contrib/ffcode/ffcode.sty
+++ b/macros/latex/contrib/ffcode/ffcode.sty
@@ -21,7 +21,7 @@
% SOFTWARE.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ffcode}[2021/06/13 0.2.0 Fixed Font Code]
+\ProvidesPackage{ffcode}[2021/09/07 0.3.0 Fixed Font Code]
\RequirePackage{microtype}
\RequirePackage{xkeyval}
@@ -31,6 +31,8 @@
\DeclareOptionX{noframes}{\noframestrue}
\newif\ifnonumbers
\DeclareOptionX{nonumbers}{\nonumberstrue}
+\newif\ifnocn
+\DeclareOptionX{nocn}{\nocntrue}
\ProcessOptionsX\relax
\ifnopygments
@@ -41,22 +43,31 @@
\setminted{breaklines}
\usemintedstyle{bw}
\ifnonumbers
- \newminted[ffcode]{text}{framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline,escapeinside=||,mathescape}
+ \newminted[ffcode]{text}{framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline,escapeinside=||,mathescape,highlightcolor=gray!30}
\else
\renewcommand{\theFancyVerbLine}{\textcolor{gray}{\tiny\oldstylenums{\ttfamily\arabic{FancyVerbLine}}}}
- \newminted[ffcode]{text}{firstnumber=last,linenos,numbersep=2pt,framesep=6pt,framerule=1pt,
- rulecolor=gray,frame=leftline,escapeinside=||,mathescape}
+ \ifnocn
+ \newminted[ffcode]{text}{linenos,numbersep=2pt,framesep=6pt,framerule=1pt,highlightcolor=gray!30,rulecolor=gray,frame=leftline,escapeinside=||,mathescape}
+ \else
+ \newminted[ffcode]{text}{firstnumber=last,linenos,numbersep=2pt,framesep=6pt,framerule=1pt,highlightcolor=gray!30,rulecolor=gray,frame=leftline,escapeinside=||,mathescape}
+ \fi
\fi
+\makeatletter
+\newcommand\ffprint{\begingroup\obeyspaces\@ffprint}
+\newcommand{\@ffprint}[1]{\texttt{#1}\endgroup}
+\makeatother
+
+\newcommand\ffcoderule{\vrule height 6pt depth 1pt width 0pt}
\ifnoframes
- \newcommand{\ff}[1]{\vrule height 6pt depth 1pt width 0pt\texttt{#1}}
+ \newcommand{\ff}[1]{\ffcoderule\ffprint{#1}}
\else
\RequirePackage{tcolorbox}
- \newtcbox{\codebox}{nobeforeafter,colframe=gray!80!white,
+ \newtcbox{\ffcodebox}{nobeforeafter,colframe=gray!80!white,
colback=gray!5!white,boxrule=0.1pt,arc=1pt,
boxsep=1.2pt,left=0.5pt,right=0.5pt,top=0.2pt,bottom=0.2pt,
tcbox raise base}
- \newcommand{\ff}[1]{\codebox{\vrule height 6pt depth 1pt width 0pt\texttt{#1}}}
+ \newcommand{\ff}[1]{\ffcodebox{\ffcoderule\ffprint{#1}}}
\fi
\endinput
diff --git a/macros/latex/contrib/ffcode/ffcode.tex b/macros/latex/contrib/ffcode/ffcode.tex
index e14a39517f..c1fbc40483 100644
--- a/macros/latex/contrib/ffcode/ffcode.tex
+++ b/macros/latex/contrib/ffcode/ffcode.tex
@@ -25,9 +25,10 @@
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{ffcode}
+\usepackage{xcolor}
\title{\ff{ffcode}: \LaTeX{} Package \\ for Fixed-Font Code Blocks}
\author{Yegor Bugayenko}
-\date{0.2.0 2021/06/13}
+\date{0.3.0 2021/09/07}
\begin{document}
\pagenumbering{gobble}
\raggedbottom
@@ -88,6 +89,43 @@ texts, use the package option \ff{noframes}.
To omit the line numbers, use the \ff{nonumbers} option of the package.
+By default, the numbering is continuous: line numbers start at the
+first snippet and increment until the end of the document. If you
+want them to start from one at each snippet, use \ff{nocn}
+(stands for ``no continuous numbering'')
+option of the package.
+
+You can highlight some lines in your \ff{ffcode} environment,
+or can use any other additional configuration parameters from
+the \ff{minted} package:
+
+\begin{multicols}{2}
+\setlength{\parskip}{0pt}
+\scriptsize
+\raggedcolumns
+\begin{verbatim}
+\begin{ffcode*}{highlightlines={1,4-5}}
+while (true) {
+ print("Hello!")
+ print("Enter your name:")
+ scan(x)
+ print("You name is " + x)
+}
+\end{ffcode*}
+\end{verbatim}
+
+\columnbreak
+
+\begin{ffcode*}{highlightlines={7,10-11}}
+while (true) {
+ print("Hello!")
+ print("Enter your name:")
+ scan(x)
+ print("You name is " + x)
+}
+\end{ffcode*}
+\end{multicols}
+
More details about this package you can find
in the \ff{yegor256/ffcode} GitHub repository.