4

I just found out today about the fontspec package, which I find very useful for fonts that I have installed system-wide.

I'm a big fan of handwriting-like fonts and I happen to love Pecita. So much that I am using it for some articles that I write, for personal use. However, it doesn't come with Bold weight, so I created one for myself, using FontForge. All is going well, OS X recognises this weight now (that I included in the family Pecita), except for LaTeX... So I can use Pecita Bold in Pages, say, but not in LaTeX.

What am I doing wrong? The font appears to be good, it is listed in FontBook (the family Pecita now has Regular and Bold weights), but if I use \usepackage{fontspec} \setmainfont{Pecita}, it doesn't use bold when I call it with {\bf Some text that I want in bold}

Here's my entire document to see if there are any redundancies or conflicts:

\documentclass{article}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{amsthm}
\usepackage[margin=1.3in]{geometry}
\usepackage{enumerate}
\usepackage{color}
\usepackage{graphicx}
\usepackage[all]{xy}
\usepackage{titlesec}
\titleformat*{\section}{\large\bfseries}
\usepackage{xcolor}
\usepackage{framed}
\usepackage{hyperref}
\usepackage[romanian]{babel}
\usepackage{fontspec}
\setmainfont{Pecita}
\usepackage{eulervm}
\begin{document}
\section{This should be bold}
\textbf{This also should be bold}
This is not bold.
\end{document}

If it matters, I am using OS X 10.10.1 with MacTeX and Texpad.

Please excuse me if there is something wrong with my post, but it's my first here.

Thank you for your attention.

  • Welcome to TeX.SX! Please make your code a complete example starting with \documentclass{...}, and ending with \end{document}. That may seem tedious to you, but it helps to make the question as clear as possible. As well, notice that \bf command is obsolete. – yo' Nov 23 '14 at 14:59
  • Thank you very much, Thérèse. You're right in using changes in size or color, but I only wanted the artificial bold for names of theorems, for example. Your suggestion works, nonetheless. I consider my question answered. Thank you again! – Adrian Manea Nov 23 '14 at 15:43
  • I have changed my comment to an answer just to keep things neat around here. – Thérèse Nov 23 '14 at 16:23
2

When fontspec doesn’t find the bold or italic of a font, you sometimes have to help it along. If the font’s name is Pecita Bold, \setmainfont{Pecita}[BoldFont={* Bold}] should work (in older versions of fontspec, use \setmainfont[BoldFont={* Bold}]{Pecita}). Section 5.1 of the fontspec documentation gives more information about this.

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.