public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Bidirectional Markdown documents to PDF
@ 2022-03-06 15:03 Emiliano
       [not found] ` <dbe5712e-c50d-43e9-8046-48d16f5ee1b8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Emiliano @ 2022-03-06 15:03 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi everyone! I love Markdown and Pandoc, they are an incredible couple! For 
my studies, I need to write bidirectional documents prevalently using 
English/Italian with ancient Hebrew. I have no issue whatsoever when I work 
with Markdown files. However, when I convert the Markdown document to PDF 
through Pandoc (using XeLaTex as PDF engine), the Hebrew words are inverted 
due to the left-to-right default setting. My question is: How can I tell 
Pandoc to treat specific sentences or words as right-to-left and then go 
back to the default left-to-right? It is obvious to me that this work 
should be done in the Markdown document, but I just don't know how! Thanks 
in advance for your help!

-- 
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/dbe5712e-c50d-43e9-8046-48d16f5ee1b8n%40googlegroups.com.

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

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

* Re: Bidirectional Markdown documents to PDF
       [not found] ` <dbe5712e-c50d-43e9-8046-48d16f5ee1b8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-03-06 16:53   ` BPJ
       [not found]     ` <CADAJKhBx55tiRuvJqQGQGapLsi21PcWayCagBtj8wUb27S4sTQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: BPJ @ 2022-03-06 16:53 UTC (permalink / raw)
  To: pandoc-discuss

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

Wrap the rtl bits in spans and divs with the variable `dir=rtl`:

``````markdown
[rtl text]{dir=rtl}

::: {dir=rtl}
RTL paragraph.
:::
``````

If the main language is RTL you can use `dir=ltr` for LTR bits instead.

See

https://pandoc.org/MANUAL.html#language-variables under "dir"


Den sön 6 mars 2022 16:04Emiliano <gattulli.emiliano-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> Hi everyone! I love Markdown and Pandoc, they are an incredible couple!
> For my studies, I need to write bidirectional documents prevalently using
> English/Italian with ancient Hebrew. I have no issue whatsoever when I work
> with Markdown files. However, when I convert the Markdown document to PDF
> through Pandoc (using XeLaTex as PDF engine), the Hebrew words are inverted
> due to the left-to-right default setting. My question is: How can I tell
> Pandoc to treat specific sentences or words as right-to-left and then go
> back to the default left-to-right? It is obvious to me that this work
> should be done in the Markdown document, but I just don't know how! Thanks
> in advance for your help!
>
> --
> 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/dbe5712e-c50d-43e9-8046-48d16f5ee1b8n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/dbe5712e-c50d-43e9-8046-48d16f5ee1b8n%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/CADAJKhBx55tiRuvJqQGQGapLsi21PcWayCagBtj8wUb27S4sTQ%40mail.gmail.com.

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

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

