public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Add alternative language in YAML Header Markdown
@ 2021-01-30 12:47 'Marek Stepanek' via pandoc-discuss
       [not found] ` <1319e470-027d-4722-9d39-933e7177db5en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: 'Marek Stepanek' via pandoc-discuss @ 2021-01-30 12:47 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 690 bytes --]

Hello all,

once again a naive question: how I define two languages in my YAML-Headers: 

Not working:

lang: RU-ru,de
lang: "RU-ru,de"
lang: {RU-ru,de}

I am using Pandoc > Markdown > LaTeX > PDF

I need to include Cyrillic citations in my document. 

Greetings to all 


marek

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1319e470-027d-4722-9d39-933e7177db5en%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1213 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Add alternative language in YAML Header Markdown
       [not found] ` <1319e470-027d-4722-9d39-933e7177db5en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-01-31  1:42   ` John MacFarlane
       [not found]     ` <m27dnt51cg.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: John MacFarlane @ 2021-01-31  1:42 UTC (permalink / raw)
  To: 'Marek Stepanek' via pandoc-discuss, pandoc-discuss


Use 'lang' for your main document language.

Then, if you need to use a different language at some point
in the document, use a span

    [this in English]{lang=en}

You should get appropriate output in some formats, e.g. LaTeX.

"'Marek Stepanek' via pandoc-discuss"
<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> writes:

> Hello all,
>
> once again a naive question: how I define two languages in my YAML-Headers: 
>
> Not working:
>
> lang: RU-ru,de
> lang: "RU-ru,de"
> lang: {RU-ru,de}
>
> I am using Pandoc > Markdown > LaTeX > PDF
>
> I need to include Cyrillic citations in my document. 
>
> Greetings to all 
>
>
> marek
>
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1319e470-027d-4722-9d39-933e7177db5en%40googlegroups.com.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Add alternative language in YAML Header Markdown
       [not found]     ` <m27dnt51cg.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2021-01-31  8:59       ` 'Marek Stepanek' via pandoc-discuss
       [not found]         ` <06ad6f28-9d03-4180-8e9d-a7041570b895n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: 'Marek Stepanek' via pandoc-discuss @ 2021-01-31  8:59 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2398 bytes --]

Thank you John again for your answer. Unfortunately it is not so easy. In 
any case the Cyrillic alphabet needs some more tweaks: 

For people, looking for a solution: I am writing in Markdown, compiling 
with pandoc over LaTeX to pdf, without a template. Things you need for 
LaTeX-headers you have to insert in the Markdown Doc in YAML format 
separated on top and at the end by three hyphens: ---

I removed from my YAML headers in the markdown document 

lang: de

And then some more definitions are needed for LaTeX inserted in the same 
md-Doc in YAML-Format:

header-includes:
- \usepackage[T1,T2A]{fontenc}
- \usepackage[utf8]{inputenc}
- \usepackage[english,french,russian,main=german]{babel}

Hope this helps some people out here. 

Thx again for the amazing pandoc tool. 

marek

On Sunday, 31 January 2021 at 02:42:23 UTC+1 John MacFarlane wrote:

>
> Use 'lang' for your main document language.
>
> Then, if you need to use a different language at some point
> in the document, use a span
>
> [this in English]{lang=en}
>
> You should get appropriate output in some formats, e.g. LaTeX.
>
> "'Marek Stepanek' via pandoc-discuss"
> <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> writes:
>
> > Hello all,
> >
> > once again a naive question: how I define two languages in my 
> YAML-Headers: 
> >
> > Not working:
> >
> > lang: RU-ru,de
> > lang: "RU-ru,de"
> > lang: {RU-ru,de}
> >
> > I am using Pandoc > Markdown > LaTeX > PDF
> >
> > I need to include Cyrillic citations in my document. 
> >
> > Greetings to all 
> >
> >
> > marek
> >
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "pandoc-discuss" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/1319e470-027d-4722-9d39-933e7177db5en%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/06ad6f28-9d03-4180-8e9d-a7041570b895n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 3820 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Add alternative language in YAML Header Markdown
       [not found]         ` <06ad6f28-9d03-4180-8e9d-a7041570b895n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-01-31 10:44           ` 'Marek Stepanek' via pandoc-discuss
  2021-01-31 18:01           ` John MacFarlane
  1 sibling, 0 replies; 9+ messages in thread
From: 'Marek Stepanek' via pandoc-discuss @ 2021-01-31 10:44 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2684 bytes --]

Unfortunately my receipt is hindering LaTeX to render bold fonts. Probably 
I am missing something. 


