I'm using lyx and get the error message, that the ° symbol got excluded, when I'm trying the following example:
\usepackage{listings}
\begin{lstlisting}
10°C
\end{lstlisting}
EDIT: as asked, here the latex code from lyx, where it is needed:
%% LyX 2.1.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{textcomp}
\usepackage{graphicx}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{~/Library/texmf/tex/latex/verbatimfiles}
\makeatother
\usepackage{babel}
\usepackage{listings}
\renewcommand{\lstlistingname}{Listing}
\begin{document}
\begin{itemize}
\item \emph{class variables}\\
\emph{}
\begin{lstlisting}
Public celsius() As Char = {" ", "°", "C", "/", "m", "i", "n"}
\end{lstlisting}
This variable is used to trim the output of Linkam functions, so numerical
value operation\emph{ }are possible with the outputs. It is made public,
so it can be accessed by functions outside this class, where the trimming
is nescessary.\\
\end{itemize}
\end{document}
Best Answer
Do you mean
${^\circ}$
? This would give you the degree sign, when optionmathescape
is enabled.And your script would look like this: