Skip to content

Commit

Permalink
#4 added AT sign
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Sep 13, 2021
1 parent f1b1f5b commit b803593
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ zip: ffcode.pdf ffcode.sty
cat ffcode.sty | grep RequirePackage | gsed -e "s/.*{\(.\+\)}.*/hard \1/" | uniq > DEPENDS.txt
cd ..
zip -r ffcode.zip *
cp ffcode.zip ..
cp ffcode.zip ../ffcode-$${version}.zip
cd ..

clean:
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.3.1
46 changes: 23 additions & 23 deletions ffcode.sty
Original file line number Diff line number Diff line change
Expand Up @@ -23,51 +23,51 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ffcode}[00.00.0000 0.0.0 Fixed Font Code]

\RequirePackage{microtype}
\RequirePackage{xkeyval}
\newif\ifnopygments
\DeclareOptionX{nopygments}{\nopygmentstrue}
\newif\ifnoframes
\DeclareOptionX{noframes}{\noframestrue}
\newif\ifnonumbers
\DeclareOptionX{nonumbers}{\nonumberstrue}
\newif\ifnocn
\DeclareOptionX{nocn}{\nocntrue}
\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}
\ProcessOptionsX\relax
\makeatother

\ifnopygments
\makeatletter\ifffcode@nopygments
\RequirePackage[draft=true]{minted}
\else
\RequirePackage{minted}
\fi
\fi\makeatother
\setminted{breaklines}
\usemintedstyle{bw}
\ifnonumbers
\makeatletter\ifffcode@nonumbers
\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}}}}
\ifnocn
\ifffcode@nocn
\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
\fi\makeatother

\makeatletter
\newcommand\ffprint{\begingroup\obeyspaces\@ffprint}
\newcommand{\@ffprint}[1]{\texttt{#1}\endgroup}
\newcommand\ffcode@print{\begingroup\obeyspaces\ffcode@printx}
\newcommand\ffcode@printx[1]{\texttt{#1}\endgroup}
\makeatother

\newcommand\ffcoderule{\vrule height 6pt depth 1pt width 0pt}
\ifnoframes
\newcommand{\ff}[1]{\ffcoderule\ffprint{#1}}
\makeatletter\newcommand\ffcode@rule{\vrule height 6pt depth 1pt width 0pt}
\makeatletter\ifffcode@noframes
\newcommand\ff[1]{\ffcode@rule\ffcode@print{#1}}
\else
\RequirePackage{tcolorbox}
\newtcbox{\ffcodebox}{nobeforeafter,colframe=gray!80!white,
\newtcbox\ffcode@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]{\ffcodebox{\ffcoderule\ffprint{#1}}}
\fi
\newcommand\ff[1]{\ffcode@box{\ffcode@rule\ffcode@print{#1}}}
\fi\makeatother

\endinput
5 changes: 5 additions & 0 deletions ffcode.tex
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
\usepackage{multicol}
\usepackage{ffcode}
\usepackage{xcolor}
\usepackage{microtype}
\title{\ff{ffcode}: \LaTeX{} Package \\ for Fixed-Font Code Blocks}
\author{Yegor Bugayenko}
\date{0.0.0 00.00.0000}
Expand Down Expand Up @@ -126,6 +127,10 @@
\end{ffcode*}
\end{multicols}

Using this second argument of the \ff{ffcode*} (with the trailing asterisk),
you can provide any other options from the \ff{minted} package to the
snippet.

More details about this package you can find
in the \ff{yegor256/ffcode} GitHub repository.

Expand Down

0 comments on commit b803593

Please sign in to comment.