Re: Font greci “stile codice” dentro un codice listing

#55614
Up
0
Down
::


Se vuoi greco anche nelle parti in Iwona, la faccenda è più complicata.

`\newcommand{\greco}[1]{%
\begin{otherlanguage*}{greek}
\testfamily#1%
\end{otherlanguage*}}
\newcommand{\greeksf}{\fontfamily{cmss}\selectfont}
\makeatletter
\edef\grs@sans{\sfdefault}
\edef\grs@tt{\ttdefault}
\def\testfamily{%
\ifx\f@family\grs@sans\greeksf\fi
\ifx\f@family\grs@tt\greeksf\fi}
\makeatother
\DeclareFontFamily{LGR}{\ttdefault}{}
\DeclareFontShape{LGR}{\ttdefault}{m}{n}{<->cmtt10}{}
\DeclareFontFamily{LGR}{\sfdefault}{}
\DeclareFontShape{LGR}{\sfdefault}{m}{n}{<->cmss10}{}

\lstset{basicstyle=\normalfont\ttfamily,frame=lines}
\lstset{escapeinside={£*}{*£}}

\lstnewenvironment{codice}%
{\setkeys{lst}{columns=fullflexible,keepspaces=true}%
\lstset{basicstyle=\small\ttfamily,escapeinside={£*}{*£}}%
}%
{} `
Ciao
Enrico

Go to top