From 6a4fa401db3a45e0521cc0eae72f025be47d708c Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Sun, 27 Dec 2020 01:35:05 +0100 Subject: [PATCH] Make sure our language definitions for listings are actually being used While this wasn't a problem for our 'FORTRAN77', our definition of 'C' was actually completely ignored in favor of some predefined dialect of C. --- mlsshared.sty | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mlsshared.sty b/mlsshared.sty index e3f9b1314..b33813bcd 100644 --- a/mlsshared.sty +++ b/mlsshared.sty @@ -99,7 +99,7 @@ }[keywords,comments,strings] % Duplicate this definition here to avoid issue -\lstdefinelanguage{FORTRAN77}{% +\lstdefinelanguage{FORTRAN77}{% Define custom language to avoid collision with predefined [77]Fortran. basicstyle=\upshape\smallifpdf\ttfamily, % size of fonts used for the code morekeywords={% ASSIGN,BACKSPACE,CALL,CHARACTER,% @@ -128,7 +128,7 @@ morestring=[d]' }[keywords,comments,strings] -\lstdefinelanguage{C}{% +\lstdefinelanguage[MLS]{C}{% Define new dialect to avoid collision with predefined dialects of C. basicstyle=\upshape\smallifpdf\ttfamily, % size of fonts used for the code morekeywords={% auto,break,case,char,const,continue,default,do,double,% @@ -165,6 +165,7 @@ showstringspaces=false, frame=lrtb, belowskip=0pt, + defaultdialect=[MLS]C, } % Misc math