public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Plain TeX writer
Date: Thu, 20 Oct 2022 08:05:39 +0000	[thread overview]
Message-ID: <Y1EBU0Ch0HHr2geB@localhost> (raw)
In-Reply-To: <5e9dfe75-ea0e-4287-a6a0-47842700f292n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

That looks very promising. I contemplated to write such a filter to be able to define my own stylesheet more flexibly and possibly to work with other TeX formats, so thank you both for having undertaken this task. Some personal thoughts follow.

I don't understand either the rationale for \pandocSpace and \pandocLinebreak. Since Markdown and TeX agree on handling simple line breaks and repeated spaces like single spaces, in what cases would it be useful?

As for spans and divs, why not generate macros according to their classes? It would only require defining in the header which attributes are related to which classes. For instance:

```md
---
classes:
- term:
  - lem
- def:
  - lem
  - domain
---

[Pandoc]{.term .def lem="pandoc" domain="software"} is a Haskell library for converting
from one markup format to another, and a command-line tool that uses this library.

[Pandoc]{.term lem="pandoc"} can convert between numerous markup and word processing formats,
including, but not limited to, various flavors of Markdown, HTML, LaTeX and Word docx.
```

would be converted to (stripping the markup for spaces and soft line breaks):

```tex
\pandocSpTerm[lem=pandoc]{\pandocSpDef[lem=pandoc, domain=software]{Pandoc}}
is a Haskell library for converting from one markup format to another, and
a command-line tool that uses this library.

\pandocSpTerm[lem=pandoc]{Pandoc} can convert between numerous markup
and word processing formats, including, but not limited to, various
flavors of Markdown, HTML, LaTeX and Word docx.
```

Thanks to the package xkeyval, the key-value argument could be handled quite easily in all formats that include Plain TeX.

Le Wednesday 19 October 2022 à 09:21:09AM, Vít Novotný a écrit :
> Dne středa 19. října 2022 v 17:43:31 UTC+2 uživatel fiddlosopher napsal:
> 
>     What would you think about replacing \pandocSpace with a regular space
>     character? IT would make the output a lot more readable. Similarly,
>     SoftBreak could be a regular newline character.
> 
> 
> The input processor of TeX will fold one or more spaces into a single space and
> consume all spaces at the end of a line. Making spaces and soft breaks into
> commands avoids this at the cost of lesser readability.
>  
> 
>     It would be nice to see some examples involving arguments and attributes,
>     e.g. links and headers.
> 
> 
> As stated in my original post, attributes are currently discarded by the
> writer. However, the Markdown package supports [1]attributes on headers and [2]
> attributes on divs and spans, [3]links, images, and inline code as well as [4]
> raw attributes are planned for the next release (2.18.0). Therefore, adding
> support for attributes on many types of elements should be straightforward.
>  
> 
>     Why is the package called "pandoc-to-markdown"? That would lead me to
>     expect that it produces markdown output.
> 
> 
> The implementation rests on [5]my Markdown package for TeX, which provides
> formatting for most elements of the Pandoc AST across different TeX formats
> such as plain TeX, LaTeX, and ConTeXt. Dominik's proof of concept bridges
> Pandoc with the Markdown package and hence the (somewhat confusing) name.
>  
> 
>     John
> 
> 
> Best,
> Vit 
> 
> --
> 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 [6]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [7]https://groups.google.com/d/msgid/
> pandoc-discuss/5e9dfe75-ea0e-4287-a6a0-47842700f292n%40googlegroups.com.
> 
> References:
> 
> [1] https://witiko.github.io/markdown/#header-attributes
> [2] https://github.com/Witiko/markdown/issues/126
> [3] https://github.com/Witiko/markdown/issues/123
> [4] https://github.com/Witiko/markdown/issues/173
> [5] https://ctan.org/pkg/markdown
> [6] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [7] https://groups.google.com/d/msgid/pandoc-discuss/5e9dfe75-ea0e-4287-a6a0-47842700f292n%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/Y1EBU0Ch0HHr2geB%40localhost.


  parent reply	other threads:[~2022-10-20  8:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 13:59 Vít Novotný
     [not found] ` <51539828-c876-437b-bb1e-a5efcf752762n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-10-19 15:43   ` John MacFarlane
     [not found]     ` <84C142C7-20EF-411E-AF94-D0AA008FA9DA-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-10-19 16:21       ` Vít Novotný
     [not found]         ` <5e9dfe75-ea0e-4287-a6a0-47842700f292n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-10-20  8:05           ` Bastien DUMONT [this message]
2022-10-20  9:13             ` Vít Novotný
     [not found]               ` <a7d769e7-083c-4cb9-a9a2-b5a21b62c8f0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-10-20  9:53                 ` Bastien DUMONT
2022-10-20 10:32                   ` Vít Novotný
     [not found]                     ` <782726a4-9890-4396-9696-4f5a349f9885n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-10-20 10:43                       ` Bastien DUMONT
2022-10-26 20:09       ` Vít Novotný
     [not found]         ` <24c01860-2f35-4ff0-9d31-63d10f764f79n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-10-27  0:24           ` John MacFarlane
     [not found]             ` <1EC34FB9-2344-40AC-91CD-22B3D9069EE6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-10-27  7:07               ` Bastien DUMONT
2022-10-27 17:09                 ` John MacFarlane
     [not found]                   ` <B180C2FD-5AD9-47F2-8E5D-8133CCD8CE00-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-11-02 14:17                     ` Vít Novotný
     [not found]                       ` <9dfc8b26-3fda-4882-93b7-06d44671ef7fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-11-02 14:23                         ` 'William Lupton' via pandoc-discuss
     [not found]                           ` <CAEe_xxiYD8Y5KJVB7WiKOo5xHbFWPq010rMXJEYsu_XNd-hX4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-11-02 14:35                             ` Vít Novotný

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1EBU0Ch0HHr2geB@localhost \
    --to=bastien.dumont-vwifzpto/vqstnjn9+bgxg@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).