TransWikia.com

setmainfont in book document class

TeX - LaTeX Asked by Evgeny Kuznetsov on December 21, 2020

Here it is a minimal example of a code which confused me 🙂

documentclass[12pt]{book}
usepackage[utf8]{inputenc}
usepackage{fontspec}
     setmainfont{[bpg_ucnobi.ttf]} 


begin{document}
  title{სათაური}
  author{Author}
  date{2020}
  
  maketitle
  chapter{Ch.}

end{document}

I run it by means of LuaLaTex
XeLaTex since I am going to use a georgian font as a main font.

It does not work and I do not understand why.

It seems that setmainfont does something bad.

The following is an error message I receive:

! No declaration for shape TU/(0)/m/it.
sub@sfcnt ...e forspace shapespace mandatory@arg }
                                              error@fontshape else #1{Fo...

l.16 chapter
       {Ch.}
?  

but the code creates title page with chapter commented out.

enter image description here

The code also work fine with report document class.
How to repair the code to use the font which is mentioned in the code with book document class correctly?

One Answer

The brackets around the file name are wrong. I don't have your font but try

    setmainfont{bpg_ucnobi.ttf}

Correct answer by Ulrike Fischer on December 21, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP