0

Overleaf is using SourceSerifPro v1.2 which does not include the italic font.

v1.4 does include italic and is provided as a package on CTAN

Overleaf allows for custom packages to be installed by uploading a .sty file. (https://www.overleaf.com/learn/how-to/What_packages_do_you_support%3F)

I've tried uploading the package from CTAN to overleaf but it's not recognized.

Is there any easy way to use the v1.4 package from CTAN on overleaf so I don't need to resort to building the fonts and using a package such as fontspec

(https://www.overleaf.com/learn/latex/Questions/I_have_a_custom_font_I%27d_like_to_load_to_my_document._How_can_I_do_this%3F)

3
  • 1
    You would also need to upload all the required .fd, .tfm etc files in the updated version. As there are a lot of such files I'm not sure if it'll be really feasible. If you can use XeLaTeX or LuaLaTeX, then using fontspec would be the easiest solution: you just need to upload the necessary .ttf files, and you don't need to build any font files yourself.
    – imnothere
    Jun 22, 2019 at 3:48
  • @LianTzeLim They are all uploaded .... currently they are in a directory in the root called sourceserifpro which contains subdirectories tex, doc and fonts
    – agf1997
    Jun 22, 2019 at 13:57
  • In that case you can add a latexmkrc file to your project, similar to this answer here: tex.stackexchange.com/a/451049/226 only replace ./fontawesome with sourceserifpro/fonts. Also add \pdfmapfile{+SourceSerifPro.map} to your .tex file's preamble. If you can't quite get it to work, it may be best to email [email protected] with your project's URL so that the Overleaf support team (of which I'm a member) can have a closer look.
    – imnothere
    Jun 22, 2019 at 14:11

1 Answer 1

0

Overleaf Tech Support was able to provide a workable solution.

The solution was similar to the solution described here but sourceserifpro requires slightly different handling.

Adding the following to latexmkrc enables the T1 encoded fonts.

$ENV{'TEXINPUTS'}='./sourceserifpro/tex/:' . $ENV{'TEXINPUTS'};
$ENV{'TFMFONTS'}='./sourceserifpro/fonts/:' . $ENV{'TFMFONTS'};
$ENV{'ENCFONTS'}='./sourceserifpro/fonts/:' . $ENV{'ENCFONTS'};
$ENV{'T1FONTS'}='./sourceserifpro/fonts/:' . $ENV{'T1FONTS'};
$ENV{'VFFONTS'}='./sourceserifpro/fonts/:' . $ENV{'VFFONTS'};
$ENV{'TEXFONTMAPS'}='./sourceserifpro/fonts/:' . $ENV{'TEXFONTMAPS'};

The $ENV{'VFFONTS'} line is not included in the previous solution.

Likewise, the following lines should be added to the preamble, changing options as desired.

\pdfmapfile{+SourceSerifPro.map}
\usepackage[default,semibold,osf]{sourceserifpro}

Unfortunately, ligatures do no work correctly. Some are render and a box with an x in it, others are rendered totally incorrectly. For instance, the characters ff are being replaced with the ft ligature.

Note, all the above was compiled with pdfLaTeX

The ultimate solution was to switch to the XeLaTex compiler and to use the OpenType versions of sourceserifpro.

In order to enable the OpenType version, the contents of latexmkrc was changed to

$ENV{'TEXINPUTS'}='./sourceserifpro/tex/:' . $ENV{'TEXINPUTS'};
$ENV{'TFMFONTS'}='./sourceserifpro/fonts/:' . $ENV{'TFMFONTS'};
$ENV{'ENCFONTS'}='./sourceserifpro/fonts/:' . $ENV{'ENCFONTS'};
$ENV{'T1FONTS'}='./sourceserifpro/fonts/:' . $ENV{'T1FONTS'};
$ENV{'VFFONTS'}='./sourceserifpro/fonts/:' . $ENV{'VFFONTS'};
$ENV{'TEXFONTMAPS'}='./sourceserifpro/fonts/:' . $ENV{'TEXFONTMAPS'};
$ENV{'OPENTYPEFONTS'}='./sourceserifpro/fonts/:' . $ENV{'OPENTYPEFONTS'};

Adding the $ENV{'OPENTYPEFONTS'} line to the T1 solution.

The preamble lines from the T1 solution are still required in the primary .tex file.

The downside of switching to XeLaTeX is that many of the features of microtype are not supported.

My project appears to also work with LuaLaTeX. This means that more, but sadly not all, of the pdfLaTeX microtype features are working. In order to get it to compile with LuaLaTeX you must delete the aforementioned line

\pdfmapfile{+SourceSerifPro.map}

as it is not needed with LuaLaTeX.

You must log in to answer this question.

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