public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Markdown for a RTL text direction blockquote
@ 2022-04-24  0:26 Lyndon Drake
       [not found] ` <51cb4ac6-f391-4351-a895-d076bce6e6a9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Lyndon Drake @ 2022-04-24  0:26 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi,

Is there canonical syntax for setting attributes on a Markdown blockquote?

If this is a normal blockquote:

```
> This is a blockquote paragraph.
```

What's the best way to tell `pandoc` that the text direction is RTL? Is 
there anything like this:

```
> עברית זה. {dir=rtl}
```

(I realise this doesn't work, and I also realise that I could use a div, 
but I'd lose the nice easily readable Markdown syntax for a blockquote.)

Best,
Lyndon

-- 
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/51cb4ac6-f391-4351-a895-d076bce6e6a9n%40googlegroups.com.

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

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

* Re: Markdown for a RTL text direction blockquote
       [not found] ` <51cb4ac6-f391-4351-a895-d076bce6e6a9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-04-24  6:39   ` Albert Krewinkel
       [not found]     ` <87ee1nnfku.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Albert Krewinkel @ 2022-04-24  6:39 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw; +Cc: Lyndon Drake

CommonMark with extensions (`commonmark_x`) has the *attribute*
extension, which allows to add the attributes before the block like so:

Lyndon Drake <isenguard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

```
{dir=rtl}
> This is a blockquote paragraph.
```

Pandoc currently doesn't support attributes on blockquote elements, so
the above is currently just a shorthand for a wrapping div:

```
::: {dir=rtl}
> This is a blockquote paragraph.
:::
```

The latter also works with "normal" pandoc Markdown.

-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


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

* Re: Markdown for a RTL text direction blockquote
       [not found]     ` <87ee1nnfku.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2022-04-24  7:08       ` Lyndon Drake
       [not found]         ` <b1aca139-53a8-4f7d-b6af-394463693812n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Lyndon Drake @ 2022-04-24  7:08 UTC (permalink / raw)
  To: pandoc-discuss


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

Thanks, that seems to generate the appropriate LaTeX. But with the default 
template, I get an 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.193 \begin{RTL}
```

On Sunday, 24 April 2022 at 18:47:08 UTC+12 Albert Krewinkel wrote:

> CommonMark with extensions (`commonmark_x`) has the *attribute*
> extension, which allows to add the attributes before the block like so:
>
> Lyndon Drake <isen...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> ```
> {dir=rtl}
> > This is a blockquote paragraph.
> ```
>
> Pandoc currently doesn't support attributes on blockquote elements, so
> the above is currently just a shorthand for a wrapping div:
>
> ```
> ::: {dir=rtl}
> > This is a blockquote paragraph.
> :::
> ```
>
> The latter also works with "normal" pandoc Markdown.
>
> -- 
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
>

-- 
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/b1aca139-53a8-4f7d-b6af-394463693812n%40googlegroups.com.

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

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

* Re: Markdown for a RTL text direction blockquote
       [not found]         ` <b1aca139-53a8-4f7d-b6af-394463693812n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-04-24  7:21           ` Lyndon Drake
  2022-04-24  9:01           ` Albert Krewinkel
  1 sibling, 0 replies; 9+ messages in thread
From: Lyndon Drake @ 2022-04-24  7:21 UTC (permalink / raw)
  To: pandoc-discuss


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

I should say, that's using LuaLaTeX as the pdf-engine. What I can get to 
work is a blockquote with a language attribute:

```
::: {lang=he}
עברית
:::
```


On Sunday, 24 April 2022 at 19:08:11 UTC+12 Lyndon Drake wrote:

> Thanks, that seems to generate the appropriate LaTeX. But with the default 
> template, I get an 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.193 \begin{RTL}
> ```
>
> On Sunday, 24 April 2022 at 18:47:08 UTC+12 Albert Krewinkel wrote:
>
>> CommonMark with extensions (`commonmark_x`) has the *attribute*
>> extension, which allows to add the attributes before the block like so:
>>
>> Lyndon Drake <isen...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>> ```
>> {dir=rtl}
>> > This is a blockquote paragraph.
>> ```
>>
>> Pandoc currently doesn't support attributes on blockquote elements, so
>> the above is currently just a shorthand for a wrapping div:
>>
>> ```
>> ::: {dir=rtl}
>> > This is a blockquote paragraph.
>> :::
>> ```
>>
>> The latter also works with "normal" pandoc Markdown.
>>
>> -- 
>> Albert Krewinkel
>> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
>>
>

