From 573d450b499e6938ff0d1a92daae82fc58ee7380 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Fri, 16 Oct 2020 14:28:41 +0200 Subject: [PATCH] Introduce new dialect [nocomment]modelica for making comments appear as normal code --- preamble.tex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/preamble.tex b/preamble.tex index a77a5b7b1..c30020d65 100644 --- a/preamble.tex +++ b/preamble.tex @@ -227,6 +227,12 @@ basicstyle=\upshape\ttfamily, % Font size for inline code snippets. } +% Special dialect of Modelica to use when there are URLs appearing outside string literals, to avoid the part +% starting with '//' being treated as comment. +\lstdefinelanguage[nocomment]{modelica}[short]{modelica}{% + commentstyle=\upshape\ttfamily, % Camouflage comments as workaround for not being able to remove rest-of-line comment recognition. +} + % Note: within only a keyword in grammar \lstdefinelanguage{grammar}{% basicstyle=\upshape\smallifpdf\ttfamily, % size of fonts used for the code