From b3d70195571fd3e8127732f8d3d59f47e2805b8f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 17 Dec 2018 21:31:58 +0000 Subject: lstfiracode (17dec18) git-svn-id: svn://tug.org/texlive/trunk@49440 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/lstfiracode/lstfiracode.sty | 212 +++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/lstfiracode/lstfiracode.sty (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/lstfiracode/lstfiracode.sty b/Master/texmf-dist/tex/latex/lstfiracode/lstfiracode.sty new file mode 100644 index 00000000000..f1119d733a7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/lstfiracode/lstfiracode.sty @@ -0,0 +1,212 @@ +% +% Copyright (C) 2018 by Ruixi Zhang +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3c +% of this license or (at your option) any later version. +% The latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Ruixi Zhang. +% +% This work consists of the files lstfiracode.sty, +% lstfiracode.tex, +% README.md +% and the derived file lstfiracode.pdf. +% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{lstfiracode}[% + 2018/12/16 v0.1a LaTeX listings support for Fira Code] + +\RequirePackage{kvoptions} +\RequirePackage{listings} + +\DeclareBoolOption[false]{verbatim} +\DeclareDefaultOption{% + \PackageError{\@currname}{% + Unknown option `\CurrentOption'% + }{% + Available package options are:\MessageBreak + \space\space`verbatim=true' and\MessageBreak + \space\space`verbatim=false'% + }% +} +\ProcessKeyvalOptions* + +\let\lstfiracode@verbatim@nolig@list\verbatim@nolig@list +\newcommand*\ActivateVerbatimLigatures{% + \renewcommand*\verbatim@nolig@list{}% +} +\newcommand*\DeactivateVerbatimLigatures{% + \renewcommand*\verbatim@nolig@list{\lstfiracode@verbatim@nolig@list}% +} + +\iflstfiracode@verbatim + \ActivateVerbatimLigatures +\fi + +\def\lstfiracode@lst@Literatekey#1\@nil@{% + \let\lst@ifxliterate\lst@if + \expandafter\def\expandafter\lst@literate\expandafter{\lst@literate#1}% +} +\lst@Key{moreliterate}{}{% + \@ifstar{\lst@true \lstfiracode@lst@Literatekey} + {\lst@false\lstfiracode@lst@Literatekey}#1\@nil@ +} + +\lstdefinestyle{FiraCodeStyle}{ + basewidth=0.6em, + literate= + {www}{{www}}3 + {**}{{**}}2 + {***}{{***}}3 + {**/}{{**/}}3 + {*>}{{*>}}2 +% {*/}{{*/}}2 + {\\\\}{{\textbackslash\textbackslash}}2 + {\\\\\\}{{\textbackslash\textbackslash\textbackslash}}3 +% {\{-}{{\{-}}2 + {[]}{{[]}}2 + {::}{{::}}2 + {:::}{{:::}}3 + {:=}{{:=}}2 + {!!}{{!!}}2 + {!!!}{{!!!}}3 + {!=}{{!=}}2 + {!==}{{!==}}3 +% {-\}}{{-\}}}2 + {--}{{--}}2 + {---}{{---}}3 + {-->}{{-->}}3 + {->}{{->}}2 + {->>}{{->>}}3 + {-<}{{-<}}2 + {-<<}{{-<<}}3 + {-~}{{-\textasciitilde}}2 + {\#\{}{{\#\{}}2 + {\#[}{{\#[}}2 + {\#\#}{{\#\#}}2 + {\#\#\#}{{\#\#\#}}3 + {\#\#\#\#}{{\#\#\#\#}}4 + {\#(}{{\#(}}2 + {\#?}{{\#?}}2 + {\#_}{{\#\_}}2 + {\#_(}{{\#\_(}}3 + {.-}{{.-}}2 + {.=}{{.=}}2 + {..}{{..}}2 + {..<}{{..<}}3 + {...}{{...}}3 + {?=}{{?=}}2 + {??}{{??}}2 + {???}{{???}}3 +% {;;}{{;;}}2 +% {;;;}{{;;;}}3 +% {/*}{{/*}}2 +% {/**}{{/**}}3 + {/=}{{/=}}2 + {/==}{{/==}}3 + {/>}{{/>}}2 +% {//}{{//}}2 +% {///}{{///}}3 + {\&\&}{{\&\&}}2 + {\&\&\&}{{\&\&\&}}3 + {||}{{||}}2 + {|||}{{|||}}3 + {||=}{{||=}}3 + {|=}{{|=}}2 + {|>}{{|>}}2 + {^=}{{\textasciicircum=}}2 + {$>}{{\$>}}2 + {++}{{++}}2 + {+>}{{+>}}2 + {=:=}{{=:=}}3 + {==}{{==}}2 + {===}{{===}}3 + {==>}{{==>}}3 + {=>}{{=>}}2 + {=>>}{{=>>}}3 + {=<}{{=<}}2 + {=<<}{{=<<}}3 + {=~}{{=\textasciitilde}}2 + {=/=}{{=/=}}3 + {>-}{{>-}}2 + {>=}{{>=}}2 + {>=>}{{>=>}}3 + {>>}{{>>}}2 + {>>-}{{>>-}}3 + {>>=}{{>>=}}3 + {>>>}{{>>>}}3 + {<*}{{<*}}2 + {<*>}{{<*>}}3 + {<|}{{<|}}2 + {<|>}{{<|>}}3 + {<$}{{<\$}}2 + {<$>}{{<\$>}}3 + {