quarto-dev / quarto-gallery

MIT License
41 stars 23 forks source link

cyrillic encoding #2

Closed kostadinoff closed 2 years ago

kostadinoff commented 2 years ago

I love the gallery, however in R studio i can not reproduce the Tufte's template when i'm using cyrillic alphabet in the text. Can that be fixed somehow?

dragonstyle commented 2 years ago

Thanks for the kind words. Quarto defaults to using xelatex to compile LaTeX to PDF, so things should generally work. One common issue might be the font selection (and in particular whether the font includes cyrillic characters). I was able to compile the Tufte template as follows by providing a new font (note mainfont under the pdf key):

---
title: "A Quarto Page Layout Example"
subtitle: "Inspired by Tufte Handout, Using Quarto"
date: last-modified
format:
  pdf:
    mainfont: Arial
  html: 
    self-contained: true
reference-location: margin
citation-location: margin
bibliography: skeleton.bib
---

# Introduction

Этот документ демонстрирует использование ряда этих функций макета страницы для создания привлекательного и удобного документа, вдохновленного стилем раздаточного материала Tufte и использованием стилей Tufte в документах RMarkdown [@xie2018]. Стиль раздаточных материалов Тафте — это стиль, который Эдвард Тафте использует в своих книгах и раздаточных материалах. Стиль Тафте известен широким использованием боковых примечаний, тесной интеграцией графики с текстом и хорошо подобранной типографикой. Quarto[^1] поддерживает большинство методов компоновки, которые используются в стиле раздаточных материалов Tufte для вывода как HTML, так и LaTeX/PDF.

