public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* RST Title Reference unformated in various output formats
@ 2020-07-31 22:02 T. Kurt Bond
       [not found] ` <CAN1EhV91MgdwZDN5=dSPOObrNiiO=xU9=OAXgc7NX5Dbhrg+jA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: T. Kurt Bond @ 2020-07-31 22:02 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

An RST title reference like `Master and Commander` turns into a span with a
title-ref class.  In HTML output this turns into <span
class="title-ref">Master and Commander</span>, with no special handling,
which can always be styled by CSS.  However, in ms, context, and latex
output there is no formatting applied, so it comes out as regular text.  Is
that the intended result, and any formatting should be applied by
user-written filters, or should the output formats treat this differently?
For example, in ms output, the ms Writer could wrapped it in \fI and \fP.
Similar simple formatting could be applied in the other output formats.
-- 
T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io

-- 
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/CAN1EhV91MgdwZDN5%3DdSPOObrNiiO%3DxU9%3DOAXgc7NX5Dbhrg%2BjA%40mail.gmail.com.

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

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

* Re: RST Title Reference unformated in various output formats
       [not found] ` <CAN1EhV91MgdwZDN5=dSPOObrNiiO=xU9=OAXgc7NX5Dbhrg+jA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-08-01  0:47   ` John MacFarlane
       [not found]     ` <m27dujyyx8.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2020-08-01  0:47 UTC (permalink / raw)
  To: T. Kurt Bond, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Can you give an example and the command you used to convert it?

"T. Kurt Bond" <tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> An RST title reference like `Master and Commander` turns into a span with a
> title-ref class.  In HTML output this turns into <span
> class="title-ref">Master and Commander</span>, with no special handling,
> which can always be styled by CSS.  However, in ms, context, and latex
> output there is no formatting applied, so it comes out as regular text.  Is
> that the intended result, and any formatting should be applied by
> user-written filters, or should the output formats treat this differently?
> For example, in ms output, the ms Writer could wrapped it in \fI and \fP.
> Similar simple formatting could be applied in the other output formats.
> -- 
> T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io
>
> -- 
> 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/CAN1EhV91MgdwZDN5%3DdSPOObrNiiO%3DxU9%3DOAXgc7NX5Dbhrg%2BjA%40mail.gmail.com.


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