* Re: Bidirectional Markdown documents to PDF
       [not found]     ` <CADAJKhBx55tiRuvJqQGQGapLsi21PcWayCagBtj8wUb27S4sTQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2022-03-07 10:30       ` Emiliano
       [not found]         ` <aed50487-27b8-4ff0-83a6-3bd4bd68b59dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Emiliano @ 2022-03-07 10:30 UTC (permalink / raw)
  To: pandoc-discuss


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

I realized that I sent my previous response in a private message!

When I try the span, Pandoc generates this error:

Error producing PDF.
! Undefined control sequence.
l.66 This is Hebrew text \RL

When I try the div, Pandoc generates this error:

Error producing PDF.
! LaTeX Error: Environment RTL undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.66 \begin{RTL}

The Markdown for the span is: This is Hebrew text [בְּרֵאשִׁ֖ית בָּרָ֣א 
אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃]{dir=rtl}.

The Markdown for the div is:

::: {dir=rtl}
בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
:::

The command for Pandoc in the terminal is: pandoc --pdf-engine=xelatex 
test.md -o test.pdf

I am currently running Pandoc v. 2.17.1.1 on a macOS Monterey. Hope this 
helps!

Il giorno domenica 6 marzo 2022 alle 17:53:34 UTC+1 BPJ ha scritto:

> Wrap the rtl bits in spans and divs with the variable `dir=rtl`:
>
> ``````markdown
> [rtl text]{dir=rtl}
>
> ::: {dir=rtl}
> RTL paragraph.
> :::
> ``````
>
> If the main language is RTL you can use `dir=ltr` for LTR bits instead.
>
> See
>
> https://pandoc.org/MANUAL.html#language-variables under "dir"
>
>
> Den sön 6 mars 2022 16:04Emiliano <gattulli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>
>> Hi everyone! I love Markdown and Pandoc, they are an incredible couple! 
>> For my studies, I need to write bidirectional documents prevalently using 
>> English/Italian with ancient Hebrew. I have no issue whatsoever when I work 
>> with Markdown files. However, when I convert the Markdown document to PDF 
>> through Pandoc (using XeLaTex as PDF engine), the Hebrew words are inverted 
>> due to the left-to-right default setting. My question is: How can I tell 
>> Pandoc to treat specific sentences or words as right-to-left and then go 
>> back to the default left-to-right? It is obvious to me that this work 
>> should be done in the Markdown document, but I just don't know how! Thanks 
>> in advance for your help! 
>>
>> -- 
>> 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/dbe5712e-c50d-43e9-8046-48d16f5ee1b8n%40googlegroups.com 
>> <https://groups.google.com/d/msgid/pandoc-discuss/dbe5712e-c50d-43e9-8046-48d16f5ee1b8n%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/aed50487-27b8-4ff0-83a6-3bd4bd68b59dn%40googlegroups.com.

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

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

* Re: Bidirectional Markdown documents to PDF
       [not found]         ` <aed50487-27b8-4ff0-83a6-3bd4bd68b59dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-03-07 20:37           ` BPJ
       [not found]             ` <CADAJKhAo7+fR77OO-kxnG98PD6j+Abtb3xyHLx9tr_HJJXXXwQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: BPJ @ 2022-03-07 20:37 UTC (permalink / raw)
  To: pandoc-discuss

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

Sorry for late reply. Busy day!

From a quick glance at Pandoc's default LaTeX template it seems like
activation of bidi support requires you to set the `lang` variable (usually
in a Pandoc defaults file or the document metadata) for the main language
of the document (I would guess in your case to it-IT, it-CH, en-GB or
en-US) because only then is the babel package, and with it bidi support. I
hope this helps.

You should probably also set the `lang=he` variable on the spans and divs
containing the Hebrew text. (Strictly speaking the language code for
Ancient Hebrew is hbo, but it seems Pandoc doesn't support it. You might
want to open an issue for that.)

Here is a lua filter which will save you some typing and make upgrading
easier if and when Pandoc supports the hbo tag.

``````lua
-- he-lang.lua
-- Pandoc filter which sets the proper dir and lang tags for Hebrew on
spans and divs with a class `.he`:
-- 
--     [Hebrew text]{.he}
--
--     :::he
--     Hebrew paragraph.
--     :::
--
-- If and when Pandoc supports the hbo language tag for Ancient Hebrew
-- you may want to change `elem.attributes.lang = 'he'` into
-- `elem.attributes.lang = 'hbo'`.


local function handler (elem)
  if elem.classes:includes('he') then
    elem.attributes.dir = 'rtl'
    elem.attributes.lang = 'he'
    return elem
  end
  return nil
end

return {
  { Span = handler, Div = handler }
}
``````

