From cb174a113ff3add270e32f9f848c608d3695f630 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 9 Jan 2022 21:19:22 +0000 Subject: ffcode (9jan22) git-svn-id: svn://tug.org/texlive/trunk@61550 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/ffcode/DEPENDS.txt | 1 - Master/texmf-dist/doc/latex/ffcode/ffcode.pdf | Bin 186641 -> 187051 bytes Master/texmf-dist/doc/latex/ffcode/ffcode.tex | 7 ++- Master/texmf-dist/tex/latex/ffcode/ffcode.sty | 82 ++++++++++++++++--------- 4 files changed, 58 insertions(+), 32 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/ffcode/DEPENDS.txt b/Master/texmf-dist/doc/latex/ffcode/DEPENDS.txt index 935840f8502..d86449385ce 100644 --- a/Master/texmf-dist/doc/latex/ffcode/DEPENDS.txt +++ b/Master/texmf-dist/doc/latex/ffcode/DEPENDS.txt @@ -1,3 +1,2 @@ -hard xkeyval hard minted hard tcolorbox diff --git a/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf b/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf index 3d6ec820a1f..252a4fbb78b 100644 Binary files a/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf and b/Master/texmf-dist/doc/latex/ffcode/ffcode.pdf differ diff --git a/Master/texmf-dist/doc/latex/ffcode/ffcode.tex b/Master/texmf-dist/doc/latex/ffcode/ffcode.tex index df15670be00..b90ab7a411b 100644 --- a/Master/texmf-dist/doc/latex/ffcode/ffcode.tex +++ b/Master/texmf-dist/doc/latex/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 diff --git a/Master/texmf-dist/tex/latex/ffcode/ffcode.sty b/Master/texmf-dist/tex/latex/ffcode/ffcode.sty index 1c51720636c..5ebb6a0fc5d 100644 --- a/Master/texmf-dist/tex/latex/ffcode/ffcode.sty +++ b/Master/texmf-dist/tex/latex/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 -- cgit v1.2.3