* Re: RST Title Reference unformated in various output formats
       [not found]     ` <m27dujyyx8.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2020-08-01  1:26       ` T. Kurt Bond
       [not found]         ` <CAN1EhV_k6YFVQQ6wt68x8Z0bJK4o18y==vKYjujMxJ4oWjrtsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: T. Kurt Bond @ 2020-08-01  1:26 UTC (permalink / raw)
  To: John MacFarlane; +Cc: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Here you go.
Title Ref is Unformated in Output Formats

Title refs in RST input are not formatted in ms, context, and latex output.

I'm using the following version of Pandoc:

pandoc 2.10.1
Compiled with pandoc-types 1.21, texmath 0.12.0.2, skylighting 0.8.5

Under the following OS:

Mac OS X, Version 10.15.6, Build 19G73

The outputs are generated with the commands:

 <#cb3-1>pandoc -r rst -w ms --output=tru-rst.ms tru.rst
<#cb3-2>pandoc -r rst -w latex --pdf-engine=xelatex
--output=tru-rst.ltx tru.rst <#cb3-3>pandoc -r rst -w context
--output=tru-rst.ctx tru.rst <#cb3-4>pandoc -r rst -w html
--output=tru-rst.html tru.rst

So, for the ReStructuredText input (file tru.rst):

 <#cb4-1>The string surrounded in backticks, `Master and Commander`,
is a title <#cb4-2>ref.

the resulting ms output is:

 <#cb5-1>.LP <#cb5-2>The string surrounded in backticks, Master and
Commander, is a title <#cb5-3>ref.

and the resulting context output is:

 <#cb6-1>The string surrounded in backticks, Master and Commander, is
a title <#cb6-2>ref.

and the resulting latex output is:

 <#cb7-1>The string surrounded in backticks, {Master and Commander},
is a title <#cb7-2>ref.

It has {} around the span, interestingly.

As far as I can tell from a cursory search of the source there is no
attempt made to specifically format title references in any of the output
formats.

For comparison, the resulting html output is:

 <#cb8-1><p>The string surrounded in backticks, <span
class="title-ref">Master and Commander</span>, is a title ref.</p>

I guess that happens automatically as a span with a class, and that's
certainly the right thing for HTML where you can style it with CSS.

On Fri, Jul 31, 2020 at 8:47 PM John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:

> Can you give an example and the command you used to convert it?
>
> "T. Kurt Bond" <tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > An RST title reference like `Master and Commander` turns into a span
> with a
> > title-ref class.  In HTML output this turns into <span
> > class="title-ref">Master and Commander</span>, with no special handling,
> > which can always be styled by CSS.  However, in ms, context, and latex
> > output there is no formatting applied, so it comes out as regular text.
> Is
> > that the intended result, and any formatting should be applied by
> > user-written filters, or should the output formats treat this
> differently?
> > For example, in ms output, the ms Writer could wrapped it in \fI and \fP.
> > Similar simple formatting could be applied in the other output formats.
> > --
> > T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io
> >
> > --
> > 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/CAN1EhV91MgdwZDN5%3DdSPOObrNiiO%3DxU9%3DOAXgc7NX5Dbhrg%2BjA%40mail.gmail.com
> .
>


-- 
T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io

-- 
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/CAN1EhV_k6YFVQQ6wt68x8Z0bJK4o18y%3D%3DvKYjujMxJ4oWjrtsQ%40mail.gmail.com.

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

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

* Re: RST Title Reference unformated in various output formats
       [not found]         ` <CAN1EhV_k6YFVQQ6wt68x8Z0bJK4o18y==vKYjujMxJ4oWjrtsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-08-01 21:53           ` John MacFarlane
  0 siblings, 0 replies; 4+ messages in thread
From: John MacFarlane @ 2020-08-01 21:53 UTC (permalink / raw)
  To: T. Kurt Bond; +Cc: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


LaTeX doesn't know what to do with a span with class `title-ref`,
but you can tell it using a lua filter.  e.g.
saev this as title.lua

function Span(el)
  if el.classes:includes('title-ref') and FORMAT == 'latex' then
    return { pandoc.RawInline('latex', '\\Title'), el }
  end
end

And then do pandoc -L title.lua -f rst -t latex

You'll then get `\Title{Master and Commander}`.
Of course this only helps if you define a `\Title` macro.
But you can make it do whatever you like.

"T. Kurt Bond" <tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Here you go.
> Title Ref is Unformated in Output Formats
>
> Title refs in RST input are not formatted in ms, context, and latex output.
>
> I'm using the following version of Pandoc:
>
> pandoc 2.10.1
> Compiled with pandoc-types 1.21, texmath 0.12.0.2, skylighting 0.8.5
>
> Under the following OS:
>
> Mac OS X, Version 10.15.6, Build 19G73
>
> The outputs are generated with the commands:
>
>  <#cb3-1>pandoc -r rst -w ms --output=tru-rst.ms tru.rst
> <#cb3-2>pandoc -r rst -w latex --pdf-engine=xelatex
> --output=tru-rst.ltx tru.rst <#cb3-3>pandoc -r rst -w context
> --output=tru-rst.ctx tru.rst <#cb3-4>pandoc -r rst -w html
> --output=tru-rst.html tru.rst
>
> So, for the ReStructuredText input (file tru.rst):
>
>  <#cb4-1>The string surrounded in backticks, `Master and Commander`,
> is a title <#cb4-2>ref.
>
> the resulting ms output is:
>
>  <#cb5-1>.LP <#cb5-2>The string surrounded in backticks, Master and
> Commander, is a title <#cb5-3>ref.
>
> and the resulting context output is:
>
>  <#cb6-1>The string surrounded in backticks, Master and Commander, is
> a title <#cb6-2>ref.
>
> and the resulting latex output is:
>
>  <#cb7-1>The string surrounded in backticks, {Master and Commander},
> is a title <#cb7-2>ref.
>
> It has {} around the span, interestingly.
>
> As far as I can tell from a cursory search of the source there is no
> attempt made to specifically format title references in any of the output
> formats.
>
> For comparison, the resulting html output is:
>
>  <#cb8-1><p>The string surrounded in backticks, <span
> class="title-ref">Master and Commander</span>, is a title ref.</p>
>
> I guess that happens automatically as a span with a class, and that's
> certainly the right thing for HTML where you can style it with CSS.
>
> On Fri, Jul 31, 2020 at 8:47 PM John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:
>
>> Can you give an example and the command you used to convert it?
>>
>> "T. Kurt Bond" <tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>> > An RST title reference like `Master and Commander` turns into a span
>> with a
>> > title-ref class.  In HTML output this turns into <span
>> > class="title-ref">Master and Commander</span>, with no special handling,
>> > which can always be styled by CSS.  However, in ms, context, and latex
>> > output there is no formatting applied, so it comes out as regular text.
>> Is
>> > that the intended result, and any formatting should be applied by
>> > user-written filters, or should the output formats treat this
>> differently?
>> > For example, in ms output, the ms Writer could wrapped it in \fI and \fP.
>> > Similar simple formatting could be applied in the other output formats.
>> > --
>> > T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io
>> >
>> > --
>> > 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/CAN1EhV91MgdwZDN5%3DdSPOObrNiiO%3DxU9%3DOAXgc7NX5Dbhrg%2BjA%40mail.gmail.com
>> .
>>
>
>
> -- 
> T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io


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

end of thread, other threads:[~2020-08-01 21:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31 22:02 RST Title Reference unformated in various output formats T. Kurt Bond
     [not found] ` <CAN1EhV91MgdwZDN5=dSPOObrNiiO=xU9=OAXgc7NX5Dbhrg+jA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-08-01  0:47   ` John MacFarlane
     [not found]     ` <m27dujyyx8.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2020-08-01  1:26       ` T. Kurt Bond
     [not found]         ` <CAN1EhV_k6YFVQQ6wt68x8Z0bJK4o18y==vKYjujMxJ4oWjrtsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-08-01 21:53           ` John MacFarlane

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