Skip to content

Change font for comments #3665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlsshared.sty
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
keepspaces, % don't remove space such as those after closing parenthesis
upquote=true, % Don't turn apostrophe/backtick into single quotation marks.
captionpos=b, % sets the caption-position to bottom
commentstyle=\color{commentcolor}\sffamily,
commentstyle=\color{commentcolor}\sffamilyifhtml,
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 Down
9 changes: 9 additions & 0 deletions preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@
\let\smallifpdf\normalsize
\fi

% Comments in listings looks better and more distinct from the actual code if set in a variable-width sans-serif font.
% However, just changing font family doesn't work for pdf.
% Hence, we make a different choice of font depending on the target format.
\ifpdf
\let\sffamilyifhtml\relax
\else
\let\sffamilyifhtml\sffamily
\fi

\ifpdf
% Don't load cleveref yet.
\else
Expand Down