I'm using \usepackage{listings}
to display code in a text. With basicstyle=\sffamily
, the text is displayed sans serif, but I want to have it proportianal too. Is any one know if it possible to have sans serif proportional font?
-
Welcome to TeX.SE! As fa as I know, sans serif fonts are proporcional fonts. What is the problem then?– ZarkoJul 1, 2020 at 10:00
Add a comment
|
1 Answer
\documentclass{article}
\usepackage{listings}
\begin{document}
\begin{lstlisting}[basicstyle=\sffamily]
I'm using \usepackage{listings} to display code in a text. With basicstyle=\sffamily, the text is
displayed sans serif, but I want to have it proportianal too. Is any one know if it possible to
have sans serif proportional font?
\end{lstlisting}
\begin{lstlisting}[basicstyle=\sffamily,columns=fullflexible]
I'm using \usepackage{listings} to display code in a text. With basicstyle=\sffamily, the text is
displayed sans serif, but I want to have it proportianal too. Is any one know if it possible to
have sans serif proportional font?
\end{lstlisting}
\end{document}
-
1Good answer (+1), note that besides
fullflexible
there is alsoflexible
andspaceflexible
that are still proportional but a bit less condensed.– MarijnJul 1, 2020 at 10:44 -
My best wishes for your 10k of reputation: just it was 9999. I am very happy for to have give you my upvoted. Jul 1, 2020 at 12:09
-