Den mån 7 mars 2022 11:31Emiliano <gattulli.emiliano-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> I realized that I sent my previous response in a private message!
>
> When I try the span, Pandoc generates this error:
>
> Error producing PDF.
> ! Undefined control sequence.
> l.66 This is Hebrew text \RL
>
> When I try the div, Pandoc generates this error:
>
> Error producing PDF.
> ! LaTeX Error: Environment RTL undefined.
>
> See the LaTeX manual or LaTeX Companion for explanation.
> Type  H <return>  for immediate help.
>  ...
>
> l.66 \begin{RTL}
>
> The Markdown for the span is: This is Hebrew text [בְּרֵאשִׁ֖ית בָּרָ֣א
> אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃]{dir=rtl}.
>
> The Markdown for the div is:
>
> ::: {dir=rtl}
> בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
> :::
>
> The command for Pandoc in the terminal is: pandoc --pdf-engine=xelatex
> test.md -o test.pdf
>
> I am currently running Pandoc v. 2.17.1.1 on a macOS Monterey. Hope this
> helps!
>
> Il giorno domenica 6 marzo 2022 alle 17:53:34 UTC+1 BPJ ha scritto:
>
>> Wrap the rtl bits in spans and divs with the variable `dir=rtl`:
>>
>> ``````markdown
>> [rtl text]{dir=rtl}
>>
>> ::: {dir=rtl}
>> RTL paragraph.
>> :::
>> ``````
>>
>> If the main language is RTL you can use `dir=ltr` for LTR bits instead.
>>
>> See
>>
>> https://pandoc.org/MANUAL.html#language-variables under "dir"
>>
>>
>> Den sön 6 mars 2022 16:04Emiliano <gattulli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>>
>>> Hi everyone! I love Markdown and Pandoc, they are an incredible couple!
>>> For my studies, I need to write bidirectional documents prevalently using
>>> English/Italian with ancient Hebrew. I have no issue whatsoever when I work
>>> with Markdown files. However, when I convert the Markdown document to PDF
>>> through Pandoc (using XeLaTex as PDF engine), the Hebrew words are inverted
>>> due to the left-to-right default setting. My question is: How can I tell
>>> Pandoc to treat specific sentences or words as right-to-left and then go
>>> back to the default left-to-right? It is obvious to me that this work
>>> should be done in the Markdown document, but I just don't know how! Thanks
>>> in advance for your help!
>>>
>>> --
>>> 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/dbe5712e-c50d-43e9-8046-48d16f5ee1b8n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/dbe5712e-c50d-43e9-8046-48d16f5ee1b8n%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/aed50487-27b8-4ff0-83a6-3bd4bd68b59dn%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/aed50487-27b8-4ff0-83a6-3bd4bd68b59dn%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/CADAJKhAo7%2BfR77OO-kxnG98PD6j%2BAbtb3xyHLx9tr_HJJXXXwQ%40mail.gmail.com.

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

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

* AW: Bidirectional Markdown documents to PDF
       [not found]             ` <CADAJKhAo7+fR77OO-kxnG98PD6j+Abtb3xyHLx9tr_HJJXXXwQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2022-03-08  9:15               ` denis.maier-NSENcxR/0n0
       [not found]                 ` <f169e0fcedb04d2d8bb9d6b0c8ee4219-NSENcxR/0n0@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: denis.maier-NSENcxR/0n0 @ 2022-03-08  9:15 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Hmm, I’ve tried this :

```markdown
---
mainfont: Linux Libertine O
lang: en
---

The Markdown for the span is: This is Hebrew text [בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃]{dir=rtl}.

The Markdown for the div is:

::: {dir=rtl}
בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
:::
```

But I’m getting the same error. Looking at the template it seems that there are some definitions to make \RL work with pdftex, but not with lualatex or xelatex.

I can however use this :

```markdown
---
mainfont: Linux Libertine O
lang: en
---

The Markdown for the span is: This is Hebrew text בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃.

The Markdown for the div is:

בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
```

i.e., no spans or divs at all !

This gives okish results with
pandoc input.md -o output.pdf --pdf-engine=lualatex
(Apart from the missing characters, probably cantilation marks. A font with better hebrew support might give better results.)
This works with lualatex because babel’s built-in bidi algorithm is activated in that case. It won’t work with xelatex, though.

If you add the language variables for these pieces you will also be able to change the fonts for these pieces.

```markdown
---
mainfont: Linux Libertine O
lang: en
header-includes: \babelfont[hebrew]{rm}{SBL Hebrew}
---

The Markdown for the span is: This is Hebrew text בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃.

The Markdown for the div is:

בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃

[בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃]{lang=he}
```

pandoc input.md -o output.pdf --pdf-engine=lualatex

Denis




Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von BPJ
Gesendet: Montag, 7. März 2022 21:38
An: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: Bidirectional Markdown documents to PDF

Sorry for late reply. Busy day!

From a quick glance at Pandoc's default LaTeX template it seems like activation of bidi support requires you to set the `lang` variable (usually in a Pandoc defaults file or the document metadata) for the main language of the document (I would guess in your case to it-IT, it-CH, en-GB or en-US) because only then is the babel package, and with it bidi support. I hope this helps.

You should probably also set the `lang=he` variable on the spans and divs containing the Hebrew text. (Strictly speaking the language code for Ancient Hebrew is hbo, but it seems Pandoc doesn't support it. You might want to open an issue for that.)

Here is a lua filter which will save you some typing and make upgrading easier if and when Pandoc supports the hbo tag.

``````lua
-- he-lang.lua
-- Pandoc filter which sets the proper dir and lang tags for Hebrew on spans and divs with a class `.he`:
--
--     [Hebrew text]{.he}
--
--     :::he
--     Hebrew paragraph.
--     :::
--
-- If and when Pandoc supports the hbo language tag for Ancient Hebrew
-- you may want to change `elem.attributes.lang = 'he'` into
-- `elem.attributes.lang = 'hbo'`.


local function handler (elem)
  if elem.classes:includes('he') then
    elem.attributes.dir = 'rtl'
    elem.attributes.lang = 'he'
    return elem
  end
  return nil
end

return {
  { Span = handler, Div = handler }
}
``````

Den mån 7 mars 2022 11:31Emiliano <gattulli.emiliano-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org<mailto:gattulli.emiliano-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> skrev:
I realized that I sent my previous response in a private message!

When I try the span, Pandoc generates this error:

Error producing PDF.
! Undefined control sequence.
l.66 This is Hebrew text \RL

When I try the div, Pandoc generates this error:

Error producing PDF.
! LaTeX Error: Environment RTL undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.66 \begin{RTL}

The Markdown for the span is: This is Hebrew text [בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃]{dir=rtl}.

The Markdown for the div is:

::: {dir=rtl}
בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
:::

The command for Pandoc in the terminal is: pandoc --pdf-engine=xelatex test.md -o test.pdf

I am currently running Pandoc v. 2.17.1.1 on a macOS Monterey. Hope this helps!

Il giorno domenica 6 marzo 2022 alle 17:53:34 UTC+1 BPJ ha scritto:
Wrap the rtl bits in spans and divs with the variable `dir=rtl`:

``````markdown
[rtl text]{dir=rtl}

::: {dir=rtl}
RTL paragraph.
:::
``````

If the main language is RTL you can use `dir=ltr` for LTR bits instead.

See

https://pandoc.org/MANUAL.html#language-variables under "dir"


Den sön 6 mars 2022 16:04Emiliano <gattulli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org<mailto:gattulli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> skrev:
Hi everyone! I love Markdown and Pandoc, they are an incredible couple! For my studies, I need to write bidirectional documents prevalently using English/Italian with ancient Hebrew. I have no issue whatsoever when I work with Markdown files. However, when I convert the Markdown document to PDF through Pandoc (using XeLaTex as PDF engine), the Hebrew words are inverted due to the left-to-right default setting. My question is: How can I tell Pandoc to treat specific sentences or words as right-to-left and then go back to the default left-to-right? It is obvious to me that this work should be done in the Markdown document, but I just don't know how! Thanks in advance for your help!
--
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...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discus...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/dbe5712e-c50d-43e9-8046-48d16f5ee1b8n%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/dbe5712e-c50d-43e9-8046-48d16f5ee1b8n%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-/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/aed50487-27b8-4ff0-83a6-3bd4bd68b59dn%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/aed50487-27b8-4ff0-83a6-3bd4bd68b59dn%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-/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/CADAJKhAo7%2BfR77OO-kxnG98PD6j%2BAbtb3xyHLx9tr_HJJXXXwQ%40mail.gmail.com<https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAo7%2BfR77OO-kxnG98PD6j%2BAbtb3xyHLx9tr_HJJXXXwQ%40mail.gmail.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/f169e0fcedb04d2d8bb9d6b0c8ee4219%40unibe.ch.

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

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

* Re: AW: Bidirectional Markdown documents to PDF
       [not found]                 ` <f169e0fcedb04d2d8bb9d6b0c8ee4219-NSENcxR/0n0@public.gmane.org>
