summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ffcode
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-01-10 03:02:56 +0000
committerNorbert Preining <norbert@preining.info>2022-01-10 03:02:56 +0000
commitd50bfeb7feb32d585a89393c364ef5f9e1b915d0 (patch)
treee6d64ce9f2cb129a6c6d974ebd29251a13cba8d7 /macros/latex/contrib/ffcode
parentfbacb8167ccd172bb0b177974778f228ad41691d (diff)
CTAN sync 202201100302
Diffstat (limited to 'macros/latex/contrib/ffcode')
-rw-r--r--macros/latex/contrib/ffcode/DEPENDS.txt1
-rw-r--r--macros/latex/contrib/ffcode/ffcode.pdfbin186641 -> 187051 bytes
-rw-r--r--macros/latex/contrib/ffcode/ffcode.sty82
-rw-r--r--macros/latex/contrib/ffcode/ffcode.tex7
4 files changed, 58 insertions, 32 deletions
diff --git a/macros/latex/contrib/ffcode/DEPENDS.txt b/macros/latex/contrib/ffcode/DEPENDS.txt
index 935840f850..d86449385c 100644
--- a/macros/latex/contrib/ffcode/DEPENDS.txt
+++ b/macros/latex/contrib/ffcode/DEPENDS.txt
@@ -1,3 +1,2 @@
-hard xkeyval
hard minted
hard tcolorbox
diff --git a/macros/latex/contrib/ffcode/ffcode.pdf b/macros/latex/contrib/ffcode/ffcode.pdf
index 3d6ec820a1..252a4fbb78 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 1c51720636..5ebb6a0fc5 100644
--- a/macros/latex/contrib/ffcode/ffcode.sty
+++ b/macros/latex/contrib/ffcode/ffcode.sty
@@ -1,6 +1,6 @@
% (The MIT License)
%
-% Copyright (c) 2021 Yegor Bugayenko
+% Copyright (c) 2021-2022 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
@@ -21,55 +21,79 @@
% SOFTWARE.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ffcode}[2021/09/13 0.3.2 Fixed Font Code]
-
-\RequirePackage{xkeyval}
+\ProvidesPackage{ffcode}[2022/01/09 0.4.0 Fixed Font Code]
\makeatletter
-\newif\ifffcode@nopygments
-\DeclareOptionX{nopygments}{\ffcode@nopygmentstrue}
-\newif\ifffcode@noframes
-\DeclareOptionX{noframes}{\ffcode@noframestrue}
-\newif\ifffcode@nonumbers
-\DeclareOptionX{nonumbers}{\ffcode@nonumberstrue}
-\newif\ifffcode@nocn
-\DeclareOptionX{nocn}{\ffcode@nocntrue}
+\DeclareOptionX{nopygments}{\PassOptionsToPackage{draft=true}{minted}}
+\newif\ifff@noframes
+\DeclareOptionX{noframes}{\ff@noframestrue}
+\newif\ifff@nobars
+\DeclareOptionX{nobars}{\ff@nobarstrue}
+\newif\ifff@nonumbers
+\DeclareOptionX{nonumbers}{\ff@nonumberstrue}
+\newif\ifff@nocn
+\DeclareOptionX{nocn}{\ff@nocntrue}
\ProcessOptionsX\relax
\makeatother
-\makeatletter\ifffcode@nopygments
- \RequirePackage[draft=true]{minted}
-\else
- \RequirePackage{minted}
-\fi\makeatother
+\RequirePackage{minted}
+
\setminted{breaklines}
\usemintedstyle{bw}
-\makeatletter\ifffcode@nonumbers
- \newminted[ffcode]{text}{framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline,escapeinside=||,mathescape,highlightcolor=gray!30}
+
+\makeatletter\ifff@nonumbers
+ \ifff@nobars
+ \newminted[ffcode]{text}{
+ escapeinside=||,mathescape,highlightcolor=gray!30
+ }
+ \else
+ \newminted[ffcode]{text}{
+ framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline,
+ escapeinside=||,mathescape,highlightcolor=gray!30
+ }
+ \fi
\else
\renewcommand{\theFancyVerbLine}{\textcolor{gray}{\tiny\oldstylenums{\ttfamily\arabic{FancyVerbLine}}}}
- \ifffcode@nocn
- \newminted[ffcode]{text}{linenos,numbersep=2pt,framesep=6pt,framerule=1pt,highlightcolor=gray!30,rulecolor=gray,frame=leftline,escapeinside=||,mathescape}
+ \ifff@nocn
+ \ifff@nobars
+ \newminted[ffcode]{text}{
+ linenos,numbersep=2pt,highlightcolor=gray!30,escapeinside=||,mathescape
+ }
+ \else
+ \newminted[ffcode]{text}{
+ framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline,
+ linenos,numbersep=2pt,highlightcolor=gray!30,escapeinside=||,mathescape
+ }
+ \fi
\else
- \newminted[ffcode]{text}{firstnumber=last,linenos,numbersep=2pt,framesep=6pt,framerule=1pt,highlightcolor=gray!30,rulecolor=gray,frame=leftline,escapeinside=||,mathescape}
+ \ifff@nobars
+ \newminted[ffcode]{text}{
+ firstnumber=last,linenos,numbersep=2pt,highlightcolor=gray!30,escapeinside=||,mathescape
+ }
+ \else
+ \newminted[ffcode]{text}{
+ framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline,
+ firstnumber=last,linenos,numbersep=2pt,highlightcolor=gray!30,escapeinside=||,mathescape
+ }
+ \fi
\fi
\fi\makeatother
\makeatletter
-\newcommand\ffcode@print{\begingroup\obeyspaces\ffcode@printx}
-\newcommand\ffcode@printx[1]{\texttt{#1}\endgroup}
+\newcommand\ff@print{\begingroup\obeyspaces\ff@printx}
+\newcommand\ff@printx[1]{\texttt{#1}\endgroup}
\makeatother
-\makeatletter\newcommand\ffcode@rule{\vrule height 6pt depth 1pt width 0pt}
-\makeatletter\ifffcode@noframes
- \newcommand\ff[1]{\ffcode@rule\ffcode@print{#1}}
+\makeatletter\newcommand\ff@rule{\vrule height 6pt depth 1pt width 0pt}
+\makeatletter\ifff@noframes
+ \newcommand\ff[1]{\ff@rule\ff@print{#1}}
\else
\RequirePackage{tcolorbox}
- \newtcbox\ffcode@box{nobeforeafter,colframe=gray!80!white,
+ \newtcbox\ff@box{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]{\ffcode@box{\ffcode@rule\ffcode@print{#1}}}
+ \newcommand\ff[1]{\ff@box{\ff@rule\ff@print{#1}}}
\fi\makeatother
\endinput
diff --git a/macros/latex/contrib/ffcode/ffcode.tex b/macros/latex/contrib/ffcode/ffcode.tex
index df15670be0..b90ab7a411 100644
--- a/macros/latex/contrib/ffcode/ffcode.tex
+++ b/macros/latex/contrib/ffcode/ffcode.tex
@@ -1,6 +1,6 @@
% (The MIT License)
%
-% Copyright (c) 2021 Yegor Bugayenko
+% Copyright (c) 2021-2022 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
@@ -30,7 +30,7 @@
\usepackage{microtype}
\title{\ff{ffcode}: \LaTeX{} Package \\ for Fixed-Font Code Blocks}
\author{Yegor Bugayenko}
-\date{0.3.2 2021/09/13}
+\date{0.4.0 2022/01/09}
\begin{document}
\pagenumbering{gobble}
\raggedbottom
@@ -94,6 +94,9 @@ If you want to print a single vertical line, use this:
If you want to omit the light gray frames around \ff{\char`\\ff}
texts, use the package option \ff{noframes}.
+To omit the vertical gray bar at the left side of each snippet,
+use the \ff{nobars} option of the package.
+
To omit the line numbers, use the \ff{nonumbers} option of the package.
By default, the numbering is continuous: line numbers start at the