0

I am unable to change the font from the default font, e.g. when I comment in any of the font packages in the following code:

\documentclass[a4paper]{article}

% \usepackage{mathptmx} % \usepackage{tgbonum} % \usepackage{tgtermes}

\begin{document} Testing Font. TESTING FONT. \end{document}

I am using Sublime Text editor and compiling with the following script commands:

"linux" : 
{
  "script_commands": 
  [
    "lualatex -shell-escape -synctex=1 -interaction=nonstopmode",
    "bibtex",
    "lualatex -shell-escape -synctex=1 -interaction=nonstopmode",
    "lualatex -shell-escape -synctex=1 -interaction=nonstopmode",
    "makeindex $file_base_name.nlo -s nomencl.ist -o $file_base_name.nls",
    "lualatex -shell-escape -synctex=1 -interaction=nonstopmode"
  ]
}

Interestingly, if I compile with the in-built "PdfLaTeX" command in Sublime, I can successfully change the font. I am fairly new to LaTeX, so I may be missing something really obvious here. Any help would be much appreciated!

niran90
  • 204
  • 1
    those font packages are designed for 8bit versions of the fonts, for pdflatex. With lualatex you can use fontspec and access the tex gyre fonts directly. What fonts do you wnat to use? – David Carlisle Jun 16 '20 at 18:35
  • 1
    You can also (as per @DavidCarlisle 's answer https://tex.stackexchange.com/a/484776) put \usepackage[OT1]{fontenc} before your font package to use 8bit encodings with LuaLaTeX - but if you have the font that you want (for example Times New Roman or a variant of that) installed on your system then it is preferable to use the font the 'modern' way, i.e., \usepackage{fontenc} and \setmainfont{Times New Roman}. – Marijn Jun 16 '20 at 18:38
  • 1
    @Marijn OT1 is 7bit T1 would at least let you use 8bit accents and reasonable hyphenation – David Carlisle Jun 16 '20 at 18:47
  • 1
    @DavidCarlisle you're right as usual :) I went too far back in time. \usepackage[T1]{fontenc} also works (and works better than OT1) for these packages. – Marijn Jun 16 '20 at 18:55
  • 1
    @Marijn I noticed afterwards you'd copied the OT1 from that older answer. Very unreliable source:-) – David Carlisle Jun 16 '20 at 18:58
  • @Marijn - Thanks so much :) \usepackage[T1]{fontenc} before the font package works perfectly! – niran90 Jun 16 '20 at 20:05

0 Answers0