2

I need to typeset a few Greek letters in a document. I am using the sans serif font Carlito (provided by the package carlito) and babel to switch between Latin and Greek. There are Greek letters available in the font, but my Greek letters are still typeset with the default font.

How to get the Greek letters to use Carlito as well?

I am stuck with the classicthesis package for now, so I have to use pdfLaTeX (no LuaTeX or XeTeX).

\documentclass{article}

\usepackage[greek,english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[sfdefault,lf]{carlito}

\begin{document}

abmp
\greektext abmp

\end{document}

This is what I get:

enter image description here

Although these are avilable acoording to the font documentation (ftp://ftp.funet.fi/pub/TeX/CTAN/fonts/carlito/doc/Carlito-Regular.pdf):

enter image description here

UPDATE:

Here is the result that I am aiming (typeset with XeLaTeX):

\documentclass{article}

\usepackage{fontspec}
    \setmainfont{Carlito}

\begin{document}
abmpαβμπ
\end{document}

enter image description here

The suggestions by Steven B. Segletes got me this far, but the letters are still misaligned:

\documentclass{article}

\usepackage{graphicx,scalerel}
\usepackage[utf8]{inputenc}
\usepackage[sfdefault,lf]{carlito}

\newcommand\newalpha{\ThisStyle{%
  \setbox0=\hbox{$\SavedStyle\alpha$}\includegraphics[height=\ht0]{alpha}}}
\newcommand\newbeta{\ThisStyle{%
  \setbox0=\hbox{$\SavedStyle\beta$}\includegraphics[height=\ht0]{beta}}}
\newcommand\newmu{\ThisStyle{%
  \setbox0=\hbox{$\SavedStyle\mu$}\includegraphics[height=\ht0]{mu}}}
\newcommand\newpi{\ThisStyle{%
  \setbox0=\hbox{$\SavedStyle\pi$}\includegraphics[height=\ht0]{pi}}}

\begin{document}
abmp\newalpha\newbeta\newmu\newpi
\end{document}

enter image description here

4
  • 4
    The glyphs are there. But all the needed support files (tfm, fd, vf, end) for LGR encoding are missing. It is probably easier for you to drop classicthesis and to switch to lualatex. Commented Apr 7, 2018 at 12:51
  • 2
    Another alternative is to create (perhaps via lualatex) standalone class output containing only a single greek Carlito glyph. Then, you can set up a macro to import it into any LaTeX document via \includegraphics, in the manner of tex.stackexchange.com/questions/175443/… Commented Apr 7, 2018 at 13:11
  • Actually, I showed this exact technique recommended in my prior comment in tex.stackexchange.com/questions/400364/blackboard-bold-i/…, in the section of the answer labeled FOLLOW UP Commented Apr 7, 2018 at 14:40
  • Steven, thanks for the clever workaround. I updated the question to reflect my current progress. I got the glyphs, but they are still misaligned. Any ideas?
    – egonz
    Commented Apr 7, 2018 at 17:39

1 Answer 1

1

So this is not the exact answer to my own question, but rather a workaround that I will be using if no better solution emerges.

I have been using the textgreek package to get the Greek letters in text mode. I discovered that it automatically switches to Symbol font if Helvetica is used (helvet), because the other fonts provided by textgreek do not go well with Sans Serif in general. So I ended up redefining the needed symbols to use Helvetica instead of Carlito (which effectively changed the font to Symbol), and I also resized them the match the glyph size in Carlito.

\documentclass{article}

\usepackage{graphicx}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{textgreek}
\usepackage{helvet}
\usepackage[sfdefault,lf]{carlito}

\DeclareRobustCommand{\usehelv}[1]{{\fontfamily{phv}\selectfont\resizebox{!}{.92\height}{#1}}}
\let\oldalpha\textalpha
\renewcommand{\textalpha}{\usehelv{\oldalpha}}
\let\oldbeta\textbeta
\renewcommand{\textbeta}{\usehelv{\oldbeta}}
\let\oldpi\textpi
\renewcommand{\textpi}{\usehelv{\oldpi}}
\let\oldomega\textomega
\renewcommand{\textomega}{\usehelv{\oldomega}}

\begin{document}

abpo
\textalpha\textbeta\textpi\textomega

\end{document}

enter image description here

You must log in to answer this question.

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