[Tex/LaTex] How to handle special characters in LaTeX

charactersverbatim

I am working on one file which has some special chacters.

    König IR   : KA}unig ,K ~ A}unig 
%          : Comment in latex (so no text after this %)
-          : escape

I get different output which seems to be very funny. How can i handle such characters in LaTeX?

Best Answer

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
%\makeatletter

%\def\verbatim@font{\normalfont\fontfamily{ua1}\selectfont}  % verbatim in Arial
%
\makeatother

\begin{document}

\begin{verbatim}
König IR   : KA}unig ,K ~ A}unig 
%          : Comment in latex (so no text after this %)
-          : escape
\end{verbatim}

\noindent
\begin{tabular}{@{} p{2cm} @{\,:\,} l }
König IR   & KA\}unig ,K \textasciitilde\ A\}unig \\
\%         & Comment in latex (so no text after this \%)\\
-          & escape
\end {tabular}

\end{document}

enter image description here

and the same with arial for verbatim:

enter image description here