On Sunday, 31 January 2021 at 09:59:06 UTC+1 Marek Stepanek wrote:

> Thank you John again for your answer. Unfortunately it is not so easy. In 
> any case the Cyrillic alphabet needs some more tweaks: 
>
> For people, looking for a solution: I am writing in Markdown, compiling 
> with pandoc over LaTeX to pdf, without a template. Things you need for 
> LaTeX-headers you have to insert in the Markdown Doc in YAML format 
> separated on top and at the end by three hyphens: ---
>
> I removed from my YAML headers in the markdown document 
>
> lang: de
>
> And then some more definitions are needed for LaTeX inserted in the same 
> md-Doc in YAML-Format:
>
> header-includes:
> - \usepackage[T1,T2A]{fontenc}
> - \usepackage[utf8]{inputenc}
> - \usepackage[english,french,russian,main=german]{babel}
>
> Hope this helps some people out here. 
>
> Thx again for the amazing pandoc tool. 
>
> marek
>
> On Sunday, 31 January 2021 at 02:42:23 UTC+1 John MacFarlane wrote:
>
>>
>> Use 'lang' for your main document language. 
>>
>> Then, if you need to use a different language at some point 
>> in the document, use a span 
>>
>> [this in English]{lang=en} 
>>
>> You should get appropriate output in some formats, e.g. LaTeX. 
>>
>> "'Marek Stepanek' via pandoc-discuss" 
>> <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> writes: 
>>
>> > Hello all, 
>> > 
>> > once again a naive question: how I define two languages in my 
>> YAML-Headers: 
>> > 
>> > Not working: 
>> > 
>> > lang: RU-ru,de 
>> > lang: "RU-ru,de" 
>> > lang: {RU-ru,de} 
>> > 
>> > I am using Pandoc > Markdown > LaTeX > PDF 
>> > 
>> > I need to include Cyrillic citations in my document. 
>> > 
>> > Greetings to all 
>> > 
>> > 
>> > marek 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups "pandoc-discuss" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/1319e470-027d-4722-9d39-933e7177db5en%40googlegroups.com. 
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6f1fa8ba-4402-491f-aaa3-c7413585fc69n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 4208 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Add alternative language in YAML Header Markdown
       [not found]         ` <06ad6f28-9d03-4180-8e9d-a7041570b895n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2021-01-31 10:44           ` 'Marek Stepanek' via pandoc-discuss
@ 2021-01-31 18:01           ` John MacFarlane
       [not found]             ` <m21re13s0n.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  1 sibling, 1 reply; 9+ messages in thread
From: John MacFarlane @ 2021-01-31 18:01 UTC (permalink / raw)
  To: 'Marek Stepanek' via pandoc-discuss, pandoc-discuss


You don't have to do this manually if you do as I suggest.
For example the document

```
---
lang: de
...

[hi there]{lang=ru}
```

will generate this in your LaTeX preamble, using the default template:

\ifxetex
  % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
  \usepackage{polyglossia}
  \setmainlanguage[]{german}
  \setotherlanguage[]{russian}
