Skip to content

Commit

Permalink
Ensure that Modelica code in HTML is actually in fixed-width "teletyp…
Browse files Browse the repository at this point in the history
…e" style.
  • Loading branch information
HansOlsson committed Nov 16, 2021
1 parent dd233d8 commit 2383a77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mlsshared.sty
Expand Up @@ -13,7 +13,10 @@
% white background due to anti-aliasing and similar effects.
% Warning: Note that changing to a font with different width -- especially a wider one -- means
% that existing manual line breaks are potentially becoming out of place.
\ifpdf
\usepackage{newtxtt}
\fi
% There seems to be some major issue with using that font in LaTeXML in listings

\usepackage{listings}
\usepackage{color}
Expand Down Expand Up @@ -185,7 +188,7 @@
breaklines=true, % automatic line breaking only at white-space
keepspaces, % don't remove space such as those after closing parenthesis
captionpos=b, % sets the caption-position to bottom
commentstyle=\color{commentcolor}\sffamily, % comment style
commentstyle=\color{commentcolor}, % comment style
keywordstyle=\color{red}, % Unused keyword style in bright red to make it easy to detect and fix.
keywordstyle=[1]\color{keywordcolor1},
keywordstyle=[2]\color{keywordcolor1}\bfseries,
Expand All @@ -197,6 +200,8 @@
belowskip=0pt,
defaultdialect=[MLS]C,
}
% Note: Not using \sffamily for comments since that causes comments to be of a different size, which looks plain weird
%

% Misc math
\newcommand{\ud}{\mathrm{d}}
Expand Down
5 changes: 5 additions & 0 deletions preamble.tex
Expand Up @@ -150,7 +150,12 @@
\usepackage[nameinlink,noabbrev]{cleveref}
\fi

% There seems to be some major issue with using this as a package in LaTeXML messing up font in listing
\ifpdf
\usepackage{mlsshared}
\else
\include{mlsshared.sty}
\fi

\ifpdf
% This is the preferred load order for listings and cleveref, so that cleveref is aware of listings, see above.
Expand Down

0 comments on commit 2383a77

Please sign in to comment.