Bug 29123 - missing \usepackage{fontenc} or {babel} for generated .tex with Russian
Summary: missing \usepackage{fontenc} or {babel} for generated .tex with Russian
Status: CLOSED NOTABUG
Alias: None
Product: Sisyphus
Classification: Development
Component: pandoc (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Vitaly Lipatov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks: 29122
  Show dependency tree
 
Reported: 2013-06-30 10:35 MSK by Ivan Zakharyaschev
Modified: 2020-06-26 01:14 MSK (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zakharyaschev 2013-06-30 10:35:53 MSK
$ rpm -qf /usr/bin/markdown2pdf /usr/bin/pdflatex 
pandoc-1.6.0.1-alt1
tetex-latex-2.0-alt10
$ 

If a .tex document has Russian, it should \usepackage[T2A]{fontenc} or \usepackage[russian]{babel}. Otherwise latex breaks:

[imz@localhost pandoc-rus]$ pandoc rus.md -o rus.tex --standalone
[imz@localhost pandoc-rus]$ latex rus.tex 
This is TeX, Version 3.14159 (Web2C 7.4.4)
(./rus.tex
LaTeX2e <2001/06/01>
Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, r
ussian, ukrainian, nohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2001/04/21 v1.4e Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/amsfonts/amssymb.sty
(/usr/share/texmf/tex/latex/amsfonts/amsfonts.sty))
(/usr/share/texmf/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texmf/tex/latex/amsmath/amstext.sty
(/usr/share/texmf/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texmf/tex/latex/amsmath/amsopn.sty))
(/usr/share/texmf/tex/latex/unicode/ucs.sty
(/usr/share/texmf/tex/latex/unicode/data/uni-global.def))
(/usr/share/texmf/tex/latex/base/inputenc.sty
(/usr/share/texmf/tex/latex/unicode/utf8x.def))
(/usr/share/texmf/tex/latex/hyperref/hyperref.sty
(/usr/share/texmf/tex/latex/graphics/keyval.sty)
(/usr/share/texmf/tex/latex/hyperref/pd1enc.def)
(/usr/share/texmf/tex/latex/config/hyperref.cfg)
(/usr/share/texmf/tex/latex/hyperref/puenc.def)
Implicit mode ON; LaTeX internals redefined
(/usr/share/texmf/tex/latex/misc/url.sty))
*hyperref using default driver hdvips*
(/usr/share/texmf/tex/latex/hyperref/hdvips.def
(/usr/share/texmf/tex/latex/hyperref/pdfmark.def))
No file rus.aux.
(/usr/share/texmf/tex/latex/unicode/ucsencs.def)
(/usr/share/texmf/tex/latex/hyperref/nameref.sty)
(/usr/share/texmf/tex/latex/unicode/data/uni-4.def)

! LaTeX Error: Command \CYRP unavailable in encoding OT1.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.13 ^^d0^^9f
             ^^d1^^80^^d0^^b8^^d0^^b2^^d0^^b5^^d1^^82, ^^d0^^bc^^d0^^b8^^d1^...

? x
No pages of output.
Transcript written on rus.log.
[imz@localhost pandoc-rus]$ 

There has been a discussion of such problem at http://comments.gmane.org/gmane.text.pandoc/1305 .

It's not clear to me how to fix this n a clean way: different languages should require different fontencs...

Perhaps, there could be a language variable (either read from the source text or specified in command-line) which would cause the inclusion of needed things in latex.template. Or fallback to the LANGUAGE environment variable, or to locale.
Comment 1 Ivan Zakharyaschev 2013-07-07 19:31:16 MSK
I wonder whether using xelatex instead of latex would overcome this problem of specifying the fontenc always for any special letters... I should try.
Comment 2 Grigory Ustinov 2018-08-23 19:11:39 MSK
Перевешу на сизиф с t6, так как сходу не могу понять, как заставить пусть и новый pandoc генерировать нужные строки.
Comment 3 Denis Smirnov 2018-10-25 02:35:37 MSK
/usr/share/%name-%version/templates/default.latex

достаточно вставить в этот шаблон необходимые строки

локально -- скопировать этот шаблон в ~/.pandoc/templates/default.latex и написать уже там что угодно
Comment 4 Denis Smirnov 2020-06-26 01:14:02 MSK
По крайней мере в текущей версии pandoc шаблон по-умолчанию будет работать корректно, при указании опции -Vlang=ru-RU. Для примера:

echo тест | pandoc -V lang=ru-RU -o test.pdf