[^1]: To learn more, you can read more about [Quarto](https://www.quarto.org) or visit [Quarto's Github repository](https://www.github.com/quarto-dev/quarto-cli).

I hope that this helps. If not, please give me a little more information about the error that you're seeing, including hopefully a way that I can reproduce it.

kostadinoff commented 2 years ago

The mainfont fixed the issue. Thank you

kostadinoff commented 2 years ago

Hi again. Unfortunately i've faced the same problem under linux distro I'm sending the log file This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex 2022.8.7) 7 AUG 2022 14:25 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **tglg.tex (./tglg.tex LaTeX2e <2022-06-01> patch level 5 L3 programming layer <2022-08-05> (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/koma-script/scrartcl.cls Document Class: scrartcl 2022/07/04 v3.37 KOMA-Script document class (article) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/koma-script/scrkbase.sty Package: scrkbase 2022/07/04 v3.37 KOMA-Script package (KOMA-Script-dependent basics and keyval usage) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/koma-script/scrbase.sty Package: scrbase 2022/07/04 v3.37 KOMA-Script package (KOMA-Script-independent basics and keyval usage) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/koma-script/scrlfile.sty Package: scrlfile 2022/07/04 v3.37 KOMA-Script package (file load hooks) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/koma-script/scrlfile-hook.sty Package: scrlfile-hook 2022/07/04 v3.37 KOMA-Script package (using LaTeX hooks) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/koma-script/scrlogo.sty Package: scrlogo 2022/07/04 v3.37 KOMA-Script package (logo) ))) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/graphics/keyval.sty Package: keyval 2022/05/29 v1.15 key=value parser (DPC) \KV@toks@=\toks16 ) Applying: [2021/05/01] Usage of raw or classic option list on input line 252. Already applied: [0000/00/00] Usage of raw or classic option list on input line 368. )) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/koma-script/tocbasic.sty Package: tocbasic 2022/07/04 v3.37 KOMA-Script package (handling toc-files) \scr@dte@tocline@numberwidth=\skip47 \scr@dte@tocline@numbox=\box51 ) Package tocbasic Info: babel extension for toc' omitted (tocbasic) because of missing \bbl@set@language on input line 135. Class scrartcl Info: You've used standard optiononeside'. (scrartcl) This is correct! (scrartcl) Internally I'm using twoside=false'. (scrartcl) If you'd like to set the option with \KOMAoptions, (scrartcl) you'd have to usetwoside=false' there (scrartcl) instead of oneside', too. Class scrartcl Info: Filescrsize11pt.clo' used instead of (scrartcl) file scrsize11.clo' to setup font sizes on input line 2319. (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/koma-script/scrsize11pt.clo File: scrsize11pt.clo 2022/07/04 v3.37 KOMA-Script font size class option (11pt) ) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/koma-script/typearea.sty Package: typearea 2022/07/04 v3.37 KOMA-Script package (type area) \ta@bcor=\skip48 \ta@div=\count181 Package typearea Info: You've used standard optionletterpaper'. (typearea) This is correct! (typearea) Internally I'm using paper=letter'. (typearea) If you'd like to set the option with \KOMAoptions, (typearea) you'd have to usepaper=letter' there (typearea) instead of letterpaper', too. Package typearea Info: You've used standard optiononeside'. (typearea) This is correct! (typearea) Internally I'm using twoside=false'. (typearea) If you'd like to set the option with \KOMAoptions, (typearea) you'd have to usetwoside=false' there (typearea) instead of oneside', too. \ta@hblk=\skip49 \ta@vblk=\skip50 \ta@temp=\skip51 \footheight=\skip52 Package typearea Info: These are the values describing the layout: (typearea) DIV = 11 (typearea) BCOR = 0.0pt (typearea) \paperwidth = 614.295pt (typearea) \textwidth = 446.76004pt (typearea) DIV departure = -14% (typearea) \evensidemargin = 11.49748pt (typearea) \oddsidemargin = 11.49748pt (typearea) \paperheight = 794.96999pt (typearea) \textheight = 582.20026pt (typearea) \topmargin = -37.40001pt (typearea) \headheight = 17.0pt (typearea) \headsep = 20.40001pt (typearea) \topskip = 11.0pt (typearea) \footskip = 47.6pt (typearea) \baselineskip = 13.6pt (typearea) on input line 1766. ) \c@part=\count182 \c@section=\count183 \c@subsection=\count184 \c@subsubsection=\count185 \c@paragraph=\count186 \c@subparagraph=\count187 \scr@dte@section@maxnumwidth=\skip53 Class scrartcl Info: using compatibility defaultrunin=bysign' (scrartcl) for \section on input line 4897. Class scrartcl Info: using compatibility defaultafterindent=bysign' (scrartcl) for \section on input line 4897. \scr@dte@part@maxnumwidth=\skip54 Class scrartcl Info: using compatibility defaultafterindent=false' (scrartcl) for \part on input line 4905. \scr@dte@subsection@maxnumwidth=\skip55 Class scrartcl Info: using compatibility defaultrunin=bysign' (scrartcl) for \subsection on input line 4915. Class scrartcl Info: using compatibility defaultafterindent=bysign' (scrartcl) for \subsection on input line 4915. \scr@dte@subsubsection@maxnumwidth=\skip56 Class scrartcl Info: using compatibility defaultrunin=bysign' (scrartcl) for \subsubsection on input line 4925. Class scrartcl Info: using compatibility defaultafterindent=bysign' (scrartcl) for \subsubsection on input line 4925. \scr@dte@paragraph@maxnumwidth=\skip57 Class scrartcl Info: using compatibility defaultrunin=bysign' (scrartcl) for \paragraph on input line 4936. Class scrartcl Info: using compatibility defaultafterindent=bysign' (scrartcl) for \paragraph on input line 4936. \scr@dte@subparagraph@maxnumwidth=\skip58 Class scrartcl Info: using compatibility defaultrunin=bysign' (scrartcl) for \subparagraph on input line 4946. Class scrartcl Info: using compatibility defaultafterindent=bysign' (scrartcl) for \subparagraph on input line 4946. \abovecaptionskip=\skip59 \belowcaptionskip=\skip60 \c@pti@nb@sid@b@x=\box52 Package tocbasic Info: babel extension forlof' omitted (tocbasic) because of missing \bbl@set@language on input line 6102. \scr@dte@figure@maxnumwidth=\skip61 \c@figure=\count188 Package tocbasic Info: babel extension for lot' omitted (tocbasic) because of missing \bbl@set@language on input line 6118. \scr@dte@table@maxnumwidth=\skip62 \c@table=\count189 Class scrartcl Info: Redefining\numberline' on input line 6288. \bibindent=\dimen138 ) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/amsmath/amsmath.sty Package: amsmath 2022/04/08 v2.17n AMS math features \@mathmargin=\skip63 For additional information on amsmath, use the ?' option. (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/amsmath/amstext.sty Package: amstext 2021/08/26 v2.01 AMS text (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 generic functions \@emptytoks=\toks17 \ex@=\dimen139 )) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/amsmath/amsbsy.sty Package: amsbsy 1999/11/29 v1.2d Bold Symbols \pmbraise@=\dimen140 ) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/amsmath/amsopn.sty Package: amsopn 2022/04/08 v2.04 operator names ) \inf@bad=\count190 LaTeX Info: Redefining \frac on input line 234. \uproot@=\count191 \leftroot@=\count192 LaTeX Info: Redefining \overline on input line 399. LaTeX Info: Redefining \colon on input line 410. \classnum@=\count193 \DOTSCASE@=\count194 LaTeX Info: Redefining \ldots on input line 496. LaTeX Info: Redefining \dots on input line 499. LaTeX Info: Redefining \cdots on input line 620. \Mathstrutbox@=\box53 \strutbox@=\box54 LaTeX Info: Redefining \big on input line 722. LaTeX Info: Redefining \Big on input line 723. LaTeX Info: Redefining \bigg on input line 724. LaTeX Info: Redefining \Bigg on input line 725. \big@size=\dimen141 LaTeX Font Info: Redeclaring font encoding OML on input line 743. LaTeX Font Info: Redeclaring font encoding OMS on input line 744. \macc@depth=\count195 LaTeX Info: Redefining \bmod on input line 905. LaTeX Info: Redefining \pmod on input line 910. LaTeX Info: Redefining \smash on input line 940. LaTeX Info: Redefining \relbar on input line 970. LaTeX Info: Redefining \Relbar on input line 971. \c@MaxMatrixCols=\count196 \dotsspace@=\muskip16 \c@parentequation=\count197 \dspbrk@lvl=\count198 \tag@help=\toks18 \row@=\count199 \column@=\count266 \maxfields@=\count267 \andhelp@=\toks19 \eqnshift@=\dimen142 \alignsep@=\dimen143 \tagshift@=\dimen144 \tagwidth@=\dimen145 \totwidth@=\dimen146 \lineht@=\dimen147 \@envbody=\toks20 \multlinegap=\skip64 \multlinetaggap=\skip65 \mathdisplay@stack=\toks21 LaTeX Info: Redefining \[ on input line 2953. LaTeX Info: Redefining \] on input line 2954. ) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/amsfonts/amssymb.sty Package: amssymb 2013/01/14 v3.01 AMS font symbols (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/amsfonts/amsfonts.sty Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support \symAMSa=\mathgroup4 \symAMSb=\mathgroup5 LaTeX Font Info: Redeclaring math symbol \hbar on input line 98. LaTeX Font Info: Overwriting math alphabet\mathfrak' in version bold' (Font) U/euf/m/n --> U/euf/b/n on input line 106. )) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/lm/lmodern.sty Package: lmodern 2015/05/01 v1.6.1 Latin Modern Fonts LaTeX Font Info: Overwriting symbol fontoperators' in version normal' (Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22. LaTeX Font Info: Overwriting symbol fontletters' in version normal' (Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23. LaTeX Font Info: Overwriting symbol fontsymbols' in version normal' (Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24. LaTeX Font Info: Overwriting symbol fontlargesymbols' in version normal' (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25. LaTeX Font Info: Overwriting symbol fontoperators' in version bold' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26. LaTeX Font Info: Overwriting symbol fontletters' in version bold' (Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27. LaTeX Font Info: Overwriting symbol fontsymbols' in version bold' (Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28. LaTeX Font Info: Overwriting symbol fontlargesymbols' in version bold' (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29. LaTeX Font Info: Overwriting math alphabet\mathbf' in version normal' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31. LaTeX Font Info: Overwriting math alphabet\mathsf' in version normal' (Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32. LaTeX Font Info: Overwriting math alphabet\mathit' in version normal' (Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33. LaTeX Font Info: Overwriting math alphabet\mathtt' in version normal' (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34. LaTeX Font Info: Overwriting math alphabet\mathbf' in version bold' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35. LaTeX Font Info: Overwriting math alphabet\mathsf' in version bold' (Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36. LaTeX Font Info: Overwriting math alphabet\mathit' in version bold' (Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37. LaTeX Font Info: Overwriting math alphabet\mathtt' in version `bold' (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38. ) (/home/kostadin/.TinyTeX/texmf-dist/tex/generic/iftex/iftex.sty Package: iftex 2022/02/03 v1.0f TeX engine tests ) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/unicode-math/unicode-math.sty (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/l3kernel/expl3.sty Package: expl3 2022-08-05 L3 programming layer (loader) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/l3backend/l3backend-xetex.def File: l3backend-xetex.def 2022-08-05 L3 backend support: XeTeX \ggraphics_track_int=\count268 \lpdf_internal_box=\box55 \gpdf_backend_object_int=\count269 \g__pdf_backend_annotation_int=\count270 \gpdf_backend_link_int=\count271 )) Package: unicode-math 2020/01/31 v0.8q Unicode maths in XeLaTeX and LuaLaTeX (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty Package: unicode-math-xetex 2020/01/31 v0.8q Unicode maths in XeLaTeX and LuaLaTeX (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/l3packages/xparse/xparse.sty Package: xparse 2022-06-22 L3 Experimental document command parser ) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty Package: l3keys2e 2022-06-22 LaTeX2e option processing using LaTeX3 keys ) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/fontspec/fontspec.sty Package: fontspec 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty Package: fontspec-xetex 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX \lfontspec_script_int=\count272 \lfontspec_language_int=\count273 \lfontspec_strnum_int=\count274 \lfontspec_tmp_int=\count275 \lfontspec_tmpa_int=\count276 \lfontspec_tmpb_int=\count277 \lfontspec_tmpc_int=\count278 \lfontspec_em_int=\count279 \lfontspec_emdef_int=\count280 \lfontspec_strong_int=\count281 \lfontspec_strongdef_int=\count282 \lfontspec_tmpa_dim=\dimen148 \lfontspec_tmpb_dim=\dimen149 \lfontspec_tmpc_dim=\dimen150 (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/base/fontenc.sty Package: fontenc 2021/04/29 v2.0v Standard LaTeX package ) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/base/fix-cm.sty Package: fix-cm 2020/11/24 v1.1t fixes to LaTeX (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/base/ts1enc.def File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file LaTeX Font Info: Redeclaring font encoding TS1 on input line 47. )) \gum_fam_int=\count283 \gum_fonts_used_int=\count284 \lum_primecount_int=\count285 \gum_primekern_muskip=\muskip17 (/home/kostadin/.TinyTeX/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex)))

! Package fontspec Error: The font "Arial" cannot be found.

For immediate help type H . ...

l.24 \fi

Here is how much of TeX's memory you used: 10358 strings out of 477855 231711 string characters out of 5846348 849211 words of memory out of 5000000 31289 multiletter control sequences out of 15000+600000 469275 words of font info for 30 fonts, out of 8000000 for 9000 14 hyphenation exceptions out of 8191 108i,1n,106p,10599b,270s stack positions out of 10000i,1000n,20000p,200000b,200000s

No pages of output.

dragonstyle commented 2 years ago

You can run this command to see the list of fonts available on a system which support a specific language:

fc-list :lang=<lang>

For example

fc-list :lang=ru

When I do this, I see that my system has a lot of fonts that support Russian (for example), I chose Helvetica Neue and rendered this document without error:

---
title: cyrillic test
format: pdf
mainfont: "Helvetica Neue"
---

## This is a cool document 

Это тест различных кодировок.

Hope that this helps.