-- 
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/f4230524-0d07-4335-9cf5-7c3e6c9654c4n%40googlegroups.com.

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

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

* Re: Markdown for a RTL text direction blockquote
       [not found]         ` <b1aca139-53a8-4f7d-b6af-394463693812n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2022-04-24  7:21           ` Lyndon Drake
@ 2022-04-24  9:01           ` Albert Krewinkel
       [not found]             ` <87a6caonsc.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  1 sibling, 1 reply; 9+ messages in thread
From: Albert Krewinkel @ 2022-04-24  9:01 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw; +Cc: Lyndon Drake


Lyndon Drake <isenguard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Thanks, that seems to generate the appropriate LaTeX. But with the
> default template, I get an 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.193 \begin{RTL}
>
> ```

That looks like a pandoc bug. It works with pdflatex, but with neither
LuaLaTeX nor XeLaTeX.

Please open an issue for this on the GitHub bug tracker.


-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


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

* AW: Markdown for a RTL text direction blockquote
       [not found]             ` <87a6caonsc.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2022-04-24 10:11               ` denis.maier-NSENcxR/0n0
       [not found]                 ` <3eabd35901464701aee2dd5051e298d3-NSENcxR/0n0@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: denis.maier-NSENcxR/0n0 @ 2022-04-24 10:11 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw; +Cc: isenguard-Re5JQEeQqe8AvxtiuMwx3w

See also here:
https://groups.google.com/g/pandoc-discuss/c/OUCwJtfwzgs?pli=1

________________________________________
Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> im Auftrag von Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
Gesendet: Sonntag, 24. April 2022 11:01:53
An: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Cc: Lyndon Drake
Betreff: Re: Markdown for a RTL text direction blockquote

Lyndon Drake <isenguard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Thanks, that seems to generate the appropriate LaTeX. But with the
> default template, I get an 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.193 \begin{RTL}
>
> ```

That looks like a pandoc bug. It works with pdflatex, but with neither
LuaLaTeX nor XeLaTeX.

Please open an issue for this on the GitHub bug tracker.


--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124

--
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/87a6caonsc.fsf%40zeitkraut.de.


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

* Re: AW: Markdown for a RTL text direction blockquote
       [not found]                 ` <3eabd35901464701aee2dd5051e298d3-NSENcxR/0n0@public.gmane.org>
@ 2022-04-24 19:33                   ` John MacFarlane
       [not found]                     ` <m2czh6s2cd.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: John MacFarlane @ 2022-04-24 19:33 UTC (permalink / raw)
  To: denis.maier-NSENcxR/0n0, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
  Cc: isenguard-Re5JQEeQqe8AvxtiuMwx3w


I see that the latex template has

