7

I find Alegreya Sans especially readable for presentations, in part because it has real italics and not just an oblique shape. However, itemization is problematic.

Although the default, triangular bullets of beamer work as expected, the circle, ball, and square options produce miniature bullets, and the latter two are lower than they should be.

For example:

\documentclass{beamer}
\usefonttheme{professionalfonts}
\usepackage[T1]{fontenc}
\usepackage{AlegreyaSans}
\begin{document}
\begin{frame}
  \frametitle{Tiny Bullets}

  \structure{default}
  \begin{itemize}
  \item An item.
  \end{itemize}

  \structure{circle}
  \setbeamertemplate{itemize items}[circle]
  \begin{itemize}
  \item An item.
  \end{itemize}

  \structure{ball}
  \setbeamertemplate{itemize items}[ball]
  \begin{itemize}
  \item Another item.
  \end{itemize}

  \structure{square}
  \setbeamertemplate{itemize items}[square]
  \begin{itemize}
  \item Yet another item.
  \end{itemize}
\end{frame}
\end{document}

output of pdftex

I get the same results with luatex, but xetex stumbles only on the circle:

\documentclass{beamer}
\usepackage{fontspec}
\usefonttheme{professionalfonts}
\setsansfont{Alegreya Sans}
\begin{document}
\begin{frame}
  \frametitle{Tiny Bullets}

  \structure{default}
  \begin{itemize}
  \item An item.
  \end{itemize}

  \structure{circle}
  \setbeamertemplate{itemize items}[circle]
  \begin{itemize}
  \item An item.
  \end{itemize}

  \structure{ball}
  \setbeamertemplate{itemize items}[ball]
  \begin{itemize}
  \item Another item.
  \end{itemize}

  \structure{square}
  \setbeamertemplate{itemize items}[square]
  \begin{itemize}
  \item Yet another item.
  \end{itemize}
\end{frame}
\end{document}

output of xetex

In luatex, I can use luacode to gain access to the font’s ornaments, among which are circles and squares:

\documentclass{beamer}
\usepackage{fontspec,luacode}
% http://tex.stackexchange.com/a/120762/7883
\begin{luacode}
  documentdata       = documentdata or { }

  local stringformat = string.format
  local texsprint    = tex.sprint
  local slot_of_name = luaotfload.aux.slot_of_name

  documentdata.fontchar = function (chr)
local chr = slot_of_name(font.current(), chr, false)
if chr and type(chr) == "number" then
  texsprint
    (stringformat ([[\char"%X]], chr))
end
  end
\end{luacode}
\def\fontchar#1{\directlua{documentdata.fontchar "#1"}}
\usefonttheme{professionalfonts}
\setsansfont{Alegreya Sans}
\defbeamertemplate{itemize item}{cornament}{\fontchar{circle1}}
\defbeamertemplate{itemize item}{sornament}{\fontchar{square1}}
\begin{document}
\begin{frame}
  \frametitle{Custom Bullets}

  \structure{circle}
  \setbeamertemplate{itemize item}[cornament]
  \begin{itemize}
  \item An item.
  \end{itemize}

  \structure{square}
  \setbeamertemplate{itemize item}[sornament]
  \begin{itemize}
  \item Another item.
  \end{itemize}
\end{frame}
\end{document}

output of luatex

Any ideas why this is happening? It makes no difference whether I use the OpenType fonts provided in TeX Live (for reasons unknown, the package author created them by converting google’s Truetype fonts) or the OpenType fonts straight from the foundry.

Thérèse
  • 12,679
  • 3
    The problem seems to be in the fact that the Alegreya font has a grossly wrong value of the ex: 1ex at 11pt size (the font used by beamer) is 2.04764pt; it's 1.87pt at 10pt size, less than half of what it should be. The square is defined as \vrule width 1ex height 1ex, so this explains the problem in this case. – egreg Feb 25 '14 at 20:47
  • Please, make a bug report. – egreg Feb 26 '14 at 12:46
  • Thanks, @egreg, for your diagnosis of the problem. I’ve sent both the foundry and Bob Tennent a link to this discussion. – Thérèse Feb 26 '14 at 13:12

1 Answers1

6

Use

\documentclass{beamer}
\usefonttheme{professionalfonts}
\usepackage[T1]{fontenc}
\usepackage{AlegreyaSans}
\AtBeginDocument{%
  \fontdimen5\font=\fontcharht\font`\x}
\begin{document}
[ ... ]

enter image description here

For the circle define an own mycircle template and use that instead of `circle'

\defbeamertemplate{itemize item}{mycircle}{\scalebox{10}{\raisebox{-0.5ex}{\textbullet}}}%% Value 10 only for demo  :-)
\defbeamertemplate{itemize subitem}{mycircle}{\huge\raisebox{-0.5ex}{\textbullet}}
\defbeamertemplate{itemize subsubitem}{mycircle}{\huge\raisebox{-0.5ex}{\textbullet}}

and then \structure{circle}

 \setbeamertemplate{itemize items}[mycircle]
 \begin{itemize}

enter image description here

  • Thank you, @Herbert. This is a big step forward: now pdftex and luatex get the ball and the square right, as xetex always did, but all three engines still give me a miniature circle. I usually choose the ball anyway, so this is very helpful. – Thérèse Feb 25 '14 at 21:58
  • see my edit for the circles –  Feb 25 '14 at 22:13
  • Hmmm. I’m not seeing any change in the circles. Never knew that circles were so stubborn. – Thérèse Feb 25 '14 at 22:25
  • it is a problem with the font! See my edit for a drastic change :-)) –  Feb 26 '14 at 08:26