Improving Unicode support in the Beamer template #54

Merged
merged 1 commit into from Mar 19, 2014

None yet

2 participants

Contributor
commented Feb 26, 2014
 The default Beamer template didn't work for a markdown source with Unicode characters. I copied some features from the normal Latex template and it seems to work better.
 KarolS Backported changes from default.latex to default.beamer in order to i… …mprove Unicode support 088fcca
commented on 088fcca Feb 26, 2014
 Does the usepackage{lmodern} change the font? Beamer's default uses a sans-serif font, and lmodern is a serif font. I wonder if that change belongs here...
Owner
 @jgm No, all fonts are sans-serif (well, except for the \texttt font, with is still that Courier-esque one). The output file looks like all standard Beamer presentations I have ever seen. I needed to add lmodern because I was getting ! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. without it. I have lots of accented (Latin-2) letters and Unicode symbols (like →) both in the main text and in the monospaced text. All of them look okay. I also rolled my finger over the keyboard while holding the AltGr key and I got some more errors: ! Package inputenc Error: Unicode char \u8:⅞ not set up for use with LaTeX.  but I was getting the exactly same kind of them for ordinary letters (like ś) before my modifications, so I'd still call it a progress.
replied Feb 28, 2014
 Note: the recommendation for LaTeX (which applies also to beamer) is to use xelatex or lualatex as your engine if you've got unicode characters in the document. LaTeX will handle some of them, with the packages we're including, but not all. +++ KarolS [Feb 26 14 16:22 ]: …
Contributor
commented Mar 19, 2014
 Xelatex and Lualatex solve nothing. I did some tests with the following input file: TEST ==== →→→→ë¥Ęč↑ıžší€↑±€£€↑ źźzź  In the examples below, old.beamer refers to the original template, and new.beamer refers to the template from this pull request. $pandoc o.md -o o.pdf -t beamer --latex-engine=xelatex --template=old.beamer pandoc: Error producing PDF from TeX source. ! Undefined control sequence. pandoc: Cannot decode byte '\x86': Data.Text.Internal.Encoding.streamDecodeUtf8With: Invalid UTF-8 stream  $ pandoc o.md -o o.pdf -t beamer --latex-engine=xelatex --template=new.beamer  $pandoc o.md -o o.pdf -t beamer --latex-engine=lualatex --template=old.beamer pandoc: Error producing PDF from TeX source. ! ******************************************** * XeTeX is required to compile this document. * Sorry! ********************************************. \RequireXeTeX ...********************************} \endgroup \fi l.18 \RequireXeTeX  $ pandoc o.md -o o.pdf -t beamer --latex-engine=lualatex --template=new.beamer pandoc: Error producing PDF from TeX source. ! ******************************************** * XeTeX is required to compile this document. * Sorry! ********************************************. \RequireXeTeX ...********************************} \endgroup \fi l.18 \RequireXeTeX  $pandoc o.md -o o.pdf -t beamer --latex-engine=pdflatex --template=old.beamer pandoc: Error producing PDF from TeX source. ! Package inputenc Error: Unicode char \u8:→ not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H for immediate help. ... l.47 \end{frame} Try running pandoc with --latex-engine=xelatex.  $ pandoc o.md -o o.pdf -t beamer --latex-engine=pdflatex --template=new.beamer  So, with the original template no engine worked, and with the new template only lualatex didn't work. Since people expect pandoc to work out-of-the-box and usually use it because they don't want to worry about Latex quirks, I think my patch at least makes things work.
Owner
commented Mar 19, 2014
 Thanks!
merged commit 0ab594b into jgm:master Mar 19, 2014