\ifPDFTeX    
  \TeXXeTstate=1
  \newcommand{\RL}[1]{\beginR #1\endR}
  \newcommand{\LR}[1]{\beginL #1\endL}     
  \newenvironment{RTL}{\beginR}{\endR}                
  \newenvironment{LTR}{\beginL}{\endL}
\fi

so these commands are only defined for pdflatex.
Presumably because `\beginR`, `\beginL` aren't
defined for xelatex/lualatex?  I really don't know
anything about this, but we shouldn't be using
a command that is not going to be defined in
xelatex/lualatex.  (At minimum we could define
no-op versions in these formats.)

Does anyone out there know about RTL support in LaTeX?



<denis.maier-NSENcxR/0n0@public.gmane.org> writes:

> See also here:
> https://groups.google.com/g/pandoc-discuss/c/OUCwJtfwzgs?pli=1
>
> ________________________________________
> Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> im Auftrag von Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
> Gesendet: Sonntag, 24. April 2022 11:01:53
> An: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> Cc: Lyndon Drake
> Betreff: Re: Markdown for a RTL text direction blockquote
>
> Lyndon Drake <isenguard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>> Thanks, that seems to generate the appropriate LaTeX. But with the
>> default template, I get an 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.193 \begin{RTL}
>>
>> ```
>
> That looks like a pandoc bug. It works with pdflatex, but with neither
> LuaLaTeX nor XeLaTeX.
>
> Please open an issue for this on the GitHub bug tracker.
>
>
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124
>
> --
> 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/87a6caonsc.fsf%40zeitkraut.de.
>
> -- 
> 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/3eabd35901464701aee2dd5051e298d3%40unibe.ch.


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

* Re: AW: Markdown for a RTL text direction blockquote
       [not found]                     ` <m2czh6s2cd.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
@ 2022-04-24 20:45                       ` Albert Krewinkel
       [not found]                         ` <87wnfemcgh.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Albert Krewinkel @ 2022-04-24 20:45 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> writes:

> Does anyone out there know about RTL support in LaTeX?

I tried to read up on it, but didn't really get any smarter. The only
interesting thing I came across is this quote from the babel manual:

> No macros to select the writing direction are provided, either –
> writing direction is intrinsic to each script and therefore it is best
> set by the language (which can be a dummy one). Furthermore, there are
> in fact two right-to-left modes, depending on the language, which
> differ in the way ‘weak’ numeric characters are ordered (eg, Arabic
> %123 vs Hebrew 123%).

From the sound of it, defining a placeholder languages could be an
option to select direction.

-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124

-- 
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/87wnfemcgh.fsf%40zeitkraut.de.


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

* Re: AW: Markdown for a RTL text direction blockquote
       [not found]                         ` <87wnfemcgh.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2022-04-25  3:56                           ` Lyndon Drake
  0 siblings, 0 replies; 9+ messages in thread
From: Lyndon Drake @ 2022-04-25  3:56 UTC (permalink / raw)
  To: pandoc-discuss


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

To me there are two issues:

- one is that it's quite legitimate to do dir=rtl for e.g. HTML as the 
intended output, and this probably shouldn't generate LaTeX code that will 
fail in LuaLaTeX or XeLaTeX given those are the best LaTeX engines to use 
for bidi text

- the other is that Babel really doesn't have a way to change text 
direction, so the only way to do this in a babel-compliant way is to define 
a dummy language. I could potentially ask the babel maintainer for help 
doing this, as they've been very helpful to me in the past. An alternative 
would be to have dummy definitions of the macros that pandoc generates 
LaTeX calls to for dir=rtl so that at least it would all then fail silently.

For my own use I can just specify the actual language but I think it would 
make sense to avoid being able to generate error-producing LaTeX code?

On Monday, 25 April 2022 at 08:52:09 UTC+12 Albert Krewinkel wrote:

>
> John MacFarlane <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> writes:
>
> > Does anyone out there know about RTL support in LaTeX?
>
> I tried to read up on it, but didn't really get any smarter. The only
> interesting thing I came across is this quote from the babel manual:
>
> > No macros to select the writing direction are provided, either –
> > writing direction is intrinsic to each script and therefore it is best
> > set by the language (which can be a dummy one). Furthermore, there are
> > in fact two right-to-left modes, depending on the language, which
> > differ in the way ‘weak’ numeric characters are ordered (eg, Arabic
> > %123 vs Hebrew 123%).
>
> From the sound of it, defining a placeholder languages could be an
> option to select direction.
>
> -- 
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
>

-- 
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/c507fb57-c98e-4cdc-a82d-c70d485d59b4n%40googlegroups.com.

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

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

end of thread, other threads:[~2022-04-25  3:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24  0:26 Markdown for a RTL text direction blockquote Lyndon Drake
     [not found] ` <51cb4ac6-f391-4351-a895-d076bce6e6a9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-04-24  6:39   ` Albert Krewinkel
     [not found]     ` <87ee1nnfku.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-04-24  7:08       ` Lyndon Drake
     [not found]         ` <b1aca139-53a8-4f7d-b6af-394463693812n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-04-24  7:21           ` Lyndon Drake
2022-04-24  9:01           ` Albert Krewinkel
     [not found]             ` <87a6caonsc.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-04-24 10:11               ` AW: " denis.maier-NSENcxR/0n0
     [not found]                 ` <3eabd35901464701aee2dd5051e298d3-NSENcxR/0n0@public.gmane.org>
2022-04-24 19:33                   ` John MacFarlane
     [not found]                     ` <m2czh6s2cd.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2022-04-24 20:45                       ` Albert Krewinkel
     [not found]                         ` <87wnfemcgh.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-04-25  3:56                           ` Lyndon Drake

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