@ 2022-03-08 16:44                   ` John MacFarlane
       [not found]                     ` <m25yoov1fn.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2022-03-08 16:44 UTC (permalink / raw)
  To: denis.maier-NSENcxR/0n0, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


I don't recall why the RL macro isn't defined for xelatex.
Maybe someone who was involved with that could comment?


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

* Re: AW: Bidirectional Markdown documents to PDF
       [not found]                     ` <m25yoov1fn.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
@ 2022-03-09 14:43                       ` Emiliano
  0 siblings, 0 replies; 7+ messages in thread
From: Emiliano @ 2022-03-09 14:43 UTC (permalink / raw)
  To: pandoc-discuss


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

Problem solved! Thanks Denis!

On the basis of Denis' comment, I worked on it a bit more and I opted for a 
more appealing writing experience since I use Obsidian with the Live 
Preview feature to write in Markdown. First of all, as Denis suggested, I 
need to declare in the YAML front matter the main language and the font for 
ancient Hebrew (which in my case is SBL Hebrew).

```yaml

---
lang: en-US
header-includes: \babelfont[hebrew]{rm}{SBL Hebrew}
---

```

Then, I write paragraphs separating the Hebrew text with HTML spans in 
which I declare the Hebrew language.

```markdown

This is a simple paragraph written in English and this <span 
lang=he>אֶרֶץ</span> means 'earth' in ancient Hebrew.

```

By using HTML spans instead of Pandoc native spans (this also works with 
divs), Obsidian hides the HTML code with the result of a clean text. In my 
tests, both XeLaTex and LuaLaTex work fine with this Pandoc command in the 
terminal:

$ pandoc --pdf-engine=xelatex input.md -o output.pdf

I also used this method with Greek Koiné and it works perfectly fine. In 
that case, the YAML front matter should be:

```yaml

lang: en-US
header-includes: \babelfont[greek]{rm}{SBL Greek}

```

The Markdown:

```markdown

This is a simple paragraph written in English and this <span 
lang=el>κόσμος</span> means 'world' in Greek Koiné.

```

I genuinely hope this could help those who have issues in writing 
bidirectional documents in Markdown to be converted in PDF through Pandoc.

Il giorno martedì 8 marzo 2022 alle 17:44:52 UTC+1 John MacFarlane ha 
scritto:

>
> I don't recall why the RL macro isn't defined for xelatex.
> Maybe someone who was involved with that could comment?
>
>

-- 
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/f8a6394b-9783-4e89-845a-29480c495e7cn%40googlegroups.com.

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

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

end of thread, other threads:[~2022-03-09 14:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-06 15:03 Bidirectional Markdown documents to PDF Emiliano
     [not found] ` <dbe5712e-c50d-43e9-8046-48d16f5ee1b8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-03-06 16:53   ` BPJ
     [not found]     ` <CADAJKhBx55tiRuvJqQGQGapLsi21PcWayCagBtj8wUb27S4sTQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-03-07 10:30       ` Emiliano
     [not found]         ` <aed50487-27b8-4ff0-83a6-3bd4bd68b59dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-03-07 20:37           ` BPJ
     [not found]             ` <CADAJKhAo7+fR77OO-kxnG98PD6j+Abtb3xyHLx9tr_HJJXXXwQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-03-08  9:15               ` AW: " denis.maier-NSENcxR/0n0
     [not found]                 ` <f169e0fcedb04d2d8bb9d6b0c8ee4219-NSENcxR/0n0@public.gmane.org>
2022-03-08 16:44                   ` John MacFarlane
     [not found]                     ` <m25yoov1fn.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2022-03-09 14:43                       ` Emiliano

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).