Skip to content

Commit

Permalink
#19 normal \ff, not verbatim
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 2, 2022
1 parent 34ce24d commit 831e724
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
25 changes: 13 additions & 12 deletions ffcode.dtx
Expand Up @@ -152,7 +152,7 @@

% \DescribeMacro{sf}
% You can change the font family of |\ff| pieces to |\sffamily|:
% \docshotOptions{firstline=4,lastline=9}
% \docshotOptions{firstline=4,lastline=10}
% \begin{docshot}
% \documentclass{article}
% \usepackage[paperwidth=3in]{geometry}
Expand All @@ -161,7 +161,8 @@
% \begin{document}
% Sometimes you may want them to look
% not strictly fixed-width, but more
% elegant, like the |fibo()| here.
% elegant, like the \emph{|fibo()|}
% here.
% \end{document}
% \end{docshot}

Expand Down Expand Up @@ -347,7 +348,16 @@
% Then, we define |\ff@x| internal command for printing a piece of fixed-width-font text:
% \begin{macrocode}
\makeatletter
\NewDocumentCommand\ff@x{v}{%
\NewDocumentCommand\ff@x{v}{\ff{#1}}
\makeatother
% \end{macrocode}
% \end{macro}

% \begin{macro}{\ff}
% Then, we define |\ff| macro:
% \begin{macrocode}
\makeatletter
\newcommand\ff[1]{%
\ifdefined\ff@noframes%
\ff@rule\ff@print{#1}%
\else%
Expand All @@ -362,15 +372,6 @@
% \end{macrocode}
% \end{macro}

% \begin{macro}{\ff}
% Then, we define |\ff| macro:
% \begin{macrocode}
\makeatletter
\def\ff{\ff@x}
\makeatother
% \end{macrocode}
% \end{macro}

% \begin{macro}{novert}
% Finally, we let vertical bars work similar to |\ff|, as suggested
% \href{https://tex.stackexchange.com/a/665105/1449}{here}
Expand Down
5 changes: 5 additions & 0 deletions testfiles/simple.luatex.tlg
Expand Up @@ -14,3 +14,8 @@ LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line ....
)
LaTeX Warning: Reference `ln:ret' on page 1 undefined on input line ....
! Missing $ inserted.
<inserted text>
$
l. ...This code is fixed-width font: \ff{_hello\abc}
.
5 changes: 5 additions & 0 deletions testfiles/simple.tlg
Expand Up @@ -10,3 +10,8 @@ LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line ....
)
LaTeX Warning: Reference `ln:ret' on page 1 undefined on input line ....
! Missing $ inserted.
<inserted text>
$
l. ...... code is fixed-width font: \ff{_hello\abc}
.
5 changes: 5 additions & 0 deletions testfiles/simple.xetex.tlg
Expand Up @@ -11,3 +11,8 @@ LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line ....
)
LaTeX Warning: Reference `ln:ret' on page 1 undefined on input line ....
! Missing $ inserted.
<inserted text>
$
l. ...... code is fixed-width font: \ff{_hello\abc}
.

0 comments on commit 831e724

Please sign in to comment.