Skip to content

Instantly share code, notes, and snippets.

@mpkuse
Last active May 6, 2020 12:08
Show Gist options
  • Save mpkuse/0249bc168908f2fc38289ae3113cb4a5 to your computer and use it in GitHub Desktop.
Save mpkuse/0249bc168908f2fc38289ae3113cb4a5 to your computer and use it in GitHub Desktop.
Type3 fonts error when submitting the paper

Often time I come across the type3 font type error when submitting papers to scientific conference. What it means is that you have a non-standard font in your PDF.

For the written text part, just put the following in the preamble of your .tex file and show it fine. \pdfminorversion=4

Another nasty place that these fonts turn up is in your plots. Especially the one using vector graphics. If using matplot (Python) for your plot, just put the following after your import and it fixes the problem.

import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['text.usetex'] = True

Also, sometimes you need to be a control freek and manip the legends:

SMALL_SIZE = 12
MEDIUM_SIZE = 18
BIGGER_SIZE = 24

plt.rc('font', size=SMALL_SIZE)          # controls default text sizes
plt.rc('axes', titlesize=SMALL_SIZE)     # fontsize of the axes title
plt.rc('axes', labelsize=MEDIUM_SIZE)    # fontsize of the x and y labels
plt.rc('xtick', labelsize=SMALL_SIZE)    # fontsize of the tick labels
plt.rc('ytick', labelsize=SMALL_SIZE)    # fontsize of the tick labels
plt.rc('legend', fontsize=BIGGER_SIZE)    # legend fontsize
plt.rc('figure', titlesize=BIGGER_SIZE)  # fontsize of the figure title

Also after plotting is done, you might want to always:

plt.xlabel( 'x')
plt.ylabel( 'y')
plt.legend(loc="upper left")
plt.show();

Hope this helps!

@mpkuse
Copy link
Author

mpkuse commented Jan 6, 2020

fig.tight_layout() # otherwise the right y-label is slightly clipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment