Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am testing a few chapter styles to work with kerkis font in greek. The weird thing is that although I load the package, the fontstyle doesn't pass inside the document. My first attempt is the following

enter image description here

and its code is

%---------------- Square Box on Top Right Corner -----------------------
\documentclass{book}
\usepackage[margin=2.8cm,a4paper]{geometry}
\usepackage[english,greek]{babel}
\usepackage[iso-8859-7]{inputenc}
%\usepackage[utf8]{inputenc}
\usepackage{kerkis}
\usepackage{pifont}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}
\usepackage{tikz}
\usepackage{epigraph}
\usepackage{xpatch}
\usepackage{lmodern}
\usepackage{lipsum}

\newlength\ChapWd
\settowidth\ChapWd{\huge\chaptertitlename}

\definecolor{myblue}{RGB}{0,0,122}

\titleformat{\chapter}[display]
  {\normalfont\filcenter\sffamily}
  {\tikz[remember picture,overlay]
    {
    \node[fill=myblue,font=\fontsize{60}{72}\selectfont\color{white},anchor=north east,minimum size=\ChapWd] 
      at ([xshift=-15pt,yshift=-15pt]current page.north east) 
      (numb) {\thechapter};
    \node[rotate=90,anchor=south,inner sep=0pt,font=\huge] at (numb.west) {\chaptertitlename};
    }
  }{0pt}{\fontsize{33}{40}\selectfont\color{myblue}#1}[\vskip10pt\Large***]
\titlespacing*{\chapter}
  {0pt}{50pt}{10pt}


\makeatletter
\xpatchcmd{\ttl@printlist}{\endgroup}{{\noindent\color{myblue}\rule{\textwidth}{1.5pt}}\vskip30pt\endgroup}{}{}
\makeatother

\newcommand\DoPToC{%
\startcontents[chapters]
\printcontents[chapters]{}{1}{\noindent{\color{myblue}\rule{\textwidth}{1.5pt}}\par\medskip}%
}

\setlength\epigraphrule{0pt}
\renewcommand\textflush{flushright}
\renewcommand\epigraphsize{\normalsize\itshape}

\begin{document}
%\selectfont{kekris}

\chapter{Title of the first chapter}
\epigraph{A brainy quote -- Its Author}{}
\DoPToC
\lipsum[4]
\section{A test section}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]
\section{Another test section}
\lipsum[4]
\section{Yet another test section}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]

\chapter{Title of the second chapter}
\DoPToC
\lipsum[4]
\section{A test section}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]
\section{Another test section}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]
\subsection{A test subsection}
\lipsum[4]

\end{document}

You can see that despite loading kerkis, the fonts aren't kerkis at all. The same happens with another style, as seen in the next figure

enter image description here

There, although chaptername is really in kerkis, everything else is in babel's default. The code for that is

%------------------- Round Boxes ------------------------------
\documentclass{book}
\usepackage[english,greek]{babel}
\usepackage[iso-8859-7]{inputenc}
%\usepackage[utf8]{inputenc}
\usepackage{kerkis}
\usepackage{pifont}
\usepackage[explicit]{titlesec}
\usepackage{fourier}
%\usepackage{kerkis}
\usepackage{tikz}
\usepackage{epigraph}
\usepgflibrary{qrr.shapes.openrectangle}

\definecolor{mybluei}{RGB}{0,173,239}
\definecolor{myblueii}{RGB}{63,200,244}
\definecolor{myblueiii}{RGB}{199,234,253}

\tikzset{
mynode/.style={
  rounded corners=30pt,
  shape=open rectangle,
  open rectangle fill=myblueii,
  open rectangle sides=#1,
  }
}

