Hi Pieter

Le 30/09/2019 à 00:00, jfbu a écrit :
I. You have a talent for finding core LaTeX bugs. (or perhaps here
a polyglossia bug).

The problem arises from a bad interaction with "draft" option
of \includegraphics LaTeX. Turns out the draft option triggers
some typesetting in monospace font in some box. By itself
this is ok, but \py@HeaderFamily does \sffamily\bfseries

Turns out that issueing \ttfamily after the \bfseries triggers
the problem. This explains why the location of \sphinxincludegraphics
matters.

I have raised a ticket

https://github.com/reutenauer/polyglossia/issues/306

but it may be a fontspec issue rather. I am not familiar
enough with polyglossia to tell.


arrgggh ... I now understand the problem.

The GNU-FreeFont for Bold Monospace does not support the Greek Script!

The non bold monospace does support it.

This is annoying limitation of GNU FreeMono

But this give me occasion to insist that xelatex by itself
does not solve problems if you don't have appropriate fonts...

One could have hoped however that polyglossia would not
raise a build crashing error but use some substitute.

Indeed the reported error in my github polyglossia ticket
arises in strange circumstances

This being said you can probably fix it (untested) this way

latex_elements = {
    'fontpkg': r'''
\setmainfont{FreeSerif}[
  Extension      = .otf,
  UprightFont    = *,
  ItalicFont     = *Italic,
  BoldFont       = *Bold,
  BoldItalicFont = *BoldItalic
]
\setsansfont{FreeSans}[
  Extension      = .otf,
  UprightFont    = *,
  ItalicFont     = *Oblique,
  BoldFont       = *Bold,
  BoldItalicFont = *BoldOblique,
]
\setmonofont{FreeMono}[
  Extension      = .otf,
  UprightFont    = *,
  ItalicFont     = *,
  BoldFont       = *,
  BoldItalicFont = *,
]
''',
}

(and of course latex_engine = 'xelatex')

What this does is modify the monospace font to
use the normal variant even for Bold and Italic
because only the upright variant supports the Greek script.

(but my mwe at https://github.com/reutenauer/polyglossia/issues/306
throws an error only on second usage of \ttfamily,
and output looked fine and seemingly did use bold FreeMono
even for Greek --- this is all Greek to me! )


Best,

Jean-François

--
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/qmrb5l%247jjq%241%40blaine.gmane.org.

Reply via email to