4

people!

I'm having some trouble to make a thing in LaTeX. I want to use math's font in my document like I show in the next image:

Image 1: Math font

But I want to use DejaVu Sans Mono as my monospace default font (because I like a lot and use it everywhere I can). But when I put this in the preamble:

\usepackage{mathpazo,euler}
\linespread{1.05}
\usepackage{DejaVuSansMono}

It doesn't do anything but put the math font (which is the fist thing) and not DejaVu Sans Mono. Then I looked for at Google and found this:

\usepackage{dejavu}
\usepackage[T1]{fontenc}

But it loads every DejaVu font for the document. I'm trying to use this with the Listings' package.

I have installed DejaVu font (every kind of) in all my computers. Actually I'm doing this document in Windows with TeXMaker+MikTex.

Example:

\documentclass[10pt,a4paper,final]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath,mathtools,stackengine,amsfonts,amssymb,geometry,graphicx}
\usepackage{listings}
\usepackage{geometry}
\geometry{
    a4paper,
    height=24cm,
    width=17cm, 
    top=3cm, 
    headheight=1.7cm, 
    headsep=1.5cm, 
    footskip=1cm,
}
\usepackage{mathpazo,euler}
\linespread{1.05}
\usepackage{DejaVuSansMono}
%\usepackage{dejavu}
%\usepackage[T1]{fontenc}
\newlength\tindent
\setlength{\tindent}{\parindent}
\setlength{\parindent}{0pt}
\renewcommand{\indent}{\hspace*{\tindent}}
\begin{document}
Se utiliza un valor \lstinline!boolean! para poder tener en cuenta uno u otro apartado.
\end{document}
4
  • Don't show only snippets, make a complete example that shows how you try to use the mono font. Feb 13, 2016 at 11:42
  • @UlrikeFischer Done. And I added another package I'm using. Thank you for the comment!
    – user66636
    Feb 13, 2016 at 11:48
  • That's again a snippet. A complete example starts with \documentclass and can be copied and pasted and compiled without changes. Feb 13, 2016 at 11:48
  • @UlrikeFischer I put it on Overleaf, hope it's good :)
    – user66636
    Feb 13, 2016 at 11:55

1 Answer 1

4

This works fine with pdflatex:

\documentclass[10pt,a4paper,final]{article}
\usepackage[T1]{fontenc}
\usepackage{mathpazo,euler}
\usepackage[scaled=0.9]{DejaVuSansMono}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
\begin{document}
    Se utiliza un valor \lstinline!boolean! para poder tener en cuenta uno u otro 
    apartado.
\end{document}
0

You must log in to answer this question.