\titleformat{\chapter}[display]
  {\normalfont\huge\sffamily}
  {}
  {20pt}
  {%
  \begin{tikzpicture}[remember picture,overlay]
  \node[
    anchor=west,
    rectangle,
    minimum height=4cm,
    text width=\paperwidth,
    xshift=-\the\dimexpr\oddsidemargin+1in\relax,
    outer sep=0pt,
    fill=myblueiii] (titlerect) {};
  \node[
    anchor=south west,
    xshift=2cm,
    text width=\textwidth] 
    at ([yshift=5pt]titlerect.south west) {\fontsize{30}{36}\selectfont#1};
  \node[
    mynode=nw,
    anchor=south east,
    fill=myblueii,
    inner xsep=1.5cm,
    outer sep=0pt,
    font=\color{white},
    minimum height=30pt] 
    at (current page.east|-titlerect.north)
     {\bfseries\MakeUppercase{\chaptertitlename}\ \thechapter};
  \end{tikzpicture}%
  }
\titleformat{name=\chapter,numberless}[display]
  {\normalfont\huge\sffamily}
  {}
  {20pt}
  {%
  \begin{tikzpicture}[remember picture,overlay]
  \node[
    anchor=west,
    rectangle,
    minimum height=4cm,
    text width=\paperwidth,
    xshift=-\the\dimexpr\oddsidemargin+1in\relax,
    outer sep=0pt,
    fill=myblueiii] (titlerect) {};
  \node[
    anchor=south west,
    xshift=2cm,
    text width=\textwidth] 
    at (titlerect.south west) {\Huge#1};
  \end{tikzpicture}%
  }
\titlespacing*{\chapter}
  {0pt}{-20pt}{60pt}

% \setlength\beforeepigraphskip{1.5\baselineskip}
% \setlength\afterepigraphskip{2\baselineskip}
% \setlength\epigraphwidth{6.8cm}
% \setlength\epigraphrule{0pt}
% \renewcommand\epigraphsize{\large}
% \renewcommand\textflush{flushright}
% 
% \let\oldepigraph\epigraph \renewcommand\epigraph[2]{%
%   \oldepigraph{\color{mybluei}\itshape #1}{#2}}

\usepackage{epigraph}
\usepackage[margin=2.8cm]{geometry}

\setlength\beforeepigraphskip{1.5\baselineskip}
\setlength\afterepigraphskip{2\baselineskip}
\setlength\epigraphwidth{6.8cm}
\setlength\epigraphrule{0.1pt}
\renewcommand\epigraphsize{\large}
\renewcommand\textflush{flushright}

\let\oldepigraph\epigraph \renewcommand\epigraph[2]{%
  \oldepigraph{\color{blue}\itshape #1}{#2}}

% \makeatletter
% \xpatchcmd{\ttl@printlist}{\endgroup}{{\noindent\color{blue}\rule{\textwidth}{1.5pt}}\vskip30pt\endgroup}{}{}
% \makeatother

\usepackage{titletoc}
\newcommand\DoPToC{%
\startcontents\printcontents{}{1}{\noindent{\color{blue}\rule{\textwidth}{.5pt}}\par\medskip}}
\usepackage{xpatch}


\begin{document}

\chapter{From the Ground Up!}
\epigraph{In theory there is no difference \\ between theory and practice. \\ In practice there is.}{Lawrence ``Yogui'' Berra,1925 \\ New York Yankees baseball player}
\DoPToC
\chapter*{A test unnumbered chapter}
\DoPToC
\chapter{Another chapter}
\epigraph{In theory there is no difference \\ between theory and practice. \\ In practice there is.}{Lawrence ``Yogui'' Berra,1925 \\ New York Yankees baseball player}
\DoPToC
\section{A simple section}
\section{Another simple section}

\end{document}

Any idea on why is this happening? How can it be fixed?

share|improve this question
    
If I'm not mistaken kerkis is a serif font. this means every time \sffamily is invoked a substitution font is used... and the greek support for this font might not be complete. –  s__C Jul 7 at 9:17
    
@s__C : I also removed \ssfamily(because it's the only font-relevant command) but I didn't see any difference... –  Thanos Jul 7 at 9:26
1  
Remove \usepackage{fourier}. –  egreg Jul 7 at 9:35
    
@egreg : Thank you very much for your comment. Removing fourier works for the second case but not for the first one. –  Thanos Jul 7 at 9:52
1  
@Thanos In the first code you have \usepackage{lmodern} after \usepackage{kerkis}: remove lmodern. –  egreg Jul 7 at 9:55
show 1 more comment

2 Answers 2

up vote 5 down vote accepted

You have conflicting font packages. In the first code you have \usepackage{lmodern} after \usepackage{kerkis}, so LaTeX is instructed first to use Kerkis and then to change the font to Latin Modern.

Similarly, in the second code you have \usepackage{fourier}, that instructs LaTeX to use Utopia for text and Fourier form math. Remove the call.

share|improve this answer
add comment

You can use the OpenType version of Kerkis (http://iris.math.aegean.gr/kerkis/) and then run xelatex or lualatex:

\documentclass{book}
\usepackage{pifont}
\usepackage{fontspec}
\setmainfont[BoldFont=Kerkisbold,
             ItalicFont=Kerkisitalics]{Kerkis}
\setsansfont{KerkisSans}
\usepackage[english,greek]{babel}
\usepackage[margin=2.8cm,a4paper]{geometry}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}
\usepackage{tikz}
\usepackage{epigraph}
\usepackage{xpatch}
\usepackage{lipsum}
\newlength\ChapWd
\settowidth\ChapWd{\huge\chaptertitlename}
\definecolor{myblue}{RGB}{0,0,122}

\titleformat{\chapter}[display]
  {\normalfont\filcenter\sffamily}
  {\tikz[remember picture,overlay]
    {
    \node[fill=myblue,font=\fontsize{60}{72}\selectfont\color{white},anchor=north east,minimum size=\ChapWd] 
      at ([xshift=-15pt,yshift=-15pt]current page.north east) 
      (numb) {\thechapter};
    \node[rotate=90,anchor=south,inner sep=0pt,font=\huge] at (numb.west) {\chaptertitlename};
    }
  }{0pt}{\fontsize{33}{40}\selectfont\color{myblue}#1}[\vskip10pt\Large***]
\titlespacing*{\chapter}
  {0pt}{50pt}{10pt}


\makeatletter
\xpatchcmd{\ttl@printlist}{\endgroup}{{\noindent\color{myblue}\rule{\textwidth}{1.5pt}}\vskip30pt\endgroup}{}{}
\makeatother

\newcommand\DoPToC{%
\startcontents[chapters]
\printcontents[chapters]{}{1}{\noindent{\color{myblue}\rule{\textwidth}{1.5pt}}\par\medskip}%
}
\setlength\epigraphrule{0pt}
\renewcommand\textflush{flushright}
\renewcommand\epigraphsize{\normalsize\itshape}

\begin{document}

\chapter{Title of the first chapter}
\epigraph{Ένας έξυπνος απόσπασμα - Συγγραφέας του}{}
\DoPToC
Είμαι δοκιμές μερικές μορφές κεφαλαίου να συνεργαστεί με γραμματοσειρά Κέρκης στα ελληνικά. Το περίεργο είναι Παρόλο που δεν φορτώσει το πακέτο, το στυλ γραμματοσειράς δεν χωράει μέσα στο έγγραφο. Η πρώτη μου προσπάθεια είναι η ακόλουθη:
\section{A test section}
\subsection{A test subsection}
\lipsum[4]

\end{document}

enter image description here

share|improve this answer
    
Thank you very much for your answer. I want to avoid using XeLaTeX. In previous tries I always had issues with the encoding or with tikz or beamer or almost everything! The same main document code, couldn't work as is when running XeLaTeX... –  Thanos Jul 7 at 11:05
    
Xelatex is pure UTF8 it cannot really have problems with encodings. –  Herbert Jul 7 at 11:10
    
You are right. I just remembered it was the editor who had the problem. I had to fix the encoding there. Nevertheless, I couldn't compile my previous pdfLaTeX documents even if I applied the relevant changes in the preamble... –  Thanos Jul 7 at 11:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.