# How to use DejaVu Sans Mono in definition header?

I have this code:

\documentclass[12pt]{article}

\usepackage[scaled=0.9]{DejaVuSansMono}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\newtheorem{definition}{Definition}

\begin{document}
This is a test. \lstinline!Positive! set.

\begin{definition}[Positive]\ \\
\indent A set $S$ is called positive if \ldots
\end{definition}

\end{document}


When I write \begin{definition}[\lstinline!Positive!] instead of \begin{definition}[Positive], the definition header disappears. (LaTeX only shows the body of the definition.)

How to fix this?

• Is there a real need for \lstinline? I can't see it, just \texttt suffices. – egreg Dec 13 '17 at 21:53

 \usepackage[T1]{fontenc}

before you load dejavusansmono and for your definition use:
 \begin{definition}[\texttt{Positive}]~\newline