From 3d5c623905faf0dd0ffd2e2399036362e2121bf3 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Tue, 7 Sep 2021 07:48:33 +0300 Subject: [PATCH] #2 obey spaces --- VERSION.txt | 2 +- ffcode.sty | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 341cf11..7dff5b8 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.2.0 \ No newline at end of file +0.2.1 \ No newline at end of file diff --git a/ffcode.sty b/ffcode.sty index 20d6334..f953972 100644 --- a/ffcode.sty +++ b/ffcode.sty @@ -48,16 +48,21 @@ rulecolor=gray,frame=leftline,escapeinside=||,mathescape} \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]{\ffcoderule\texttt{#1}} + \newcommand{\ff}[1]{\ffcoderule\ffprint{#1}} \else \RequirePackage{tcolorbox} \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]{\ffcodebox{\ffcoderule\texttt{#1}}} + \newcommand{\ff}[1]{\ffcodebox{\ffcoderule\ffprint{#1}}} \fi \endinput