\else
  \usepackage[russian,main=ngerman]{babel}
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
  \newcommand{\textrussian}[2][]{\foreignlanguage{russian}{#2}}
  \newenvironment{russian}[2][]{\begin{otherlanguage}{russian}}{\end{otherlanguage}}
\fi

So adding the babel commands should be unnecessary.
Be sure to use --pdf-engine=xelatex or lualatex.
Then you also shouldn't need the fontenc and inputenc lines.

(I'm assuming your version of pandoc is relatively up to date.)

> And then some more definitions are needed for LaTeX inserted in the same 
> md-Doc in YAML-Format:
>
> header-includes:
> - \usepackage[T1,T2A]{fontenc}
> - \usepackage[utf8]{inputenc}
> - \usepackage[english,french,russian,main=german]{babel}
>
> Hope this helps some people out here. 
>
> Thx again for the amazing pandoc tool. 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Add alternative language in YAML Header Markdown
       [not found]             ` <m21re13s0n.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2021-02-01  7:37               ` 'Marek Stepanek' via pandoc-discuss
       [not found]                 ` <60ecbcf7-741b-436a-b40b-e753296421b0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: 'Marek Stepanek' via pandoc-discuss @ 2021-02-01  7:37 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3144 bytes --]

Thank you John for your patience!

I never used xelatex. But it seems to work. Only one little problem: there 
is apparently a difference between Cyrillic in a Footnote, which I insert 
directly in my MD-Doc as \footnote{[Михаил Моисеевич Бонгард]{lang=ru}} or 
in the text itself: [Михаил Моисеевич Бонгард]{lang=ru}

I need help again to define a font, containing more unicode characters as 
is used in pandoc > xelatex > pdf: 

I get the following error:

Error producing PDF.
! Package polyglossia Error: The current latin font latinmodern-math.otf(3) 
doe
s not contain the "Cyrillic" script!
(polyglossia)                Please define \cyrillicfont with 
\newfontfamily co
mmand.

See the polyglossia package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.143 Моисеевич Бонгард}

Putting it in a footnote I get a different error, but the same reason - the 
font:

[WARNING] Missing character: There is no М (U+041C) in font 
[lmroman10-regular]:mapping=tex-text;!
... etc

Could you help me again? How to define a \cyrillicfont with \newfontfamily 
(in my YAML Headers header-includes?)?

Best greetings

marek


On Sunday, 31 January 2021 at 19:01:28 UTC+1 John MacFarlane wrote:

>
> You don't have to do this manually if you do as I suggest.
> For example the document
>
> ```
> ---
> lang: de
> ...
>
> [hi there]{lang=ru}
> ```
>
> will generate this in your LaTeX preamble, using the default template:
>
> \ifxetex
> % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. 
> Hebrew, Arabic)
> \usepackage{polyglossia}
> \setmainlanguage[]{german}
> \setotherlanguage[]{russian}
> \else
> \usepackage[russian,main=ngerman]{babel}
> % get rid of language-specific shorthands (see #6817):
> \let\LanguageShortHands\languageshorthands
> \def\languageshorthands#1{}
> \newcommand{\textrussian}[2][]{\foreignlanguage{russian}{#2}}
>
> \newenvironment{russian}[2][]{\begin{otherlanguage}{russian}}{\end{otherlanguage}}
> \fi
>
> So adding the babel commands should be unnecessary.
> Be sure to use --pdf-engine=xelatex or lualatex.
> Then you also shouldn't need the fontenc and inputenc lines.
>
> (I'm assuming your version of pandoc is relatively up to date.)
>
> > And then some more definitions are needed for LaTeX inserted in the same 
> > md-Doc in YAML-Format:
> >
> > header-includes:
> > - \usepackage[T1,T2A]{fontenc}
> > - \usepackage[utf8]{inputenc}
> > - \usepackage[english,french,russian,main=german]{babel}
> >
> > Hope this helps some people out here. 
> >
> > Thx again for the amazing pandoc tool. 
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/60ecbcf7-741b-436a-b40b-e753296421b0n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 4180 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Add alternative language in YAML Header Markdown
       [not found]                 ` <60ecbcf7-741b-436a-b40b-e753296421b0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-02-01 14:14                   ` Julien Dutant
  2021-02-01 17:44                   ` John MacFarlane
  2021-02-01 18:04                   ` AW: " denis.maier-FfwAq0itz3ofv37vnLkPlQ
  2 siblings, 0 replies; 9+ messages in thread
From: Julien Dutant @ 2021-02-01 14:14 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 4452 bytes --]

Do you enter foonotes as \footnote{text text text} in markdown itself? 
^[text text text] would be safer.

You could try first compiling with a font that *has* cyrillic (e.g. 
Libertinus) to check that the document works.

Defining cyrillic fonts is a polyglossia / fontspec issue:
https://tex.stackexchange.com/questions/318394/sans-monospace-font-for-otherlanguage
 Cf also 
https://tex.stackexchange.com/questions/539296/overleafs-polyglossia-package-with-cyrillic-fonts

So I would try something like:
---
header-includes: |
  \newfontfamily{\cyrillicfont}{Libertinus Serif}
  \newfontfamily{\cyrillicfontsf}{Libertinus Sans}
--- 

Or this:
---
header-includes: |
  \newfontfamily{\cyrillicfont}{Libertinus Serif}[Script=Cyrillic]
  \newfontfamily{\cyrillicfontsf}{Libertinus Sans}[Script=Cyrillic]
--- 

But as mentioned in 
https://tex.stackexchange.com/questions/318394/sans-monospace-font-for-otherlanguage 
this might still not work if the default language is not a cyrillic script 
language.

J

On Monday, February 1, 2021 at 7:37:22 AM UTC mstep....-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org 
wrote:

> Thank you John for your patience!
>
> I never used xelatex. But it seems to work. Only one little problem: there 
> is apparently a difference between Cyrillic in a Footnote, which I insert 
> directly in my MD-Doc as \footnote{[Михаил Моисеевич Бонгард]{lang=ru}} or 
> in the text itself: [Михаил Моисеевич Бонгард]{lang=ru}
>
> I need help again to define a font, containing more unicode characters as 
> is used in pandoc > xelatex > pdf: 
>
> I get the following error:
>
> Error producing PDF.
> ! Package polyglossia Error: The current latin font 
> latinmodern-math.otf(3) doe
> s not contain the "Cyrillic" script!
> (polyglossia)                Please define \cyrillicfont with 
> \newfontfamily co
> mmand.
>
> See the polyglossia package documentation for explanation.
> Type  H <return>  for immediate help.
>  ...
>
> l.143 Моисеевич Бонгард}
>
> Putting it in a footnote I get a different error, but the same reason - 
> the font:
>
> [WARNING] Missing character: There is no М (U+041C) in font 
> [lmroman10-regular]:mapping=tex-text;!
> ... etc
>
> Could you help me again? How to define a \cyrillicfont with \newfontfamily 
> (in my YAML Headers header-includes?)?
>
> Best greetings
>
> marek
>
>
> On Sunday, 31 January 2021 at 19:01:28 UTC+1 John MacFarlane wrote:
>
>>
>> You don't have to do this manually if you do as I suggest. 
>> For example the document 
>>
>> ``` 
>> --- 
>> lang: de 
>> ... 
>>
>> [hi there]{lang=ru} 
>> ``` 
>>
>> will generate this in your LaTeX preamble, using the default template: 
>>
>> \ifxetex 
>> % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. 
>> Hebrew, Arabic) 
>> \usepackage{polyglossia} 
>> \setmainlanguage[]{german} 
>> \setotherlanguage[]{russian} 
>> \else 
>> \usepackage[russian,main=ngerman]{babel} 
>> % get rid of language-specific shorthands (see #6817): 
>> \let\LanguageShortHands\languageshorthands 
>> \def\languageshorthands#1{} 
>> \newcommand{\textrussian}[2][]{\foreignlanguage{russian}{#2}} 
>> \newenvironment{russian}[2][]{\begin{otherlanguage}{russian}}{\end{otherlanguage}} 
>>
>> \fi 
>>
>> So adding the babel commands should be unnecessary. 
>> Be sure to use --pdf-engine=xelatex or lualatex. 
>> Then you also shouldn't need the fontenc and inputenc lines. 
>>
>> (I'm assuming your version of pandoc is relatively up to date.) 
>>
>> > And then some more definitions are needed for LaTeX inserted in the 
>> same 
>> > md-Doc in YAML-Format: 
>> > 
>> > header-includes: 
>> > - \usepackage[T1,T2A]{fontenc} 
>> > - \usepackage[utf8]{inputenc} 
>> > - \usepackage[english,french,russian,main=german]{babel} 
>> > 
>> > Hope this helps some people out here. 
>> > 
>> > Thx again for the amazing pandoc tool. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c1567f04-8177-4cd3-b9ad-dcc38712a13dn%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 5786 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Add alternative language in YAML Header Markdown
       [not found]                 ` <60ecbcf7-741b-436a-b40b-e753296421b0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2021-02-01 14:14                   ` Julien Dutant
@ 2021-02-01 17:44                   ` John MacFarlane
  2021-02-01 18:04                   ` AW: " denis.maier-FfwAq0itz3ofv37vnLkPlQ
  2 siblings, 0 replies; 9+ messages in thread
From: John MacFarlane @ 2021-02-01 17:44 UTC (permalink / raw)
  To: 'Marek Stepanek' via pandoc-discuss, pandoc-discuss

"'Marek Stepanek' via pandoc-discuss"
<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> writes:

> Thank you John for your patience!
>
> I never used xelatex. But it seems to work. Only one little problem: there 
> is apparently a difference between Cyrillic in a Footnote, which I insert 
> directly in my MD-Doc as \footnote{[Михаил Моисеевич Бонгард]{lang=ru}} or 
> in the text itself: [Михаил Моисеевич Бонгард]{lang=ru}

Don't use raw tex to insert a footnote.  Use pandoc's markdown
syntax:

^[[Михаил Моисеевич Бонгард]{lang=ru}]

or

[^1]

[^1]: [Михаил Моисеевич Бонгард]{lang=ru}

> I need help again to define a font, containing more unicode characters as 
> is used in pandoc > xelatex > pdf: 

Set mainfont in your metadata to a system font that has Cyrillic characters.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m2v9bb1y4e.fsf%40MacBook-Pro.hsd1.ca.comcast.net.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* AW: Add alternative language in YAML Header Markdown
       [not found]                 ` <60ecbcf7-741b-436a-b40b-e753296421b0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2021-02-01 14:14                   ` Julien Dutant
  2021-02-01 17:44                   ` John MacFarlane
@ 2021-02-01 18:04                   ` denis.maier-FfwAq0itz3ofv37vnLkPlQ
  2 siblings, 0 replies; 9+ messages in thread
From: denis.maier-FfwAq0itz3ofv37vnLkPlQ @ 2021-02-01 18:04 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 4391 bytes --]

Just a side note: The current template seems to use polyglossia with xelatex and lualatex. Recentish versions of babel have much improved multiscript support. One particularly interesting feature is that you don't necessarily need to tag words in other scripts, but babel seems to be able to rely on rnicode ranges for that. That might not work in every case, but it could be handy in a lot of cases.

See, e.g. https://tex.stackexchange.com/a/579813

Best,
Denis

Von: 'Marek Stepanek' via pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Gesendet: Montag, 1. Februar 2021 08:37
An: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: Add alternative language in YAML Header Markdown

Thank you John for your patience!

I never used xelatex. But it seems to work. Only one little problem: there is apparently a difference between Cyrillic in a Footnote, which I insert directly in my MD-Doc as \footnote{[Михаил Моисеевич Бонгард]{lang=ru}} or in the text itself: [Михаил Моисеевич Бонгард]{lang=ru}

I need help again to define a font, containing more unicode characters as is used in pandoc > xelatex > pdf:

I get the following error:

Error producing PDF.
! Package polyglossia Error: The current latin font latinmodern-math.otf(3) doe
s not contain the "Cyrillic" script!
(polyglossia)                Please define \cyrillicfont with \newfontfamily co
mmand.

See the polyglossia package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.143 Моисеевич Бонгард}

Putting it in a footnote I get a different error, but the same reason - the font:

[WARNING] Missing character: There is no М (U+041C) in font [lmroman10-regular]:mapping=tex-text;!
... etc

Could you help me again? How to define a \cyrillicfont with \newfontfamily (in my YAML Headers header-includes?)?

Best greetings

marek

On Sunday, 31 January 2021 at 19:01:28 UTC+1 John MacFarlane wrote:

You don't have to do this manually if you do as I suggest.
For example the document

```
---
lang: de
...

[hi there]{lang=ru}
```

will generate this in your LaTeX preamble, using the default template:

\ifxetex
% Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
\usepackage{polyglossia}
\setmainlanguage[]{german}
\setotherlanguage[]{russian}
\else
\usepackage[russian,main=ngerman]{babel}
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
\newcommand{\textrussian}[2][]{\foreignlanguage{russian}{#2}}
\newenvironment{russian}[2][]{\begin{otherlanguage}{russian}}{\end{otherlanguage}}
\fi

So adding the babel commands should be unnecessary.
Be sure to use --pdf-engine=xelatex or lualatex.
Then you also shouldn't need the fontenc and inputenc lines.

(I'm assuming your version of pandoc is relatively up to date.)

> And then some more definitions are needed for LaTeX inserted in the same
> md-Doc in YAML-Format:
>
> header-includes:
> - \usepackage[T1,T2A]{fontenc}
> - \usepackage[utf8]{inputenc}
> - \usepackage[english,french,russian,main=german]{babel}
>
> Hope this helps some people out here.
>
> Thx again for the amazing pandoc tool.
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/60ecbcf7-741b-436a-b40b-e753296421b0n%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/60ecbcf7-741b-436a-b40b-e753296421b0n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e3d86f0d8fbf4ccaa68f30427699d671%40ub.unibe.ch.

[-- Attachment #2: Type: text/html, Size: 9370 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-01 18:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-30 12:47 Add alternative language in YAML Header Markdown 'Marek Stepanek' via pandoc-discuss
     [not found] ` <1319e470-027d-4722-9d39-933e7177db5en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-01-31  1:42   ` John MacFarlane
     [not found]     ` <m27dnt51cg.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2021-01-31  8:59       ` 'Marek Stepanek' via pandoc-discuss
     [not found]         ` <06ad6f28-9d03-4180-8e9d-a7041570b895n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-01-31 10:44           ` 'Marek Stepanek' via pandoc-discuss
2021-01-31 18:01           ` John MacFarlane
     [not found]             ` <m21re13s0n.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2021-02-01  7:37               ` 'Marek Stepanek' via pandoc-discuss
     [not found]                 ` <60ecbcf7-741b-436a-b40b-e753296421b0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-02-01 14:14                   ` Julien Dutant
2021-02-01 17:44                   ` John MacFarlane
2021-02-01 18:04                   ` AW: " denis.maier-FfwAq0itz3ofv37vnLkPlQ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).