From 2383a77a0034480b2a83068bb29d8db71ba03af5 Mon Sep 17 00:00:00 2001 From: OLSSON Hans Date: Tue, 16 Nov 2021 11:29:40 +0100 Subject: [PATCH 1/7] Ensure that Modelica code in HTML is actually in fixed-width "teletype" style. --- mlsshared.sty | 7 ++++++- preamble.tex | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mlsshared.sty b/mlsshared.sty index 523fcbd61..27fdc44b9 100644 --- a/mlsshared.sty +++ b/mlsshared.sty @@ -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} @@ -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, @@ -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}} diff --git a/preamble.tex b/preamble.tex index 9afcd3512..ef0c933cd 100644 --- a/preamble.tex +++ b/preamble.tex @@ -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. From 2fc74bbf7888e72dc30cb16d694359168a6961aa Mon Sep 17 00:00:00 2001 From: OLSSON Hans Date: Wed, 17 Nov 2021 10:15:53 +0100 Subject: [PATCH 2/7] Restore sffamily --- mlsshared.sty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlsshared.sty b/mlsshared.sty index 27fdc44b9..bc0651031 100644 --- a/mlsshared.sty +++ b/mlsshared.sty @@ -188,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}, % comment style + commentstyle=\color{commentcolor}\sffamily\smallifpdf, % 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, From 6d2da221d777ca4a050b5f1f0e4ed6b3777477fb Mon Sep 17 00:00:00 2001 From: OLSSON Hans Date: Wed, 17 Nov 2021 11:45:30 +0100 Subject: [PATCH 3/7] Improve comment --- mlsshared.sty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlsshared.sty b/mlsshared.sty index bc0651031..ec3eeebc6 100644 --- a/mlsshared.sty +++ b/mlsshared.sty @@ -200,7 +200,7 @@ 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 +% Note: Needing size for sans serif font, or LaTeXML will have different size for them which looks weird. % % Misc math From d00a7fc65554d99ff7c3d5eeee4479a2cdb44053 Mon Sep 17 00:00:00 2001 From: OLSSON Hans Date: Thu, 18 Nov 2021 12:55:12 +0100 Subject: [PATCH 4/7] Improve comment, and always small in LaTeXML --- mlsshared.sty | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mlsshared.sty b/mlsshared.sty index ec3eeebc6..ada45426b 100644 --- a/mlsshared.sty +++ b/mlsshared.sty @@ -188,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\smallifpdf, % comment style + commentstyle=\color{commentcolor}\sffamily\small, % comment style, need smaller size for sans serif font in LaTeXML 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, @@ -200,8 +200,6 @@ belowskip=0pt, defaultdialect=[MLS]C, } -% Note: Needing size for sans serif font, or LaTeXML will have different size for them which looks weird. -% % Misc math \newcommand{\ud}{\mathrm{d}} From 096bcb1df7dd535f5e278a8c567f239861b85084 Mon Sep 17 00:00:00 2001 From: OLSSON Hans Date: Thu, 18 Nov 2021 13:04:37 +0100 Subject: [PATCH 5/7] add comment --- preamble.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/preamble.tex b/preamble.tex index ef0c933cd..4e8291a31 100644 --- a/preamble.tex +++ b/preamble.tex @@ -151,6 +151,7 @@ \fi % There seems to be some major issue with using this as a package in LaTeXML messing up font in listing +% See https://github.com/brucemiller/LaTeXML/issues/1713 \ifpdf \usepackage{mlsshared} \else From 736b25802b1a939485179e477fbd55f09cf7a992 Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Fri, 19 Nov 2021 08:57:27 +0100 Subject: [PATCH 6/7] Update mlsshared.sty Co-authored-by: Henrik Tidefelt --- mlsshared.sty | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mlsshared.sty b/mlsshared.sty index ada45426b..95d7774f2 100644 --- a/mlsshared.sty +++ b/mlsshared.sty @@ -13,10 +13,11 @@ % 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. +% Finally, don't use newtexttt in listings in the LaTeXML build, see: +% - https://github.com/brucemiller/LaTeXML/issues/1713 \ifpdf \usepackage{newtxtt} \fi -% There seems to be some major issue with using that font in LaTeXML in listings \usepackage{listings} \usepackage{color} From 9c446ba4498ee86e77bc9bfbb28d716d3fec679d Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Fri, 19 Nov 2021 12:00:03 +0100 Subject: [PATCH 7/7] Update mlsshared.sty Co-authored-by: Henrik Tidefelt --- mlsshared.sty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlsshared.sty b/mlsshared.sty index 95d7774f2..b696b5c64 100644 --- a/mlsshared.sty +++ b/mlsshared.sty @@ -189,7 +189,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\small, % comment style, need smaller size for sans serif font in LaTeXML + commentstyle=\color{commentcolor}\sffamily\small, % For the LaTeXML build this is smaller than for 'basicstyle', need due to sans serif font. 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,