1

I was using package mathptmx to produce Times font, which is requested by my publisher.

The problem with that font is that the ancient Greek text is replaced with Computer Modern font since mathptmx package does not support ancient Greek.

In this topic I was advised to use newtxtext package instead.

My problem is:

  1. I need to produce chapter and section titles in small caps and some of the titles contain ancient Greek text produced by the polutonikogreek option of babel package.

  2. When I use newtextto do that it creates an error "Latex Error: No declaration for shape LGR/Tempora-TLF/m/sc". This is of course because Latex is trying to use small caps both for latin and for ancient Greek part of the title.

I need to find a solution that would allow me to use Greek text with similar font to the Times font in the main text and which would at the same time produce Greek text in titles with that same Greek font (not small-caps) while producing rest of the title in small-caps latin font.

Example: enter image description here

I am providing here as minimal MWE as I could. I am leaving all of the packages I use included because often solutions cannot anticipate possible package clashes.

\documentclass[10pt,a4paper,twoside]{scrbook}%
\usepackage[dvips=false,pdftex=false,vtex=false]{geometry}
 \geometry{
   paperwidth=155mm,
   paperheight=230mm,
   inner=25mm,
       outer=23mm,
   bottom=20mm,
   top=27mm
}
\usepackage[polutonikogreek,ngerman]{babel}%
\usepackage[utf8]{inputenc}%
\usepackage[T1]{fontenc}%
\usepackage{anyfontsize}
\usepackage{longtable}%
\usepackage{tabularx}%
\usepackage{array}%
\usepackage{float}%
\usepackage{setspace}%
\usepackage{tabto}%
\usepackage[font=small]{caption}
\usepackage{scrlayer-scrpage}
\usepackage{graphicx}%
\usepackage{nameref}%
\usepackage{xpatch}%
\usepackage{morewrites}
\usepackage{blindtext}
\usepackage{rotating}%
\usepackage[textwidth=2cm, textsize=tiny, backgroundcolor=white, linecolor=black]{todonotes}%
\usepackage{acronym}
\usepackage{bookmark}
\usepackage{xcolor}
\usepackage{mdwlist}
\usepackage{titlesec}
\usepackage{mathptmx}
\usepackage[normalem]{ulem}
\usepackage{newtxtext}% Times font
\usepackage{newtxmath}% if you need math
\usepackage{substitutefont}
\substitutefont{LGR}{\familydefault}{Tempora-TLF}
\usepackage{textcomp}%
%
%
% TEXT
%
\renewcommand{\baselinestretch}{1.2}% TEXT SPACING
%
\renewcommand{\arraystretch}{1.25}
%
\newcommand{\grk}[1]{{\foreignlanguage{polutonikogreek}{#1}}}% GREEK TEXT
\newcommand{\lat}[1]{\emph{{#1}}}% LATIN TEXT
%
%
% BIBLATEX:%
%
\usepackage[style=historische-zeitschrift, maxnames=2, hyperref=false, backref=true, backrefstyle=none, backend=bibtex,idemtracker=true, block=none]{biblatex}% change to hyperref=true to get clickable links
\usepackage[babel,german=quotes]{csquotes}%
\bibliography{Inhalt}
%
%
%
% REDESIGNING TITLE STYLES (REQUIRES TITLESEC)
%
\titleformat{\chapter}[display]% CHAPTER
  {\fontsize{11}{12}\selectfont\scshape\centering}
  {\scshape\chaptertitlename\ \thechapter.\enskip}{1pt}{\fontsize{11}{12}\selectfont}
  \titlespacing*{\chapter}{0pt}{30pt}{30pt}% FIRST NUMBER BEFORE LAST NUMBER AFTER
\titleformat{\section}[block]% SECTION
  {\fontsize{10.5}{8}\selectfont\centering}
  {\thesection.\enskip}{1pt}{\fontsize{10.5}{8}\selectfont}
  \titlespacing*{\section}{0pt}{15pt}{15pt}% FIRST NUMBER BEFORE LAST NUMBER AFTER
\titleformat{\subsection}[block]% SUBSECTION
  {\fontsize{10.5}{8}\selectfont\centering\itshape}
  {\itshape\thesubsection.\enskip}{1pt}{\fontsize{10.5}{8}\selectfont}
  \titlespacing*{\subsection}{0pt}{15pt}{10pt}% FIRST NUMBER BEFORE LAST NUMBER AFTER
%
%
\begin{document}%
%
%
\frontmatter
\pagestyle{scrheadings}%
\chapter{\grk{L'ogoc-s'arx} – Ein in Fleisch gekleideter Gott}\thispagestyle{empty}
\section{\grk{<Omoo'usios} – Der gottgleiche Sohn}
    \blindtext
    \begin{quote}\grk{o>uko~un t~w m`en >agenn'htw patr`i o>ike~ion >ax'iwma fulakt'eon, mhd'ena to~u e@inai a>ut~w t`on a>'ition l'egontas; t~w d`e u<i~w t`hn <arm'ozousan tim`hn >aponemht'eon, t`hn >'anarqon a>ut~w par`a to~u patr`os g'ennhsin >anatij'entas; ka`i <ws >efj'asamen a>ut~w s'ebas >apon'emontes, m'onon e>usebos ka`i e>uf'hmws t`o @hn ka`i t`o >ae`i ka`i t`o pr`o a>i'wnwn l'egontes >ep> a>uto~u, t`hn m'entoi je'othta a>uto~u m`h paraito'umenoi, >all`a t~h e>ik'oni ka`i t~w qarakt~hri to~u patr`os >aphkribwm'enhn >emf'ereian kat`a p'anta >anatij'entes, t`o d`e >ag'ennhton t~w patr`i m'onon >id'iwma pare~inai dox'azontes, <'ate d`h ka`i a>uto~u f'askontos to~u swt~hros; »<o pat'hr mou me'izwn mo'u >estin«.}\end{quote}
    \blindtext
    \cleardoublepage
    \end{document}%
3

The substitutefont package works assuming that all font selections defined in the original family are also present in the substitute one.

In this case we have to trick LaTeX into thinking that there is a small caps font in the Tempora-TLF family, with LGR encoding. Actually we'll make the small caps selection choose the normal shape.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[polutonikogreek,ngerman]{babel}

\usepackage{newtxtext}
\usepackage{substitutefont}

\substitutefont{LGR}{\familydefault}{Tempora-TLF}

\newcommand{\grk}[1]{{\foreignlanguage{polutonikogreek}{#1}}}% GREEK TEXT

% Let's trick substitutefont into thinking that there are
% Greek small caps
\AtBeginDocument{%
  \sbox0{\grk{A}%
  \global\expandafter\let
  \csname LGR/Tempora-TLF/m/sc\expandafter\endcsname
  \csname LGR/Tempora-TLF/m/n\endcsname
}}

\begin{document}

\scshape 
\grk{L'ogoc-s'arx} – Ein in Fleisch gekleideter Gott

\end{document}

The trick is to choose the font we want to substitute for the missing small caps (using a box, so nothing will appear in print) and define the missing declaration as equivalent to choosing that font.

A similar trick might be needed for other unknown combinations.

enter image description here

However this is suboptimal. Given that you don't have small caps Greek letters (do they make sense, by the way?), the publisher should choose a different font shape for the titles.

A possibly simpler strategy is to force LaTeX to load the .fd file for Tempora and declaring the substitution. Thanks to Ulrike Fischer for a hint in this direction.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[polutonikogreek,ngerman]{babel}

\usepackage{newtxtext}
\usepackage{substitutefont}

\substitutefont{LGR}{\familydefault}{Tempora-TLF}

\newcommand{\grk}[1]{{\foreignlanguage{polutonikogreek}{#1}}}% GREEK TEXT

% Let's trick substitutefont into thinking that there are
% Greek small caps
\makeatletter
\input{lgrtempora-tlf.fd}
\DeclareFontShape{LGR}{Tempora-TLF}{m}{sc}{<-> ssub * Tempora-TLF/m/n}{}
\makeatother

\begin{document}

\scshape 
\grk{L'ogoc-s'arx} – Ein in Fleisch gekleideter Gott

\end{document}
  • Thank you very much! This is exactly the solution I was looking for. No Greek has no small-caps and I do not need them. – eklisiarh Dec 12 '17 at 22:02
  • Why the complicated \let command? If you call the font shape once in a group latex will setup the same substitute by itself. – Ulrike Fischer Dec 12 '17 at 23:02
  • @UlrikeFischer The problem is that I want to provide a definition for \LGR/Tempora-TLF/m/sc which is the command that raises an error because it is undefined even after reading the .fd file. And, above all, I don't want spurious warnings. – egreg Dec 12 '17 at 23:23
  • Hm. I know about the error -- we discussed this yesterday -- but imho if you want to avoid the warnings you get with my code it would be better to declare the shape with the official declaration: \fontencoding{LGR}\fontfamily{Tempora-TLF}\selectfont \DeclareFontShape{LGR}{Tempora-TLF}{m}{sc}{<-> ssub * Tempora-TLF/m/n}{}. Two \expandafters is imho a bit too hackish. – Ulrike Fischer Dec 12 '17 at 23:36
  • @UlrikeFischer I'd avoid using \selectfont in the preamble. But you gave the right idea. – egreg Dec 12 '17 at 23:45
-1

substitutefont makes a few assumptions which don't work with tempora and so the fallback system fails. Add before \begin{document} to avoid the error:

 {\fontencoding{LGR}\fontfamily{Tempora-TLF}\scshape\bfseries}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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