0

I'd like to load a new latex font, the Black Chancery on Overleaf. How must I do? Thank you so much

First Edit: I'm sorry, but I'm forced to return onto this problem. As Sebastiano Molina told me, I followed his promps in the comments below, and also the Paolo Gessler's answer. What I did is this:

I searched in an italian site the Blach Chancery font, HERE;

I loaded the BLKCHCRY.TTF onto XeLaTeX;

And I tried to compile the code below, but Overleaf gives me 5 ERRORS. Where did I wrong?

\documentclass{book}
\usepackage[a4paper,top=3cm,bottom=3cm,left=1.5cm,right=1.5cm]{geometry}

\usepackage{mathtools}
\usepackage{mathspec}

\setmathcal[
    Path = fonts/,
    Extension = .ttf
]{BLKCHCRY} %Here Overleaf gives me ERROR

\usepackage[upint]{stix}

\title{BLKCHCRY}

\begin{document}

\maketitle

\LARGE

\section{Introduction}


\bigskip

% you need to be in math mode and use \mathfrak
\( \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

\noindent This is regular text.

\end{document}

Thank you so much, again!

Second Edit: I add this: My goal is implement tcolorbox, extarrows, ..., many other packages and the Black Chancery-font on Overleaf. What Overleaf-mode I must use to implement all I need?

I'd like to precisize that the Black Chancery-font will not be my main font. But I'll use it only for a few things in mathmode!! Thankx again

Third Edit: I thank all you for answering me, but Overleaf still gives me 1 error, i.e.: Package fontspec Error: The font "BLKCHCRY" cannot be found. (see the code, row 10), as in this screenshot:

enter image description here

Where did I wrong? Thank you so much again!

2
  • 3
    (I'm on support staff at Overleaf.) We have instructions for this here: overleaf.com/learn/latex/Questions/… If you've tried this and something didn't work, please post a complete example document of what you had tried, so we can take a closer look. Mar 15 at 20:10
  • 1
    You have the font in a different path than the one you specified. You have it in fonts/BLKCHCRY/ but your code expects it to be in fonts/. Either move the .ttf file into fonts/ or edit Path = fonts/, to be Path = fonts/BLKCHCRY/. (But not both, of course.)
    – frabjous
    May 13 at 23:14

3 Answers 3

3

You're using a command \BLKCHCRY which you never defined, because you only set it as your main font.

You shouldn't set it as your main font if you only want to use it in math mode. You especially shouldn't set it as your main font and then load stix as your main font right afterwards.

(You might want to switch to use the .otf version of the stix fonts for XeLaTeX, but I don't know offhand if they're available on Overleaf, since I don't use Overleaf.)

If you only want to use it in math mode, you should use mathspec to set it as one of your math fonts: the mathcal or mathfrak fonts probably make the most sense.

Since mathtools loads amsmath, it needs to be loaded before mathspec.

You don't need \inputenc for XeLaTeX.

\documentclass{article}

\usepackage{mathtools}
\usepackage{mathspec}

\usepackage[upint]{stix}

\setmathcal[
    Path = fonts/,
    Extension = .ttf
]{BLKCHCRY}

\title{BLKCHCRY}

\begin{document}

\maketitle

\section{Introduction}


\bigskip

% you need to be in math mode and use \mathfrak
\( \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

\noindent This is regular text.

\end{document}

black chancery

Compile with XeLaTeX and make sure BLCKCHCRY.ttf is in the fonts/ subfolder of your project.

You can use \setmathfrak with \mathfrak instead if you want to set it as the math fraktur font.

2
  • Thank you for answering me. I edited my question, adding a photo.
    – Puck
    May 13 at 23:06
  • 1
    I was expecting that the file should be in fonts/. You have it in fonts/BLKCHCRY/ instead. Either move the .ttf file into fonts/ or edit Path = fonts/, to be Path = fonts/BLKCHCRY/. (But not both, of course.)
    – frabjous
    May 13 at 23:13
1

First, you have to change the compiler to XeLaTeX. Then, create a fonts folder in your Overleaf project and upload the font into the folder. Loading the mathspec library, you can put this on the preamble

\usepackage{mathspec}

\setmainfont[
    Path = fonts/ ,
    Extension = .ttf ,
]{BLKCHCRY}

Done.

5
  • Thanx, I'm using pdflatex. And I would not like to use xelatex. Is it enough to follow what written in the link that Paolo Gessler sended? Thanks again
    – Puck
    Mar 15 at 20:34
  • 3
    @Puck - Black Chancery is an opentype font, and pdflatex just doesn't provide the capabilities needed to work natively with opentype fonts. That's why you're getting the advice to use XeLaTeX; by the way, LuaLaTeX will work as well.
    – Mico
    Mar 15 at 22:07
  • @Sebastiano Molina: Your answer is not ok because XeLaTeX does not found BLKCHCRY. Futhermore XeLaTeX does not recognize some packages such as tcolorbox and extarrows.
    – Puck
    Mar 16 at 7:28
  • By BLKCHCRY i meant that the font .TTF was called BLKCHCRY.ttf` , as it was called when I downloaded it. If it is called BlackChancery.ttf, then you should put BlackChancery as the argument. Mar 20 at 1:30
  • If you wanted to stick with pdflatex, URW Chancery is available, though obviously it's not quite the same.
    – frabjous
    May 13 at 19:20
1

An alternative is to set Black Chancery as your \mathcal font, with unicode-math. You seem to want to use STIX Two for all other math. (Warning: untested, but it should work in either XeLaTeX or LuaLaTeX.)

This also scales the font to match the height of your other fonts. Consider adding Scale=MatchUppercase to your \setmathcal command if you go with the mathspec solution, or your \mathcal symbols will be incongruously large.

\documentclass{book}
\usepackage[a4paper,top=3cm,bottom=3cm,left=1.5cm,right=1.5cm]{geometry}

\usepackage{mathtools}
\usepackage{unicode-math}

\setmainfont{STIX Two Text}
\setmathfont{STIX Two Math}[
  StylisticSet=8 ] % Upright integrals
\setmathfont{BLKCHCRY}[
    range = cal,
    Scale = MatchUppercase,
    Path = fonts/,
    Extension = .TTF]

\title{BLKCHCRY}

\begin{document}

\maketitle

\section{Introduction}


\bigskip

% you need to be in math mode and use \mathfrak
\( \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \)

\noindent This is regular text.

\end{document}
1
  • Ok, it's good because it correctly works.
    – Puck
    May 14 at 0:21

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.