Site icon R-bloggers

Using Custom TeX Fonts (Lucida and Minion Pro) in Quarto

[This article was first published on pacha.dev/blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
< section id="motivation" class="level2">

Motivation

I found a copy of Lucida and Minion Pro that I bought back in 2013 and that I had on my Google Drive. I really like these s but the setup is a bit challenging. Here I will show how to use them in a Quarto document in 2023.

< section id="about-the-s" class="level2">

About the s

See varsityblues for a set of complete LaTeX templates to be used with R Markdown or Quarto.

You can compare the differences here:

Lucida is a commercial that can be purchased from TUG. After purchasing the , you will receive zip files with the s and the macros (lucida-type1.zip and lucimacros.zip).

Minion Pro comes with Adobe Illustrator or can be purchased by separate from Adobe.

If you email me, I can send you the PFB files for Minion Pro if you can prove that you have legally obtained the . I believe in Open Source, but I also believe in respecting the rights of the creators of the s.

< section id="instructions" class="level2">

Instructions

< section id="clone-the-repository" class="level3">

Clone the repository

I made a repository with a 1-line script to get the setup done.

Either

git clone --depth 1 https://github.com/pachadotdev/lucida-minion-tex.git

or

git clone --depth 1 git@github.com:pachadotdev/lucida-minion-tex.git
< section id="copy-lucida-files" class="level3">

Copy Lucida files

Put the corresponding zip files for Lucida in the root folder of this repository. These files are lucida-type1.zip and lucimacros.zip.

< section id="copy-minion-pro-files" class="level3">

Copy Minion Pro files

< section id="if-you-only-have-the--in-otf-format" class="level4">

If you only have the in OTF format

Create the minion folder in the root of this repository and put the Minion Pro s in OTF format into it. This corresponds to the next files:

MinionPro-BoldCnIt.otf
MinionPro-BoldCn.otf
MinionPro-BoldIt.otf
MinionPro-Bold.otf
MinionPro-It.otf
MinionPro-MediumIt.otf
MinionPro-Medium.otf
MinionPro-Regular.otf
MinionPro-SemiboldIt.otf
MinionPro-Semibold.otf

If you are on Ubuntu/Debian, the script from the next section will install lcdf-typetools, which provides cfftot1 and t1dotlessj and allow to convert the s to the required format for TeX.

For other Linux and Unix systems (i.e., Mac), you’ll need to install lcdf-typetools.

# Fedora/RedHat
sudo dnf install lcdf-typetools

# Mac
brew install lcdf-typetools

# I don't know about other Linux/Unix systems
< section id="if-you-have-the--in-pfb-format" class="level4">

If you have the in PFB format

Copy the PFB files to the minion-nos/type1/adobe/MinionPro/.

< section id="run-the-script-for-linux-and-also-mac-or-unix" class="level3">

Run the script for Linux (and also Mac or Unix)

Run the script install.sh and select the available options:

  1. Install Lucida
  2. Install Minion Pro
  3. Install Both
cd lucida-minion-tex
bash install.sh
< section id="steps-for-windows" class="level3">

Steps for Windows

  1. Create the C:\texs folder.
  2. Unzip the lucida-type1.zip and lucimacros.zip files into C:\texs.
  3. Copy minion-no contents to folder to C:\texs, unzip all the zip files and then delete the zip files.
  4. Go to the Miktex configuration (Start > Programs > MiKTeX > Maintenance).
  5. Add the folder created in the first step (see image 1).
  6. Update the FNDB and formats (see image 2) don’t forget to click “apply” and then “ok”.
  7. Restart the computer.

To convert the from OTF to TeX format you need to run something of the form:

@echo off

echo "Creating PostScript s ..."

for %%i in (minion/*.otf) do cfftot1    minion/otf/%%i minion-no/pfb/%%~ni.pfb
for %%i in (minion/*.otf) do t1dotlessj minion/pfb/%%~ni.pfb minion-no/pfb/%%~niLCDFJ.pfb

I don’t use Windows, so this is what my imagination says is the adaption from the Linux script.

To leave a comment for the author, please follow the link and comment on their blog: pacha.dev/blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Exit mobile version