The problem is this: I want to use in the custom class file (named thesis.cls
), a different language than English, Greek to be specific. In the .tex
file I loaded the babel
package with the command
\usepackage[greek,english]{babel}
that is, English as my main language. Also to change language in the .tex
file I use
\newcommand{\gr}{\selectlanguage{greek}}
\newcommand{\en}{\selectlanguage{english}}
Now inside the .cls
file I want to create the text below for the .tex
file.
%%%%%%%%%%%%%%%%%%
\newcommand\Declaration[1]{
\btypeout{Declaration of Authorship}
\addtotoc{Declaration of Authorship}
\thispagestyle{plain}
\null\vfil
%\vskip 60\p@
\begin{center}{\huge\bf{\gr{Δήλωση Προστασίας Πνευματικών Δικαιωμάτων}}\par}\end{center}
%\vskip 60\p@
{\normalsize #1}
\vfil\vfil\null
%\cleardoublepage
}
%%%%%%%%%%%%%%%%%%%
My problem is that the Greek sentence
<<Δήλωση Προστασίας Πνευματικών Δικαιωμάτων>>
is output in a machine-like language. How can I write it in Greek?
%%%%%%%%%%
%thesis.cls (excerpt)
%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{Thesis}
[2007/22/02 v1.0
LaTeX document class]
% declaration of options
\newif\ifdext@languagechosen
\DeclareOption{greek}{%
\PassOptionsToPackage{greek}{babel}
\dext@languagechosentrue
}
\DeclareOption{english}{%
\PassOptionsToPackage{english}{babel}
\dext@languagechosentrue
}
\def\baseclass{book}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
\def\@checkoptions#1#2{
\edef\@curroptions{\@ptionlist{\@currname.\@currext}}
\@tempswafalse
\@tfor\@this:=#2\do{
\@expandtwoargs\in@{,\@this,}{,\@curroptions,}
\ifin@ \@tempswatrue \@break@tfor \fi}
\let\@this\@empty
\if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi
}
\@checkoptions{11pt}{{10pt}{11pt}{12pt}}
\PassOptionsToClass{a4paper}{\baseclass}
\ProcessOptions\relax
\LoadClass{\baseclass}
\newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}
\newcommand\Declaration[1]{
\btypeout{Declaration of Authorship}
\addtotoc{Declaration of Authorship}
\thispagestyle{plain}
\null\vfil
%\vskip 60\p@
\begin{center}{\huge\bf{\tg{Δήλωση Προστασίας Πνευματικών Δικαιωμάτων}}\par}\end{center}
%\vskip 60\p@
{\normalsize #1}
\vfil\vfil\null
%\cleardoublepage
}
Here is my LaTeX file
%%%%%%%%%%%%%%%%%%%%%%%%%%%
.tex file
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt, a4paper, oneside]{Thesis} % Paper size, default font size and one-sided paper
\usepackage{kmath,kerkis} % The order of the packages matters; kmath changes the default text font
\usepackage[greek,english]{babel}
\usepackage[utf8x]{inputenx}
Best Answer
Don't modify the class. I think to have downloaded the one you refer to. I took the
Thesis.tex
file and changed the first line (with\documentclass
) intoand the Declaration page became like so
I just had to fix the encoding of the
Chapters/Chapter1.tex
file and the compilation ran smoothly with a TeX Live 2012 and also with the 2013 release. I suggest you to update your TeX distribution, and to change theutf8x
option intoutf8
.