3b1b / manim

Animation engine for explanatory math videos
MIT License
62.04k stars 5.77k forks source link

Is it possible to use new fonts in manim ? #525

Closed GrouperTamaki closed 5 years ago

GrouperTamaki commented 5 years ago

Hello, I'm a Japanese and I want to use Japanese fonts in manim. So, I made and tried a Japanese-font-testing-program called "JapaneseTextTest.py" as follows:

from big_ol_pile_of_manim_imports import *

class makeText(Scene):
    def construct(self):

        line = TextMobject("おはよう")

        self.play(Write(line))

But I have a trouble in running this.

...-...-MacBook-Pro:manim kasagonaoki$ python -m manim JapaneseTextTest.py makeText -pl Writing "\centering おはよう" to ./files/Tex/fbe69ee0c8bd70ec.tex

Traceback (most recent call last): File "/Users/kasagonaoki/animation/manim/manimlib/extract_scene.py", line 150, in main scene = SceneClass(scene_kwargs) File "/Users/kasagonaoki/animation/manim/manimlib/scene/scene.py", line 52, in init self.construct() File "JapaneseTextTest.py", line 6, in construct line = TextMobject("おはよう") File "/Users/kasagonaoki/animation/manim/manimlib/mobject/svg/tex_mobject.py", line 144, in init self, self.arg_separator.join(tex_strings), kwargs File "/Users/kasagonaoki/animation/manim/manimlib/mobject/svg/tex_mobject.py", line 44, in init self.template_tex_file_body File "/Users/kasagonaoki/animation/manim/manimlib/utils/tex_file_writing.py", line 19, in tex_to_svg_file dvi_file = tex_to_dvi(tex_file) File "/Users/kasagonaoki/animation/manim/manimlib/utils/tex_file_writing.py", line 67, in tex_to_dvi "See log output above or the log file: %s" % log_file) Exception: Latex error converting to dvi. See log output above or the log file: ./files/Tex/fbe69ee0c8bd70ec.log

