1

The problem of Alegreya which has a separate font family for small caps and how to properly include both in order to use bold and italics has been discussed here. However, I would like to use the font feature UppercaseSmallCaps since I would like to typeset section titles in a beamer presentation like this.

The following MWE, however, shows that it seems not to be possible to use \addfontfeatures on a font that uses another font as small caps font:

\documentclass{beamer}

\usepackage{fontspec}

\setsansfont[
  UprightFeatures={SmallCapsFont=AlegreyaSC-Regular},
  ItalicFeatures={SmallCapsFont=AlegreyaSC-Italic},
  BoldFeatures={SmallCapsFont=AlegreyaSC-Bold},
  BoldItalicFeatures={SmallCapsFont=AlegreyaSC-BoldItalic},
  Ligatures=TeX,
]{Alegreya}

\begin{document}

  \begin{frame}

    {\scshape\MakeLowercase{Desired Result}}

    {\scshape Abcde}

    {\addfontfeatures{Letters=UppercaseSmallCaps} Abcde}

    {\addfontfeatures{Letters=SmallCaps,SmallCapsFeatures={Letters=UppercaseSmallCaps}} Abcde}

  \end{frame}

\end{document}

As I actually want to have small caps from capitals, I also thought of using the \MakeLowercase command, but I would like to use to typeset the beamer title and section titles using the \setbeamerfont command, e.g. \setbeamerfont{title}{shape=\scshape,series=\bfseries,size={\fontsize{15}{18}}}, where the \MakeLowercase command cannot properly be used (as has been shown here). Or maybe it can, but I don’t really know how. I also don’t want to redefine all the underlying beamer commands, for the section titling or the title page, if possible.

I also considered to use the alegreya package, but here as well \addfontfeatures{Letters=UppercaseSmallCaps} seems not to work. So, I’d rather stick to fontspec, I guess, as it provides far better control to font features.

Maybe I overlooked something in the fontspec manual, but as far as I can see, there is no proper solution to this problem. Also, I could not find a solution for my problem somewhere around here. Let me know if I am wrong.

Thanks a lot for any ideas!

5
  • 2
    AlegreyaSC doesn't have the needed opentype feature for the Letters options. With lualatex you can create it one the fly: tex.stackexchange.com/questions/370799/… Jul 19, 2017 at 15:38
  • Ok, I see. I would rather like to use XeLaTeX. So this would mean, that the \addfontfeatures command is of no use here. But is there a way to use \MakeLowercase in combination with \setbeamerfont without having to actually redefine the command completely? Jul 19, 2017 at 16:55
  • 1
    I probably by far don't grasp the scope of the problem, so allow me this question: Why don't you just set the SC alegreya font family as the standard font for headings (sections/titles/whatever you wanna call it)? Frankly, I dont know what "font feature UppercaseSmallCaps" is supposed to mean, nor have I delved into what your \setsansfont-options are doing for you, so don't hang me up on that. If this comment doesn't help you and is too time-consuming to answer properly, no biggie. I won't be disappointed.
    – thymaro
    Jul 20, 2017 at 0:56
  • Well, UppercaseSmallCaps also renders capital letters as small caps, while SmallCaps only renders lowercase letters as small captials. Jul 21, 2017 at 6:49
  • You need to tell Beamer you are using a custom font set up, I think. Certainly you should, if you are changing the font generally.
    – cfr
    Aug 31, 2017 at 23:28

1 Answer 1

3

I really do not understand, why you need these fontfeature things just to make the frametitle in small caps.

Based on https://tex.stackexchange.com/a/149238/36296:

% !TeX TS-program = xelatex
\documentclass{beamer}

\usepackage{fontspec}

\setsansfont[
  UprightFeatures={SmallCapsFont=AlegreyaSC-Regular},
  ItalicFeatures={SmallCapsFont=AlegreyaSC-Italic},
  BoldFeatures={SmallCapsFont=AlegreyaSC-Bold},
  BoldItalicFeatures={SmallCapsFont=AlegreyaSC-BoldItalic},
  Ligatures=TeX,
]{Alegreya}

\usepackage{textcase,regexpatch}

\setbeamertemplate{frametitle}{
  \makeatletter
  \regexpatchcmd{\insertframetitle}
    {(\c{usebeamertemplate}.*)\c{fi}}
    {\c{NoCaseChange}\cB\{\1\cE\}\c{fi}}
    {}{}%
  \makeatother
  \scshape\MakeTextLowercase{\insertframetitle}
}

\begin{document}

  \begin{frame}
  \frametitle{Desired Result}

    {\scshape\MakeLowercase{Desired Result}}

    {\scshape Abcde}

%    {\addfontfeatures{Letters=UppercaseSmallCaps} Abcde}
%
%    {\addfontfeatures{Letters=SmallCaps,SmallCapsFeatures={Letters=UppercaseSmallCaps}} Abcde}

  \end{frame}

\end{document}

enter image description here

1
  • Thanks! This is a good advise. I just thought, that it would be possible with fontfeature because I want to use this at several different places, not only in the frametitle but also for the title, author, date etc. But as it would be a very similar approach, maybe it is not too much work. Let’s give it a try ... Sep 2, 2017 at 18:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .