From cce1149db64a8f35d7350d16018d2f6de33931d7 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Mon, 18 May 2020 16:01:10 -0500 Subject: [PATCH] doc: fix latexpdf build Building pdf was broken because of chinese characters in one of the code snippets. LaTeX stack exchange recommends use XeTeX engine instead but this causes other formatting problems (like footer using wide font) so just hacking this in for now. --- doc/api/hubs_ev3brick.inc | 8 ++++++++ doc/common/conf.py | 1 + 2 files changed, 9 insertions(+) diff --git a/doc/api/hubs_ev3brick.inc b/doc/api/hubs_ev3brick.inc index fe2db67..5c4f8ba 100644 --- a/doc/api/hubs_ev3brick.inc +++ b/doc/api/hubs_ev3brick.inc @@ -163,8 +163,16 @@ **Example: Say hello... in several ways.** + .. raw:: latex + + \begin{CJK}{UTF8}{gbsn} + .. literalinclude:: ../../pybricks-projects/snippets/ev3/screen_print/main.py + .. raw:: latex + + \end{CJK} + .. automethod:: pybricks.hubs::EV3Brick.screen.set_font **Example:** See example in :meth:`print`. diff --git a/doc/common/conf.py b/doc/common/conf.py index 87ef2b6..8bbfaa3 100644 --- a/doc/common/conf.py +++ b/doc/common/conf.py @@ -199,6 +199,7 @@ latex_elements = { # Additional stuff for the LaTeX preamble. # 'preamble': r''' + \usepackage{CJKutf8} \makeatletter \fancypagestyle{normal}{ \fancyhf{}