[Tex/LaTex] Pi, Kappa, Latin Small Letter Long S: problems with UTF8

font-encodingsinput-encodingssv-classesunicode

I'm using Springers svmono for a book with many mathematical symbols and special characters.

There are quite a few problems with characters that are simply not printed (using pdfLatex), so I tried to add utf8 support:

\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

However, there are errors. This is a MWE (svmono.cls needed to make it run):

%%%%%%%%%%%%%%%%%%%% book.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% sample root file for the chapters of your "monograph"
%
% Use this file as a template for your own input.
%
%%%%%%%%%%%%%%%% Springer-Verlag %%%%%%%%%%%%%%%%%%%%%%%%%%


% RE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[graybox,envcountchap,sectrefs]{svmono}

% choose options for [] as required from the list
% in the Reference Guide

\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\begin{document}

\begin{verbatim}
   # sin(π * t)
\end{verbatim}

Kudos (κῦδος)

\end{document}

Using utf8x I get:

ERROR: Undefined control sequence.

--- TeX said ---
\u-default-954 #1->\textkappa 

Using utf8 I get:

ERROR: Package inputenc Error: Unicode char \u8:π not set up for use with LaTeX.

And I need characters more exotic than pi or kappa – like latin small letter long s e.g.

Best Answer

The long s (ſ) is accessible through the TS1 fontencoding.
Depending on the frequency you need it in your text, you can use it

  • with the \longs command or
  • the "s command.

For written Greek text I'd use the babel package.
For Greek text in verbatim mode you can use the alltt package and either the babel package again or (for single letters) the textgreek package.
Edit: I just read that you use a customized wideverbatim environment. Can you provide a definition? I coudn't find one.

I have troubles with the Greek font encoding LGR.
Someone with a better understanding of font encoding might improve this answer.

\documentclass[graybox,envcountchap,sectrefs]{svmono}

\usepackage[LGR,TS1,T1]{fontenc}
\usepackage[utf8x]{inputenc}

\usepackage{lmodern}
\usepackage[polutonikogreek,english]{babel}
\usepackage{textgreek}
\usepackage{alltt}

\def\longs{{\fontencoding{TS1}\selectfont s}}
\def\greek#1{{\selectlanguage{greek}\fontencoding{LGR}\selectfont #1}}

\catcode`\"=\active%
\def"s{{\fontencoding{TS1}\selectfont s}}
\def\noLongS{\catcode`\"=12}

\begin{document}

\begin{alltt}
   # sin(\textpi * t)
   # sin(\greek{p} * t)
\end{alltt}

\noindent Kudos ({\greek{k~udos}) % κῦδος
\\
long s: Wach\longs tube\\
long s: Wach"stube\\
{\noLongS%
not a long s: Wach"stube}
\end{document}