1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\documentclass[a4paper,12pt]{scrartcl}

\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{lmodern}

\usepackage{listings}
 
\DeclareMathVersion{sans}
\SetSymbolFont{operators}{sans}{OT1}{cmbr}{m}{n}
\SetSymbolFont{letters}  {sans}{OML}{cmbrm}{m}{it}
\SetSymbolFont{symbols}  {sans}{OMS}{cmbrs}{m}{n}

\lstnewenvironment{pseudolisting}
  {\mathversion{sans}}{}

\lstset{
	mathescape=true,
	basicstyle = \sffamily
}

\begin{document}

\begin{pseudolisting}[float,caption={Foo},label=lst:bar]
A $\Rightarrow$ A, $x_0$
\end{pseudolisting}

\ref{lst:bar}

\end{document}