diff options
author | Karl Berry <karl@freefriends.org> | 2021-06-13 20:52:33 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-06-13 20:52:33 +0000 |
commit | 98a3912fa30a03be821fdc4070c334076b60aec6 (patch) | |
tree | b3548b606cd725f17a6c7585042810fd7c276442 /Master | |
parent | 21d9740662bb842065bf5fd589897fd2ee575749 (diff) |
ffcode (13jun21)
git-svn-id: svn://tug.org/texlive/trunk@59578 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/ffcode/README.md | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/ffcode/ffcode.pdf | bin | 107272 -> 108113 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/ffcode/ffcode.tex | 21 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/ffcode/ffcode.sty | 32 |
4 files changed, 37 insertions, 19 deletions
diff --git a/Master/texmf-dist/doc/latex/ffcode/README.md b/Master/texmf-dist/doc/latex/ffcode/README.md index 1c95d6ece31..f6944deee4c 100644 --- a/Master/texmf-dist/doc/latex/ffcode/README.md +++ b/Master/texmf-dist/doc/latex/ffcode/README.md @@ -2,7 +2,8 @@ [![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. +and make sure it looks neat. The package uses [`minted`](https://ctan.org/pkg/minted) +and [`tcolorbox`](https://ctan.org/pkg/tcolorbox) packages. First, [install it](https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages) from [CTAN](https://ctan.org/pkg/ffcode) diff --git a/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf b/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf Binary files differindex ee829bd0373..9e84d15f609 100644 --- a/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf +++ b/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf diff --git a/Master/texmf-dist/doc/latex/ffcode/ffcode.tex b/Master/texmf-dist/doc/latex/ffcode/ffcode.tex index dcefc532682..e14a39517f0 100644 --- a/Master/texmf-dist/doc/latex/ffcode/ffcode.tex +++ b/Master/texmf-dist/doc/latex/ffcode/ffcode.tex @@ -27,11 +27,10 @@ \usepackage{ffcode} \title{\ff{ffcode}: \LaTeX{} Package \\ for Fixed-Font Code Blocks} \author{Yegor Bugayenko} -\date{0.1.0 2021/06/10} +\date{0.2.0 2021/06/13} \begin{document} \pagenumbering{gobble} \raggedbottom -\setlength{\topskip}{0mm} \setlength{\parindent}{0pt} \setlength{\columnsep}{32pt} \setlength{\parskip}{6pt} @@ -46,12 +45,13 @@ and the \ff{ffcode} environment): \setlength{\parskip}{0pt} \scriptsize \raggedcolumns -\begin{verbatim}\documentclass{article} +\begin{verbatim} +\documentclass{article} \usepackage{ffcode} \begin{document} The function \ff{fibo()} is recursive: \begin{ffcode} -void fibo(int n) { +int fibo(int n) { if (n < 2) { return n; |$\label{ln:ret}$| } @@ -67,15 +67,15 @@ The line~\ref{ln:ret} terminates it. The function \ff{fibo()} is recursive: \begin{ffcode} -void fibo(int n) { - if (n < 2) { |$\label{ln:ret}$| - return n; +int fibo(int n) { + if (n < 2) { + return n; |$\label{ln:ret}$| } return fibo(n - 1) + fibo(n - 2); } \end{ffcode} -The line~\ref{ln:ret} terminates it. +The line no.~\ref{ln:ret} terminates it. \end{multicols} You have to run \ff{pdflatex} with the \ff{--shell-escape} flag @@ -83,6 +83,11 @@ in order to let \ff{minted} (the package we use) to run Pygments and format the code. If you don't want this to happen, just use the \ff{nopygments} option. +If you want to omit the light gray frames around \ff{\char`\\ff} +texts, use the package option \ff{noframes}. + +To omit the line numbers, use the \ff{nonumbers} option of the package. + More details about this package you can find in the \ff{yegor256/ffcode} GitHub repository. diff --git a/Master/texmf-dist/tex/latex/ffcode/ffcode.sty b/Master/texmf-dist/tex/latex/ffcode/ffcode.sty index 280bc58bd8d..f478a0b5d6e 100644 --- a/Master/texmf-dist/tex/latex/ffcode/ffcode.sty +++ b/Master/texmf-dist/tex/latex/ffcode/ffcode.sty @@ -21,12 +21,16 @@ % SOFTWARE. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ffcode}[2021/06/10 0.1.0 Fixed Font Code] +\ProvidesPackage{ffcode}[2021/06/13 0.2.0 Fixed Font Code] \RequirePackage{microtype} \RequirePackage{xkeyval} \newif\ifnopygments \DeclareOptionX{nopygments}{\nopygmentstrue} +\newif\ifnoframes +\DeclareOptionX{noframes}{\noframestrue} +\newif\ifnonumbers +\DeclareOptionX{nonumbers}{\nonumberstrue} \ProcessOptionsX\relax \ifnopygments @@ -36,15 +40,23 @@ \fi \setminted{breaklines} \usemintedstyle{bw} -\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} +\ifnonumbers + \newminted[ffcode]{text}{framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline,escapeinside=||,mathescape} +\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} +\fi -\RequirePackage{tcolorbox} - \newtcbox{\codebox}{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}}} +\ifnoframes + \newcommand{\ff}[1]{\vrule height 6pt depth 1pt width 0pt\texttt{#1}} +\else + \RequirePackage{tcolorbox} + \newtcbox{\codebox}{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}}} +\fi \endinput |