The log file is as follows:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=latex 2019.5.4) 4 MAY 2019 19:06 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **./files/Tex/fbe69ee0c8bd70ec.tex (./files/Tex/fbe69ee0c8bd70ec.tex LaTeX2e <2018-12-01> (/usr/local/texlive/2019/texmf-dist/tex/latex/standalone/standalone.cls Document Class: standalone 2018/03/26 v1.3a Class to compile TeX sub-files stan dalone (/usr/local/texlive/2019/texmf-dist/tex/latex/tools/shellesc.sty Package: shellesc 2016/06/07 v0.02a unified shell escape interface for LaTeX Package shellesc Info: Restricted shell escape enabled on input line 69. ) (/usr/local/texlive/2019/texmf-dist/tex/generic/oberdiek/ifluatex.sty Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO) Package ifluatex Info: LuaTeX not detected. ) (/usr/local/texlive/2019/texmf-dist/tex/generic/oberdiek/ifpdf.sty Package: ifpdf 2018/09/07 v3.3 Provides the ifpdf switch ) (/usr/local/texlive/2019/texmf-dist/tex/generic/ifxetex/ifxetex.sty Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional ) (/usr/local/texlive/2019/texmf-dist/tex/latex/xkeyval/xkeyval.sty Package: xkeyval 2014/12/03 v2.7a package option processing (HA) (/usr/local/texlive/2019/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/local /texlive/2019/texmf-dist/tex/generic/xkeyval/xkvutils.tex \XKV@toks=\toks14 \XKV@tempa@toks=\toks15 (/usr/local/texlive/2019/texmf-dist/tex/generic/xkeyval/keyval.tex)) \XKV@depth=\count80 File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA) )) \sa@internal=\count81 \c@sapage=\count82 (/usr/local/texlive/2019/texmf-dist/tex/latex/standalone/standalone.cfg File: standalone.cfg 2018/03/26 v1.3a Default configuration file for 'standalon e' class ) (/usr/local/texlive/2019/texmf-dist/tex/latex/base/article.cls Document Class: article 2018/09/03 v1.4i Standard LaTeX document class (/usr/local/texlive/2019/texmf-dist/tex/latex/base/size10.clo File: size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option) ) \c@part=\count83 \c@section=\count84 \c@subsection=\count85 \c@subsubsection=\count86 \c@paragraph=\count87 \c@subparagraph=\count88 \c@figure=\count89 \c@table=\count90 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (/usr/local/texlive/2019/texmf-dist/tex/latex/preview/preview.sty Package: preview 2017/04/24 11.91 (AUCTeX/preview-latex) (/usr/local/texlive/2019/texmf-dist/tex/generic/luatex85/luatex85.sty Package: luatex85 2016/06/15 v1.4 pdftex aliases for luatex ) (/usr/local/texlive/2019/texmf-dist/tex/latex/preview/prtightpage.def \PreviewBorder=\dimen103 ) \pr@snippet=\count91 \pr@box=\box27 \pr@output=\toks16 )) (/usr/local/texlive/2019/texmf-dist/tex/generic/babel/babel.sty Package: babel 2019/04/22 3.30 The Babel package (/usr/local/texlive/2019/texmf-dist/tex/generic/babel/switch.def File: switch.def 2019/04/22 3.30 Babel switching mechanism ) (/usr/local/texlive/2019/texmf-dist/tex/generic/babel-english/english.ldf Language: english 2017/06/06 v3.3r English support from the babel system (/usr/local/texlive/2019/texmf-dist/tex/generic/babel/babel.def File: babel.def 2019/04/22 3.30 Babel common definitions \babel@savecnt=\count92 \U@D=\dimen104 (/usr/local/texlive/2019/texmf-dist/tex/generic/babel/txtbabel.def) \bbl@dirlevel=\count93 ) \l@canadian = a dialect from \language\l@american \l@australian = a dialect from \language\l@british \l@newzealand = a dialect from \language\l@british )) (/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsmath.sty Package: amsmath 2018/12/01 v2.17b AMS math features \@mathmargin=\skip43 For additional information on amsmath, use the ?' option. (/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amstext.sty Package: amstext 2000/06/29 v2.01 AMS text (/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 generic functions \@emptytoks=\toks17 \ex@=\dimen105 )) (/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsbsy.sty Package: amsbsy 1999/11/29 v1.2d Bold Symbols \pmbraise@=\dimen106 ) (/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsopn.sty Package: amsopn 2016/03/08 v2.02 operator names ) \inf@bad=\count94 LaTeX Info: Redefining \frac on input line 223. \uproot@=\count95 \leftroot@=\count96 LaTeX Info: Redefining \overline on input line 385. \classnum@=\count97 \DOTSCASE@=\count98 LaTeX Info: Redefining \ldots on input line 482. LaTeX Info: Redefining \dots on input line 485. LaTeX Info: Redefining \cdots on input line 606. \Mathstrutbox@=\box28 \strutbox@=\box29 \big@size=\dimen107 LaTeX Font Info: Redeclaring font encoding OML on input line 729. LaTeX Font Info: Redeclaring font encoding OMS on input line 730. \macc@depth=\count99 \c@MaxMatrixCols=\count100 \dotsspace@=\muskip10 \c@parentequation=\count101 \dspbrk@lvl=\count102 \tag@help=\toks18 \row@=\count103 \column@=\count104 \maxfields@=\count105 \andhelp@=\toks19 \eqnshift@=\dimen108 \alignsep@=\dimen109 \tagshift@=\dimen110 \tagwidth@=\dimen111 \totwidth@=\dimen112 \lineht@=\dimen113 \@envbody=\toks20 \multlinegap=\skip44 \multlinetaggap=\skip45 \mathdisplay@stack=\toks21 LaTeX Info: Redefining \[ on input line 2844. LaTeX Info: Redefining \] on input line 2845. ) (/usr/local/texlive/2019/texmf-dist/tex/latex/amsfonts/amssymb.sty Package: amssymb 2013/01/14 v3.01 AMS font symbols (/usr/local/texlive/2019/texmf-dist/tex/latex/amsfonts/amsfonts.sty Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support \symAMSa=\mathgroup4 \symAMSb=\mathgroup5 LaTeX Font Info: Overwriting math alphabet\mathfrak' in version `bold' (Font) U/euf/m/n --> U/euf/b/n on input line 106. )) (/usr/local/texlive/2019/texmf-dist/tex/latex/doublestroke/dsfont.sty Package: dsfont 1995/08/01 v0.1 Double stroke roman fonts ) (/usr/local/texlive/2019/texmf-dist/tex/latex/setspace/setspace.sty Package: setspace 2011/12/19 v6.7a set line spacing ) (/usr/local/texlive/2019/texmf-dist/tex/latex/tipa/tipa.sty Package: tipa 2002/08/08 TIPA version 1.1 (/usr/local/texlive/2019/texmf-dist/tex/latex/base/fontenc.sty Package: fontenc 2018/08/11 v2.0j Standard LaTeX package (/usr/local/texlive/2019/texmf-dist/tex/latex/tipa/t3enc.def File: t3enc.def 2001/12/31 T3 encoding Now handling font encoding T3 ... ... no UTF-8 mapping file for font encoding T3 ) (/usr/local/texlive/2019/texmf-dist/tex/latex/base/ot1enc.def File: ot1enc.def 2018/08/11 v2.0j Standard LaTeX file LaTeX Font Info: Redeclaring font encoding OT1 on input line 48. ))) (/usr/local/texlive/2019/texmf-dist/tex/latex/relsize/relsize.sty Package: relsize 2013/03/29 ver 4.1 ) (/usr/local/texlive/2019/texmf-dist/tex/latex/base/textcomp.sty Package: textcomp 2018/08/11 v2.0j Standard LaTeX package Package textcomp Info: Sub-encoding information: (textcomp) 5 = only ISO-Adobe without \textcurrency (textcomp) 4 = 5 + \texteuro (textcomp) 3 = 4 + \textohm (textcomp) 2 = 3 + \textestimated + \textcurrency (textcomp) 1 = TS1 - \textcircled - \t (textcomp) 0 = TS1 (full) (textcomp) Font families with sub-encoding setting implement (textcomp) only a restricted character set as indicated. (textcomp) Family '?' is the default used for unknown fonts. (textcomp) See the documentation for details. Package textcomp Info: Setting ? sub-encoding to TS1/1 on input line 79. (/usr/local/texlive/2019/texmf-dist/tex/latex/base/ts1enc.def File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file Now handling font encoding TS1 ... ... processing UTF-8 mapping file for font encoding TS1 (/usr/local/texlive/2019/texmf-dist/tex/latex/base/ts1enc.dfu File: ts1enc.dfu 2018/10/05 v1.2f UTF-8 support for inputenc defining Unicode char U+00A2 (decimal 162) defining Unicode char U+00A3 (decimal 163) defining Unicode char U+00A4 (decimal 164) defining Unicode char U+00A5 (decimal 165) defining Unicode char U+00A6 (decimal 166) defining Unicode char U+00A7 (decimal 167) defining Unicode char U+00A8 (decimal 168) defining Unicode char U+00A9 (decimal 169) defining Unicode char U+00AA (decimal 170) defining Unicode char U+00AC (decimal 172) defining Unicode char U+00AE (decimal 174) defining Unicode char U+00AF (decimal 175) defining Unicode char U+00B0 (decimal 176) defining Unicode char U+00B1 (decimal 177) defining Unicode char U+00B2 (decimal 178) defining Unicode char U+00B3 (decimal 179) defining Unicode char U+00B4 (decimal 180) defining Unicode char U+00B5 (decimal 181) defining Unicode char U+00B6 (decimal 182) defining Unicode char U+00B7 (decimal 183) defining Unicode char U+00B9 (decimal 185) defining Unicode char U+00BA (decimal 186) defining Unicode char U+00BC (decimal 188) defining Unicode char U+00BD (decimal 189) defining Unicode char U+00BE (decimal 190) defining Unicode char U+00D7 (decimal 215) defining Unicode char U+00F7 (decimal 247) defining Unicode char U+0192 (decimal 402) defining Unicode char U+02C7 (decimal 711) defining Unicode char U+02D8 (decimal 728) defining Unicode char U+02DD (decimal 733) defining Unicode char U+0E3F (decimal 3647) defining Unicode char U+2016 (decimal 8214) defining Unicode char U+2020 (decimal 8224) defining Unicode char U+2021 (decimal 8225) defining Unicode char U+2022 (decimal 8226) defining Unicode char U+2030 (decimal 8240) defining Unicode char U+2031 (decimal 8241) defining Unicode char U+203B (decimal 8251) defining Unicode char U+203D (decimal 8253) defining Unicode char U+2044 (decimal 8260) defining Unicode char U+204E (decimal 8270) defining Unicode char U+2052 (decimal 8274) defining Unicode char U+20A1 (decimal 8353) defining Unicode char U+20A4 (decimal 8356) defining Unicode char U+20A6 (decimal 8358) defining Unicode char U+20A9 (decimal 8361) defining Unicode char U+20AB (decimal 8363) defining Unicode char U+20AC (decimal 8364) defining Unicode char U+20B1 (decimal 8369) defining Unicode char U+2103 (decimal 8451) defining Unicode char U+2116 (decimal 8470) defining Unicode char U+2117 (decimal 8471) defining Unicode char U+211E (decimal 8478) defining Unicode char U+2120 (decimal 8480) defining Unicode char U+2122 (decimal 8482) defining Unicode char U+2126 (decimal 8486) defining Unicode char U+2127 (decimal 8487) defining Unicode char U+212E (decimal 8494) defining Unicode char U+2190 (decimal 8592) defining Unicode char U+2191 (decimal 8593) defining Unicode char U+2192 (decimal 8594) defining Unicode char U+2193 (decimal 8595) defining Unicode char U+2329 (decimal 9001) defining Unicode char U+232A (decimal 9002) defining Unicode char U+2422 (decimal 9250) defining Unicode char U+25E6 (decimal 9702) defining Unicode char U+25EF (decimal 9711) defining Unicode char U+266A (decimal 9834) defining Unicode char U+FEFF (decimal 65279) )) LaTeX Info: Redefining \oldstylenums on input line 334. Package textcomp Info: Setting cmr sub-encoding to TS1/0 on input line 349. Package textcomp Info: Setting cmss sub-encoding to TS1/0 on input line 350. Package textcomp Info: Setting cmtt sub-encoding to TS1/0 on input line 351. Package textcomp Info: Setting cmvtt sub-encoding to TS1/0 on input line 352. Package textcomp Info: Setting cmbr sub-encoding to TS1/0 on input line 353. Package textcomp Info: Setting cmtl sub-encoding to TS1/0 on input line 354. Package textcomp Info: Setting ccr sub-encoding to TS1/0 on input line 355. Package textcomp Info: Setting ptm sub-encoding to TS1/4 on input line 356. Package textcomp Info: Setting pcr sub-encoding to TS1/4 on input line 357. Package textcomp Info: Setting phv sub-encoding to TS1/4 on input line 358. Package textcomp Info: Setting ppl sub-encoding to TS1/3 on input line 359. Package textcomp Info: Setting pag sub-encoding to TS1/4 on input line 360. Package textcomp Info: Setting pbk sub-encoding to TS1/4 on input line 361. Package textcomp Info: Setting pnc sub-encoding to TS1/4 on input line 362. Package textcomp Info: Setting pzc sub-encoding to TS1/4 on input line 363. Package textcomp Info: Setting bch sub-encoding to TS1/4 on input line 364. Package textcomp Info: Setting put sub-encoding to TS1/5 on input line 365. Package textcomp Info: Setting uag sub-encoding to TS1/5 on input line 366. Package textcomp Info: Setting ugq sub-encoding to TS1/5 on input line 367. Package textcomp Info: Setting ul8 sub-encoding to TS1/4 on input line 368. Package textcomp Info: Setting ul9 sub-encoding to TS1/4 on input line 369. Package textcomp Info: Setting augie sub-encoding to TS1/5 on input line 370. Package textcomp Info: Setting dayrom sub-encoding to TS1/3 on input line 371. Package textcomp Info: Setting dayroms sub-encoding to TS1/3 on input line 372.

Package textcomp Info: Setting pxr sub-encoding to TS1/0 on input line 373. Package textcomp Info: Setting pxss sub-encoding to TS1/0 on input line 374. Package textcomp Info: Setting pxtt sub-encoding to TS1/0 on input line 375. Package textcomp Info: Setting txr sub-encoding to TS1/0 on input line 376. Package textcomp Info: Setting txss sub-encoding to TS1/0 on input line 377. Package textcomp Info: Setting txtt sub-encoding to TS1/0 on input line 378. Package textcomp Info: Setting lmr sub-encoding to TS1/0 on input line 379. Package textcomp Info: Setting lmdh sub-encoding to TS1/0 on input line 380. Package textcomp Info: Setting lmss sub-encoding to TS1/0 on input line 381. Package textcomp Info: Setting lmssq sub-encoding to TS1/0 on input line 382. Package textcomp Info: Setting lmvtt sub-encoding to TS1/0 on input line 383. Package textcomp Info: Setting lmtt sub-encoding to TS1/0 on input line 384. Package textcomp Info: Setting qhv sub-encoding to TS1/0 on input line 385. Package textcomp Info: Setting qag sub-encoding to TS1/0 on input line 386. Package textcomp Info: Setting qbk sub-encoding to TS1/0 on input line 387. Package textcomp Info: Setting qcr sub-encoding to TS1/0 on input line 388. Package textcomp Info: Setting qcs sub-encoding to TS1/0 on input line 389. Package textcomp Info: Setting qpl sub-encoding to TS1/0 on input line 390. Package textcomp Info: Setting qtm sub-encoding to TS1/0 on input line 391. Package textcomp Info: Setting qzc sub-encoding to TS1/0 on input line 392. Package textcomp Info: Setting qhvc sub-encoding to TS1/0 on input line 393. Package textcomp Info: Setting futs sub-encoding to TS1/4 on input line 394. Package textcomp Info: Setting futx sub-encoding to TS1/4 on input line 395. Package textcomp Info: Setting futj sub-encoding to TS1/4 on input line 396. Package textcomp Info: Setting hlh sub-encoding to TS1/3 on input line 397. Package textcomp Info: Setting hls sub-encoding to TS1/3 on input line 398. Package textcomp Info: Setting hlst sub-encoding to TS1/3 on input line 399. Package textcomp Info: Setting hlct sub-encoding to TS1/5 on input line 400. Package textcomp Info: Setting hlx sub-encoding to TS1/5 on input line 401. Package textcomp Info: Setting hlce sub-encoding to TS1/5 on input line 402. Package textcomp Info: Setting hlcn sub-encoding to TS1/5 on input line 403. Package textcomp Info: Setting hlcw sub-encoding to TS1/5 on input line 404. Package textcomp Info: Setting hlcf sub-encoding to TS1/5 on input line 405. Package textcomp Info: Setting pplx sub-encoding to TS1/3 on input line 406. Package textcomp Info: Setting pplj sub-encoding to TS1/3 on input line 407. Package textcomp Info: Setting ptmx sub-encoding to TS1/4 on input line 408. Package textcomp Info: Setting ptmj sub-encoding to TS1/4 on input line 409. ) (/usr/local/texlive/2019/texmf-dist/tex/latex/jknapltx/mathrsfs.sty Package: mathrsfs 1996/01/01 Math RSFS package v1.0 (jk) \symrsfs=\mathgroup6 ) (/usr/local/texlive/2019/texmf-dist/tex/latex/fundus-calligra/calligra.sty Package: calligra 2012/04/10 v1.9 LaTeX package calligra ) (/usr/local/texlive/2019/texmf-dist/tex/latex/wasysym/wasysym.sty Package: wasysym 2003/10/30 v2.0 Wasy-2 symbol support package \symwasy=\mathgroup7 LaTeX Font Info: Overwriting symbol font wasy' in versionbold' (Font) U/wasy/m/n --> U/wasy/b/n on input line 90. ) (/usr/local/texlive/2019/texmf-dist/tex/latex/ms/ragged2e.sty Package: ragged2e 2009/05/21 v2.1 ragged2e Package (MS) (/usr/local/texlive/2019/texmf-dist/tex/latex/ms/everysel.sty Package: everysel 2011/10/28 v1.2 EverySelectfont Package (MS) ) \CenteringLeftskip=\skip46 \RaggedLeftLeftskip=\skip47 \RaggedRightLeftskip=\skip48 \CenteringRightskip=\skip49 \RaggedLeftRightskip=\skip50 \RaggedRightRightskip=\skip51 \CenteringParfillskip=\skip52 \RaggedLeftParfillskip=\skip53 \RaggedRightParfillskip=\skip54 \JustifyingParfillskip=\skip55 \CenteringParindent=\skip56 \RaggedLeftParindent=\skip57 \RaggedRightParindent=\skip58 \JustifyingParindent=\skip59 ) (/usr/local/texlive/2019/texmf-dist/tex/latex/physics/physics.sty Package: physics (/usr/local/texlive/2019/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/us r/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3.sty Package: expl3 2019-04-21 L3 programming layer (loader) (/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3-code.tex Package: expl3 2019-04-21 L3 programming layer (code) \c_max_int=\count106 \l_tmpa_int=\count107 \l_tmpb_int=\count108 \g_tmpa_int=\count109 \g_tmpb_int=\count110 \gkernel_prg_map_int=\count111 \cior_term_ior=\count112 \c_log_iow=\count113 \l_iow_line_count_int=\count114 \liow_line_target_int=\count115 \liow_one_indent_int=\count116 \liow_indent_int=\count117 \c_zero_dim=\dimen114 \c_max_dim=\dimen115 \l_tmpa_dim=\dimen116 \l_tmpb_dim=\dimen117 \g_tmpa_dim=\dimen118 \g_tmpb_dim=\dimen119 \c_zero_skip=\skip60 \c_max_skip=\skip61 \l_tmpa_skip=\skip62 \l_tmpb_skip=\skip63 \g_tmpa_skip=\skip64 \g_tmpb_skip=\skip65 \c_zero_muskip=\muskip11 \c_max_muskip=\muskip12 \l_tmpa_muskip=\muskip13 \l_tmpb_muskip=\muskip14 \g_tmpa_muskip=\muskip15 \g_tmpb_muskip=\muskip16 \l_keys_choice_int=\count118 \lintarray_loop_int=\count119 \cintarray_sp_dim=\dimen120 \gintarray_font_int=\count120 \cfp_leading_shift_int=\count121 \cfp_middle_shift_int=\count122 \cfp_trailing_shift_int=\count123 \cfp_big_leading_shift_int=\count124 \cfp_big_middle_shift_int=\count125 \cfp_big_trailing_shift_int=\count126 \cfp_Bigg_leading_shift_int=\count127 \cfp_Bigg_middle_shift_int=\count128 \cfp_Bigg_trailing_shift_int=\count129 \c__kernel_randint_max_int=\count130 \gfp_array_int=\count131 \lfp_array_loop_int=\count132 \lsort_length_int=\count133 \lsort_min_int=\count134 \lsort_top_int=\count135 \lsort_max_int=\count136 \l__sort_true_max_int=\count137 \lsort_block_int=\count138 \lsort_begin_int=\count139 \lsort_end_int=\count140 \lsort_A_int=\count141 \lsort_B_int=\count142 \lsort_C_int=\count143 \ltl_analysis_normal_int=\count144 \ltl_analysis_index_int=\count145 \l__tl_analysis_nesting_int=\count146 \ltl_analysis_type_int=\count147 \lregex_internal_a_int=\count148 \l__regex_internal_b_int=\count149 \lregex_internal_c_int=\count150 \lregex_balance_int=\count151 \lregex_group_level_int=\count152 \lregex_mode_int=\count153 \cregex_cs_in_class_mode_int=\count154 \cregex_cs_mode_int=\count155 \lregex_catcodes_int=\count156 \lregex_default_catcodes_int=\count157 \cregex_catcode_D_int=\count158 \cregex_catcode_S_int=\count159 \c__regex_catcode_L_int=\count160 \cregex_catcode_O_int=\count161 \cregex_catcode_A_int=\count162 \c__regex_all_catcodes_int=\count163 \lregex_show_lines_int=\count164 \lregex_min_state_int=\count165 \l__regex_max_state_int=\count166 \lregex_left_state_int=\count167 \lregex_right_state_int=\count168 \l__regex_capturing_group_int=\count169 \lregex_min_pos_int=\count170 \lregex_max_pos_int=\count171 \l__regex_curr_pos_int=\count172 \lregex_start_pos_int=\count173 \lregex_success_pos_int=\count174 \l__regex_curr_char_int=\count175 \lregex_curr_catcode_int=\count176 \lregex_last_char_int=\count177 \lregex_case_changed_char_int=\count178 \lregex_curr_state_int=\count179 \lregex_step_int=\count180 \lregex_min_active_int=\count181 \l__regex_max_active_int=\count182 \lregex_replacement_csnames_int=\count183 \lregex_match_count_int=\count184 \l__regex_min_submatch_int=\count185 \lregex_submatch_int=\count186 \lregex_zeroth_submatch_int=\count187 \g__regex_trace_regex_int=\count188 \c_empty_box=\box30 \l_tmpa_box=\box31 \l_tmpb_box=\box32 \g_tmpa_box=\box33 \g_tmpb_box=\box34 \lbox_top_dim=\dimen121 \lbox_bottom_dim=\dimen122 \lbox_left_dim=\dimen123 \lbox_right_dim=\dimen124 \lbox_top_new_dim=\dimen125 \lbox_bottom_new_dim=\dimen126 \l__box_left_new_dim=\dimen127 \lbox_right_new_dim=\dimen128 \lbox_internal_box=\box35 \lcoffin_internal_box=\box36 \lcoffin_internal_dim=\dimen129 \lcoffin_offset_x_dim=\dimen130 \lcoffin_offset_y_dim=\dimen131 \lcoffin_x_dim=\dimen132 \lcoffin_y_dim=\dimen133 \l__coffin_x_prime_dim=\dimen134 \lcoffin_y_prime_dim=\dimen135 \c_empty_coffin=\box37 \lcoffin_aligned_coffin=\box38 \lcoffin_aligned_internal_coffin=\box39 \l_tmpa_coffin=\box40 \l_tmpb_coffin=\box41 \g_tmpa_coffin=\box42 \g_tmpb_coffin=\box43 \lcoffin_bounding_shift_dim=\dimen136 \l__coffin_left_corner_dim=\dimen137 \lcoffin_right_corner_dim=\dimen138 \lcoffin_bottom_corner_dim=\dimen139 \l__coffin_top_corner_dim=\dimen140 \lcoffin_scaled_total_height_dim=\dimen141 \lcoffin_scaled_width_dim=\dimen142 \ccoffin_empty_coffin=\box44 \lcoffin_display_coffin=\box45 \l__coffin_display_coord_coffin=\box46 \lcoffin_display_pole_coffin=\box47 \lcoffin_display_offset_dim=\dimen143 \l__coffin_display_x_dim=\dimen144 \lcoffin_display_y_dim=\dimen145 \gfile_internal_ior=\read1 \lseq_internal_a_int=\count189 \lseq_internal_b_int=\count190 \cdeprecation_minus_one=\count191 ) (/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/l3dvips.def File: l3dvips.def 2019-04-06 v L3 Experimental driver: dvips \gdriver_pdf_object_int=\count192 \ldriver_pdf_content_box=\box48 \ldriver_pdf_model_box=\box49 \g__driver_pdf_annotation_int=\count193 \gdriver_pdf_link_int=\count194 \gdriver_pdf_link_sf_int=\count195 )) Package: xparse 2019-03-05 L3 Experimental document command parser \lxparse_current_arg_int=\count196 \gxparse_grabber_int=\count197 \lxparse_m_args_int=\count198 \l__xparse_v_nesting_int=\count199 )) (/usr/local/texlive/2019/texmf-dist/tex/latex/xcolor/xcolor.sty Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK) (/usr/local/texlive/2019/texmf-dist/tex/latex/graphics-cfg/color.cfg File: color.cfg 2016/01/02 v1.6 sample color configuration ) Package xcolor Info: Driver file: dvips.def on input line 225. (/usr/local/texlive/2019/texmf-dist/tex/latex/graphics-def/dvips.def File: dvips.def 2017/06/20 v3.1d Graphics/color driver for dvips ) Package xcolor Info: Model cmy' substituted bycmy0' on input line 1348. Package xcolor Info: Model RGB' extended on input line 1364. Package xcolor Info: ModelHTML' substituted by rgb' on input line 1366. Package xcolor Info: ModelHsb' substituted by hsb' on input line 1367. Package xcolor Info: ModeltHsb' substituted by hsb' on input line 1368. Package xcolor Info: ModelHSB' substituted by hsb' on input line 1369. Package xcolor Info: ModelGray' substituted by gray' on input line 1370. Package xcolor Info: Modelwave' substituted by `hsb' on input line 1371. ) (/usr/local/texlive/2019/texmf-dist/tex/latex/microtype/microtype.sty Package: microtype 2019/02/28 v2.7b Micro-typographical refinements (RS) \MT@toks=\toks22 \MT@count=\count266 LaTeX Info: Redefining \textls on input line 790. \MT@outer@kern=\dimen146 LaTeX Info: Redefining \textmicrotypecontext on input line 1336. \MT@listname@count=\count267 (/usr/local/texlive/2019/texmf-dist/tex/latex/microtype/microtype-pdftex.def File: microtype-pdftex.def 2019/02/28 v2.7b Definitions specific to pdftex (RS)

LaTeX Info: Redefining \lsstyle on input line 914. LaTeX Info: Redefining \lslig on input line 914. \MT@outer@space=\skip66 ) Package microtype Info: Loading configuration file microtype.cfg. (/usr/local/texlive/2019/texmf-dist/tex/latex/microtype/microtype.cfg File: microtype.cfg 2019/02/28 v2.7b microtype main configuration file (RS) )) (/usr/local/texlive/2019/texmf-dist/tex/latex/graphics/graphicx.sty Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR) (/usr/local/texlive/2019/texmf-dist/tex/latex/graphics/graphics.sty Package: graphics 2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR) (/usr/local/texlive/2019/texmf-dist/tex/latex/graphics/trig.sty Package: trig 2016/01/03 v1.10 sin cos tan (DPC) ) (/usr/local/texlive/2019/texmf-dist/tex/latex/graphics-cfg/graphics.cfg File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration ) Package graphics Info: Driver file: dvipdfmx.def on input line 99. (/usr/local/texlive/2019/texmf-dist/tex/latex/graphics-def/dvipdfmx.def File: dvipdfmx.def 2017/06/24 v5.0g Graphics/color driver for dvipdfmx )) \Gin@req@height=\dimen147 \Gin@req@width=\dimen148 ) No file fbe69ee0c8bd70ec.aux. \openout1 = `fbe69ee0c8bd70ec.aux'.

LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 24. LaTeX Font Info: ... okay on input line 24. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 24. LaTeX Font Info: ... okay on input line 24. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 24. LaTeX Font Info: ... okay on input line 24. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 24. LaTeX Font Info: ... okay on input line 24. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 24. LaTeX Font Info: ... okay on input line 24. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 24. LaTeX Font Info: ... okay on input line 24. LaTeX Font Info: Checking defaults for T3/cmr/m/n on input line 24. LaTeX Font Info: Try loading font information for T3+cmr on input line 24. (/usr/local/texlive/2019/texmf-dist/tex/latex/tipa/t3cmr.fd File: t3cmr.fd 2001/12/31 TIPA font definitions ) LaTeX Font Info: ... okay on input line 24. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 24. LaTeX Font Info: Try loading font information for TS1+cmr on input line 24. (/usr/local/texlive/2019/texmf-dist/tex/latex/base/ts1cmr.fd File: ts1cmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions ) LaTeX Font Info: ... okay on input line 24. Preview: Fontsize 10pt ABD: EverySelectfont initializing macros LaTeX Info: Redefining \selectfont on input line 24. LaTeX Info: Redefining \microtypecontext on input line 24. Package microtype Info: Generating DVI output. Package microtype Info: Character protrusion enabled (level 2). Package microtype Info: Using default protrusion set `alltext'. Package microtype Info: No font expansion. Package microtype Info: No adjustment of tracking. Package microtype Info: No adjustment of interword spacing. Package microtype Info: No adjustment of character kerning. (/usr/local/texlive/2019/texmf-dist/tex/latex/microtype/mt-cmr.cfg File: mt-cmr.cfg 2013/05/19 v2.2 microtype config. file: Computer Modern Roman (RS) )

