From: "Vít Novotný" <witiko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Plain TeX writer
Date: Wed, 2 Nov 2022 07:35:55 -0700 (PDT) [thread overview]
Message-ID: <d2933f0d-4a51-4fd4-bb4f-32b5da362ab9n@googlegroups.com> (raw)
In-Reply-To: <CAEe_xxiYD8Y5KJVB7WiKOo5xHbFWPq010rMXJEYsu_XNd-hX4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 4342 bytes --]
> Would it be feasible for the https://ctan.org/pkg/markdown package to
support an option to control whether to generate ASCII space or
\pandocSpace (perhaps with a default of generation ASCII spaces)?
The https://ctan.org/pkg/markdown package is just a rendering backend for
the various *\pandoc** macros. The decision to produce an ASCII space
instead of the *\pandocSpace* macro falls on the plain TeX writer
*pandoc-to-markdown.lua* from https://github.com/drehak/pandoc-to-markdown/.
The option could be passed to the writer easily enough through metadata.
Dne středa 2. listopadu 2022 v 15:23:55 UTC+1 uživatel
wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org napsal:
> Would it be feasible for the https://ctan.org/pkg/markdown package to
> support an option to control whether to generate ASCII space or
> \pandocSpace (perhaps with a default of generation ASCII spaces)?
>
> On Wed, 2 Nov 2022 at 14:17, Vít Novotný <wit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> > So, for example, you couldn’t make Spaces appear as visible ␠
>> characters, and you couldn’t make SoftBreaks create hard breaks in the
>> output.
>>
>> Replacing *\pandocSpace* with ASCII spaces makes it difficult to
>> reprogram spaces on the top level of the document, but we can definitely
>> substitute spaces in parameters of commands such as *\pandocCode*,
>> which would cover many (if not most) use cases.
>>
>> The following example LaTeX document produces the text
>> *we␣want␣visible␣spaces␣here* in a monospaced font:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *\documentclass{standalone}\usepackage{xparse}\ExplSyntaxOn\ProvideDocumentCommand
>> { \pandocCode } { m } { \pandoc_code:n { #1 } }\cs_new:Nn
>> \pandoc_code:n { \tl_set:Nn \l_tmpa_tl { #1 }
>> \regex_replace_all:nnN { \s } { \c{textvisiblespace} }
>> \l_tmpa_tl \texttt { \l_tmpa_tl }
>> }\ExplSyntaxOff\begin{document}\pandocCode{we want visible spaces
>> here}\end{document}*
>>
>> > There may also be line breaks in the source that don't correspond to
>> SoftBreak.
>>
>> Any lines that end with a comment character (%) will skip over the
>> newline character. Therefore, we can have newlines in the source code that
>> wouldn't trigger the active newline character.
>>
>> The following example plain TeX document produces the text *foo bar baz*:
>>
>> *\catcode`\^^M=13*
>>
>>
>> *\def^^M{ bar }%foobaz%*
>> *\bye*
>>
>> Dne čtvrtek 27. října 2022 v 19:09:30 UTC+2 uživatel fiddlosopher napsal:
>>
>>>
>>> > On Oct 27, 2022, at 12:07 AM, Bastien DUMONT <bastien...-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
>>> wrote:
>>> >
>>> > Fortunately, it is possible by making the space and the newline
>>> characters active in TeX! (Provided that a SoftBreak is rendered as a line
>>> break in the TeX output.) This is how \obeylines and \obeyspaces work.
>>>
>>> But this might not be what you want; after all there are going to be
>>> spaces in code blocks, and you might not want to treat them the same way
>>> (they do not correspond to pandoc Space elements). There may also be line
>>> breaks in the source that don't correspond to SoftBreak.
>>>
>>>
>>> --
>> 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/9dfc8b26-3fda-4882-93b7-06d44671ef7fn%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/9dfc8b26-3fda-4882-93b7-06d44671ef7fn%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/d2933f0d-4a51-4fd4-bb4f-32b5da362ab9n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 6633 bytes --]
prev parent reply other threads:[~2022-11-02 14:35 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
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ý [this message]
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=d2933f0d-4a51-4fd4-bb4f-32b5da362ab9n@googlegroups.com \
--to=witiko-re5jqeeqqe8avxtiumwx3w@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).