# Dealing with accents and keeping the same font

My LaTeX file contains accents which I cannot format as this text is included automatically. I hence chose to use \texttt and \verb so that I can display all kind of special characters (see code below). My problem is that the font is the frozen, is there so a way to: (1) accept any kind of special characters (%,è,à,ü..) (2) use a given font (3) not having to format these fonts in the LaTeX way (\'e, ...)

\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{helvetica}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,bindingoffset=0.1in,%
left=0.15in,right=0.15in,top=0.15in,bottom=0.35in,%
footskip=0.85in]{geometry}
\begin{document}
\emph{Estimation de la masse grasse}
{\tiny\verb? *Enlevé 1cm au tour de hanche à cause short TeamCanada. Obj:     diminuer % gras?}

\begin{center}
\emph{\texttt{Estimation du V02max et Répartition des plis cutanés}}
\end{center}

\end{document}


Thanks for any tip,

• Have you tried adding the instructions \usepackage[T1]{fontenc} and \usepackage{lmodern} to the preamble? Incidentally, I assume you meant to write \usepackage{helvet} rather than \usepackage{helvetica}. Incidentally, unless you are willing to encase strings that contain "special" characters -- %, &, #, ^, _, etc -- in \url wrappers, you will need to "escape" them by prefixing \ to them. – Mico Nov 17 '16 at 17:44
• Incidentally, is switching to either XeLaTeX or LuaLaTeX an option for you? If so, writing \url{*Enlevé 1cm au tour de hanche à cause short TeamCanada. Obj: diminuer % gras?} will produce the correct result. (As you've discovered, this isn't the case with pdfLaTeX.) – Mico Nov 17 '16 at 17:52
• Thanks for your answer Mico, I chose the helvetica font (that in include using the corresponding sty file). I cannot escape the characters with '\' because I won't have access to the text, it has to be included automatically. What do the \usepackage[T1]{fontenc} and \usepackage{lmodern} do? – Xavier Prudent Nov 17 '16 at 17:52
• I use a minimal installation of latex. My goal is just to produce basic reports by including some texts plus figures, no math – Xavier Prudent Nov 17 '16 at 17:54
• By default, LaTeX uses the so-called OT1 font encoding, in which many "accented" characters are simply absent. The T1 font encoding, which is of a more recent vintage, provides direct support for many accented characters. The Latin Modern font family is a clone of Computer Modern that contains many accented characters. – Mico Nov 17 '16 at 17:55

\texttt doesn't improve the printing of problematic input, so it quite useless. All your other examples are unproblematic with the exception of the %, and this you can easily avoid by changing its catcode.

\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{helvet}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper,bindingoffset=0.1in,%
left=0.15in,right=0.15in,top=0.15in,bottom=0.35in,%
footskip=0.85in]{geometry}

\begin{document}
\catcode\%=12
\emph{Estimation de la masse grasse}

*Enlevé 1cm au tour de hanche à cause short TeamCanada. Obj:     diminuer % gras?

\emph{Estimation du V02max et Répartition des plis cutanés}

\end{document}


If I understood you correctly, you need something like this:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}

\DeclareUnicodeCharacter{00E9}{\'e}

\begin{document}
é
\end{document}
`

You have to look up the character numbers and insert the escape version. Is that what you are looking for?

• in fact, I don't know what kind of weird characters are going to be in the text, so I just need some "dummy printing", so that these characters be simply displayed – Xavier Prudent Nov 17 '16 at 19:25
• @XavierPrudent In that case I would recommend as already mentioned to use lualatex. – MaestroGlanz Nov 17 '16 at 19:28
• ok, thanks, and what is the difference between lualatex and BasicTex ? – Xavier Prudent Nov 17 '16 at 20:30