! Package inputenc Error: Unicode character お (U+304A) (inputenc) not set up for use with LaTeX.

See the inputenc package documentation for explanation. Type H for immediate help. ...

l.26 \centering お はよう Here is how much of TeX's memory you used: 16504 strings out of 492619 285417 string characters out of 6129527 363086 words of memory out of 5000000 20308 multiletter control sequences out of 15000+600000 533650 words of font info for 28 fonts, out of 8000000 for 9000 1141 hyphenation exceptions out of 8191 47i,1n,65p,353b,317s stack positions out of 5000i,500n,10000p,200000b,80000s

No pages of output.

Would someone tell me how to solve this problem ?

Elteoremadebeethoven commented 5 years ago

Try modify the manimlib/tex_template.tex file with some of this packages

Elteoremadebeethoven commented 5 years ago

Paste this in your manimlib/tex_template.tex file:

\documentclass[preview]{standalone}

\usepackage[english]{babel}
\usepackage{CJKutf8} % This is the package for Japanese language
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{dsfont}
\usepackage{setspace}
\usepackage{tipa}
\usepackage{relsize}
\usepackage{textcomp}
\usepackage{mathrsfs}
\usepackage{calligra}
\usepackage{wasysym}
\usepackage{ragged2e}
\usepackage{physics}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{microtype}
\DisableLigatures{encoding = *, family = * }
%\usepackage[UTF8]{ctex}
\linespread{1}
\newcommand{\jap}[1]{\begin{CJK}{UTF8}{min}#1\end{CJK}} % This is a new command created to write the text

\begin{document}

YourTextHere

\end{document}

This is a scene:

class Japan(Scene):
    def construct(self):
        tex=TextMobject("\\jap{これはmanimのあるアニメーションです}").scale(1.5)
        self.play(Write(tex))
        self.wait()

And this is the result: Japan

GrouperTamaki commented 5 years ago

Thanks a lot ! You are a kind man !

Elteoremadebeethoven commented 5 years ago

Your welcome, please close the issue.

GrouperTamaki commented 5 years ago

Sorry, I have one more question.

In Japan, we use upLaTeX rather than pdfLaTeX which is widely used in English community. upLaTeX is a Japanese-optimized version of LaTeX engines and is the first choice for Japanese people when we use LaTeX.

So, if it's possible to change LaTeX engine used in manim (This is pdfLaTeX) to upLaTeX, I want to know how to do it and how to use it.

If no solution is available, ignore this question.

Thank you.

Elteoremadebeethoven commented 5 years ago

In the line 44 of manimlib/utils/tex_file_writing.py you can change the compiler by default. I don't know the differences between upLaTeX and pdfLaTeX, but you can try.

GrouperTamaki commented 5 years ago

Thank you !

I'll try it.

woshichuanqilz commented 4 years ago

In the line 44 of manimlib/utils/tex_file_writing.py you can change the compiler by default. I don't know the differences between upLaTeX and pdfLaTeX, but you can try.

Hi I get the same issue but with Chinese.

I use this Chinese font here

It works fine on Windows, but when I turn to Linux(Ubuntu and Manjaro both tried same error) the Chinese char become square.

image

Here is the code pretty simple

    def intro_part(self):
        # Main title intro
        t1 = Text("从夹角到六角星", font="上首水滴体", color=BLUE_B)
        self.play(Write(t1))

The font is installed successfully on Linux. I can see it in the editor "kate" config panel image

I checked your answers and some other post and make the tex_template like this:

\documentclass[preview]{standalone}

\usepackage[english]{babel}
\usepackage{CJKutf8} % This is the package for Japanese language
\usepackage{xeCJK}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{dsfont}
\usepackage{setspace}
\usepackage{tipa}
\usepackage{relsize}
\usepackage{textcomp}
\usepackage{mathrsfs}
\usepackage{calligra}
\usepackage{wasysym}
\usepackage{ragged2e}
\usepackage{physics}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{microtype}
\DisableLigatures{encoding = *, family = * }
%\usepackage[UTF8]{ctex}
\linespread{1}
%\newcommand{\jap}[1]{\begin{CJK}{UTF8}{min}#1\end{CJK}} % This is a new command created to write the text

\begin{document}{CJK*}{UTF8}{gbsn}

YourTextHere

\end{document}

But this template dont work for me. Since I dont know much about latex config can you give me a hint?

KokeCacao commented 4 years ago

The problem was fixed differently on my end. My solution:

Support for Chinese and Japanese follow manim guide on Github

  1. package to install: sudo apt install texlive-full
  2. edit file ctex_template.tex to the following \documentclass[preview]{standalone}
    
    \usepackage[english]{babel}
    \usepackage[utf8]{inputenc} % added for both Japanese and Chinese Supports
    \usepackage{amsmath}
    \usepackage{amssymb}
    \usepackage{dsfont}
    \usepackage{setspace}
    \usepackage{tipa}
    \usepackage{relsize}
    \usepackage{textcomp}
    \usepackage{mathrsfs}
    \usepackage{calligra}
    \usepackage{wasysym}
    \usepackage{ragged2e}
    \usepackage{physics}
    \usepackage{xcolor}
    \usepackage{microtype}
    %\DisableLigatures{encoding = *, family = * }
    \usepackage[UTF8]{ctex}
    \linespread{1}

\begin{document}

YourTextHere

\end{document}


 4. edit configuration in file `constants.py`
`TEX_USE_CTEX = True # Support Chinese`
Kejk23 commented 2 years ago

Paste this in your manimlib/tex_template.tex file:

\documentclass[preview]{standalone}

\usepackage[english]{babel}
\usepackage{CJKutf8} % This is the package for Japanese language
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{dsfont}
\usepackage{setspace}
\usepackage{tipa}
\usepackage{relsize}
\usepackage{textcomp}
\usepackage{mathrsfs}
\usepackage{calligra}
\usepackage{wasysym}
\usepackage{ragged2e}
\usepackage{physics}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{microtype}
\DisableLigatures{encoding = *, family = * }
%\usepackage[UTF8]{ctex}
\linespread{1}
\newcommand{\jap}[1]{\begin{CJK}{UTF8}{min}#1\end{CJK}} % This is a new command created to write the text

\begin{document}

YourTextHere

\end{document}

This is a scene:

class Japan(Scene):
    def construct(self):
        tex=TextMobject("\\jap{これはmanimのあるアニメーションです}").scale(1.5)
        self.play(Write(tex))
        self.wait()

And this is the result: Japan Japan

I'm sorry but how do I edit the file? Where is it?

Xenomorphs commented 1 year ago

Paste this in your manimlib/tex_template.tex file:

\documentclass[preview]{standalone}

\usepackage[english]{babel}
\usepackage{CJKutf8} % This is the package for Japanese language
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{dsfont}
\usepackage{setspace}
\usepackage{tipa}
\usepackage{relsize}
\usepackage{textcomp}
\usepackage{mathrsfs}
\usepackage{calligra}
\usepackage{wasysym}
\usepackage{ragged2e}
\usepackage{physics}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{microtype}
\DisableLigatures{encoding = *, family = * }
%\usepackage[UTF8]{ctex}
\linespread{1}
\newcommand{\jap}[1]{\begin{CJK}{UTF8}{min}#1\end{CJK}} % This is a new command created to write the text

\begin{document}

YourTextHere

\end{document}

This is a scene:

class Japan(Scene):
    def construct(self):
        tex=TextMobject("\\jap{これはmanimのあるアニメーションです}").scale(1.5)
        self.play(Write(tex))
        self.wait()

And this is the result: Japan

    [

        ![Japan](https://user-images.githubusercontent.com/43224662/57177966-57f98780-6e2f-11e9-8c2a-c5f7b3228387.gif)
      ](https://user-images.githubusercontent.com/43224662/57177966-57f98780-6e2f-11e9-8c2a-c5f7b3228387.gif)

      [

      ](https://user-images.githubusercontent.com/43224662/57177966-57f98780-6e2f-11e9-8c2a-c5f7b3228387.gif)

   [ ](https://user-images.githubusercontent.com/43224662/57177966-57f98780-6e2f-11e9-8c2a-c5f7b3228387.gif) ![Japan](https://user-images.githubusercontent.com/43224662/57177966-57f98780-6e2f-11e9-8c2a-c5f7b3228387.gif)

    [

        ![Japan](https://user-images.githubusercontent.com/43224662/57177966-57f98780-6e2f-11e9-8c2a-c5f7b3228387.gif)
      ](https://user-images.githubusercontent.com/43224662/57177966-57f98780-6e2f-11e9-8c2a-c5f7b3228387.gif)

      [

      ](https://user-images.githubusercontent.com/43224662/57177966-57f98780-6e2f-11e9-8c2a-c5f7b3228387.gif)

   [ ](https://user-images.githubusercontent.com/43224662/57177966-57f98780-6e2f-11e9-8c2a-c5f7b3228387.gif)

I'm sorry but how do I edit the file? Where is it?

Same. Don't know how to get it.