Skip to content

Font for comments in Modelica code #40

@HansOlsson

Description

@HansOlsson

Based on modelica/ModelicaSpecification#3665 (this especially an issue for comments using words like "illegal" or "literal"; where the fixed-width writing using a variable-width font looks odd).

Either include:

% 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

and change to: commentstyle=\color{commentcolor}\sffamilyifhtml,

or just

commentstyle=\color{commentcolor}

as this template is for generating pdf-files.

I can provide PR for either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions