3

I know that IEEEtran is basically pdflatex only. However, I would prefer using lualatex but it gives me a couple of font warnings for this snippet:

\documentclass[conference]{IEEEtran}

%\usepackage[OT1]{fontenc} % does not help
\usepackage{fontspec,mathtools,unicode-math}
\setmainfont{TeX Gyre Termes}


\begin{document}
    bla
\end{document}

the warnings are:

Font shape `TU/ptm/m/n' undefined(Font) using `TU/lmr/m/n' instead
Font shape `TU/ptm/bx/n' undefined(Font) using `TU/ptm/m/n' instead
Font shape `TU/ptm/m/it' undefined(Font) using `TU/ptm/m/n' instead
Font shape `TU/ptm/bx/it' undefined(Font) using `TU/ptm/bx/n' instead

I tried the solutions suggested in How to compile IEEE Access templates with XeLaTeX with fontspec? and Do I need to use \usepackage[T1]{fontenc} if I use lualatex? without success.

Edit: For the conference, only the PDFs are uploaded. No sources are shared with the organizers/IEEE.

bonanza
  • 2,141
  • 2
  • 26
  • 37
  • 2
    the only (or at leat usual) reason to use a publisher class such as ieeetran is for journal publications, and if the journal is using pdftex then submitting an article using fontspec isn't going to work? – David Carlisle Apr 14 '19 at 10:43
  • @DavidCarlisle, its for a conference, I guess they just employ certain font checks that I want to pass :-) – bonanza Apr 14 '19 at 10:43
  • 2
    exactly but if they want to produce the conference proceedings and they use pdftex for that, what can they do with one paper using fontspec? – David Carlisle Apr 14 '19 at 10:45
  • @DavidCarlisle I, naively, assumed that I can ask fontspec to use exactly the same fonts, or are there more issues than that? (The conference does not get the sources, only the compiled PDF) – bonanza Apr 14 '19 at 10:46
  • 2
    if they are producing a combined proceedings including all the papers in to a single pdftex run that is trivial if everyone uses the specified document class as you simply ignore the per article preambles and run the articles together. If you supply a luatex-only document it is like supplying a Word document and totally breaks the workflow. It is probably easy to avoid the warning you post, but I would not be surprised if the resulting paper fails any submission guidelines. Oh just saw you said they only want the pdf, odd, in that case my objection doesn't apply. – David Carlisle Apr 14 '19 at 10:50
  • @DavidCarlisle maybe I failed to supply some important information: For the conference, only the final PDFs are uploaded. They don't ask/get the sources. Do still the same issues arise there? – bonanza Apr 14 '19 at 10:51
  • 1
    No if they only want the pdf that's different ... :-) – David Carlisle Apr 14 '19 at 10:52

2 Answers2

1

If you want to use the same 8bit fonts as pdftex, but just use luatex (eg to use some Lua features) you can revert to OT1 or T1 before loading the class, eg

\RequirePackage[OT1]{fontenc}
\documentclass[conference]{IEEEtran}


\usepackage{mathtools}


\begin{document}
    bla
\end{document}
David Carlisle
  • 757,742
  • Thanks so much! It leaves only a single warning if I use \RequirePackage[OT1]{fontenc} before documentclass in my snippet above: Font shape TU/ptm/m/n' undefined(Font) usingTU/lmr/m/n' instead – bonanza Apr 14 '19 at 11:01
  • 1
    I get no font warning with the posted example on texlive 2019. I do get one warning Non-PDF special ignored!{/usr/local/texlive/2019/texmf-var/fonts/map/pdftex/upd map/pdftex.map}] – David Carlisle Apr 14 '19 at 11:04
  • @DavidCarlisle see my answer, \pdfoutput is not defined. And I see a warning about fonts. – Ulrike Fischer Apr 14 '19 at 11:05
  • True, the warning is due to unicode-math I guess. There any way to still use it? – bonanza Apr 14 '19 at 11:06
  • if you use unicode math you'd need a times-like math font, stix or stix2 I suppose? the warnings are probably just in the setup and don't reflect anything in the actual document as long as you have everything consistently defined by the end of the preamble. – David Carlisle Apr 14 '19 at 11:09
  • This ended up skipping non-ascii chars, and I found out that putting the extra \setmainfont found in that answer helped. – MayeulC Jan 31 '20 at 14:14
  • As @MayeulC has rightly said, adding \RequirePackage[OT1]{fontenc} (or \RequirePackage[T1]{fontenc}) garbles Unicode characters in the input, such as copyright symbols, en-dashes and non-breaking spaces. \setmainfont{TeX Gyre Termes} leads to infinite compilation in my case. Any case we can get the same result as in pdflatex in terms of (absence of) font warnings and Unicode input? I thought fonts and unicode support were one of the strengths of lualatex ;) – bers Nov 09 '20 at 15:10
  • @bers yes unicode fonts is one of the strength of luatex but this question asks (for some reason) how to disable that and use 8bit tex fonts. The question is how to use classic tex fonts with luatex, it's then not that surprising that unicpde is broken (use luainputenc package if you want similar behaviour to inputenc with pdftex) – David Carlisle Nov 09 '20 at 15:26
  • \RequirePackage[utf8]{luainputenc} is working, thank you! "for some reason" is easy to explain: some people (including me) want to use IEEEtran, including the fonts it proposes, with lualatex. If there was another way of getting TU/ptm/m/n in lualatex, I'd happily use that, but well, I only found this question and this answer. – bers Nov 10 '20 at 09:34
  • @bers ptm is just times roman (but usually configured to use a clone so it can use embedded fonts) so the usual way would be \setmainfont{Times Roman} (or Times New Roman or TeX Gyre Termes or whatever clone you wanted to embed. – David Carlisle Nov 10 '20 at 09:51
0

The warnings are in the middle of the class loading. The class tries to use a bold and italic font to set some font dimens. Imho you can simply ignore it, fontspec will set its own fontdimens anyway when you load TeX Gyre Termes.

But you should add before \documentclass this so that the class correctly tests for pdf output:

  \let\pdfoutput \outputmode
Ulrike Fischer
  • 327,261
  • Does that mean that in the final PDF the correct font is used (and the PDF checker used by IEEE won't complain) ? – bonanza Apr 14 '19 at 11:08
  • Depends on what you mean by the "correct font". It will use the texgyretermes-regular.otf and this is certainly not the same font a standard IEEE document uses, so if they check for the font they won't be happy. – Ulrike Fischer Apr 14 '19 at 11:13