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: Apologize if not really pabdoc but instead rst
Date: Sun, 17 Jul 2022 08:11:19 +0000	[thread overview]
Message-ID: <YtPEJ6Ggm3p3Ze2C@localhost> (raw)
In-Reply-To: <a2c95871-daca-41e5-a971-deb1f3085eb4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

Actually, my explanation was not accurate. I just saw that Pandoc renders Code in LaTeX with \texttt, which allows line breaks. However, it prevents them by escaping the blank spaces in the argument of \textt. So the solution is to alter the behaviour of the Pandoc LaTeX writer. You can use the following Lua filter to do this (I assume that classes and attributes on code spans are ignored by the LaTeX writer anyway):

```
function Code(code)
  if FORMAT:match 'latex' then
    return { pandoc.RawInline('tex', '\\texttt{'), pandoc.Str(code.text), pandoc.RawInline('tex', '}') }
  end
end

```

So indeed, it is a Pandoc question ;-)

Le Saturday 16 July 2022 à 10:29:35PM, almaghfuur lahu a écrit :
> Wonder if there's a rst command to force a line break at any point in rst
> document which latex hence pandoc can produce PDF as it has that
> 
> On Thursday, 14 July 2022 at 15:57:59 UTC+7 Bastien Dumont wrote:
> 
>     The problem is that the whole series of keywords are marked up as one span
>     of raw code, and LaTeX does not insert line breaks into raw code. In the
>     rst file, replace
> 
>     These keywords are also operators:
>     `and or not xor shl shr div mod in notin is isnot of as from`.
> 
>     with
> 
>     These keywords are also operators:
>     `and` `or` `not` `xor` `shl` `shr` `div` `mod` `in` `notin` `is` `isnot`
>     `of` `as` `from`.
> 
> 
>     Le Thursday 14 July 2022 à 09:47:07AM, William Lupton a écrit :
>     > This paragraph is parsed as shown below, i.e., as a code block with a
>     'nim'
>     > class. It might be possible to use this info to control how it's rendered
>     in
>     > the PDF? Or use a different PDF engine, e.g., I just tried it
>     with wkhtmltopdf
>     > (and no special CSS) and the text wraps as expected ("from" is formatted
>     in a
>     > different colour but perhaps that's intended).
>     >
>     >   [130] Para {
>     >     content: Inlines {
>     >       [1] Str text: "These"
>     >       [2] Space {}
>     >       [3] Str text: "keywords"
>     >       [4] Space {}
>     >       [5] Str text: "are"
>     >       [6] Space {}
>     >       [7] Str text: "also"
>     >       [8] Space {}
>     >       [9] Str text: "operators:"
>     >       [10] SoftBreak {}
>     >       [11] Code {
>     >         attr: Attr {
>     >           attributes: AttributeList {}
>     >           classes: List {
>     >             [1] "nim"
>     >           }
>     >           identifier: ""
>     >         }
>     >         text: "and or not xor shl shr div mod in notin is isnot of as
>     from"
>     >       }
>     >       [12] Str text: "."
>     >     }
>     >   }
>     >
>     > On Thu, 14 Jul 2022 at 01:16, almaghfuur lahu <[1]budik...-Re5JQEeQqe8@public.gmane.orgm>
>     wrote:
>     >
>     >
>     > This's, just now, the result of Github issue [2][1]https://github.com/jgm
>     /
>     > pandoc/issues/8172
>     >
>     > Now after leading steps getting solved, next step is need to fix a
>     > imperfection on some lines overrun the right alignment margin
>     >
>     > How actually is the rst's width and margin alignment setting command to
>     > correctly have the max column number laid out, or that is determined
>     > implicitly by pandoc on the run when trying accomplishing it by:
>     >
>     > pandoc -f rst -t pdf -o manual.pdf manual.rst
>     >
>     > ?  improper line is e.g:
>     >
>     > These keywords are also operators: and or not xor shl shr div mod in
>     notin
>     > is isnot of as from.
>     >
>     > ... notin <= longer than it
>     >
>     > Real PDF document being viewed:
>     >
>     > These keywords are also operators: and or not xor shl shr div mod in
>     notin
>     > is isnot of as from.
>     >
>     > Needed wrapped/broken to:
>     >
>     > These keywords are also operators: and or not xor shl shr div mod in
>     notin
>     >  is isnot of as from.
>     >
>     > Please show the logical way to solve correctly so that can be done in
>     batch
>     > by find-replace regex tool
>     >
>     > the rst:
>     > [3][2]https://drive.google.com/file/d/19DJ8at1Fze8-HEEzg3n9xLrSB9tIaqW5/
>     view?
>     > usp=sharing
>     >
>     > --
>     > 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 [4]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     > To view this discussion on the web visit [5][3]https://groups.google.com/
>     d/
>     > msgid/pandoc-discuss/
>     > e63b0064-87dd-431a-b346-de9e4c220785n%[4]40googlegroups.com.
>     >
>     > --
>     > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     > To view this discussion on the web visit [7][5]https://groups.google.com/
>     d/msgid/
>     > pandoc-discuss/
>     > CAEe_xxi%3D4ZT%2BRyhGPAtWiWFE1phYgshYubzA-%2BG7B2mESXJrpA%[6]
>     40mail.gmail.com.
>     >
>     > References:
>     >
>     > [1] mailto:budik...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>     > [2] [7]https://github.com/jgm/pandoc/issues/8172
>     > [3] [8]https://drive.google.com/file/d/19DJ8at1Fze8-HEEzg3n9xLrSB9tIaqW5/
>     view?usp=sharing
>     > [4] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>     > [5] [9]https://groups.google.com/d/msgid/pandoc-discuss/
>     e63b0064-87dd-431a-b346-de9e4c220785n%40googlegroups.com?utm_medium=email&
>     utm_source=footer
>     > [6] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>     > [7] [10]https://groups.google.com/d/msgid/pandoc-discuss/
>     CAEe_xxi%3D4ZT%2BRyhGPAtWiWFE1phYgshYubzA-%2BG7B2mESXJrpA%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 [11]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [12]https://groups.google.com/d/msgid/
> pandoc-discuss/a2c95871-daca-41e5-a971-deb1f3085eb4n%40googlegroups.com.
> 
> References:
> 
> [1] https://github.com/jgm/
> [2] https://drive.google.com/file/d/19DJ8at1Fze8-HEEzg3n9xLrSB9tIaqW5/view
> [3] https://groups.google.com/d/
> [4] http://40googlegroups.com/
> [5] https://groups.google.com/d/msgid/
> [6] http://40mail.gmail.com/
> [7] https://github.com/jgm/pandoc/issues/8172
> [8] https://drive.google.com/file/d/19DJ8at1Fze8-HEEzg3n9xLrSB9tIaqW5/view?usp=sharing
> [9] https://groups.google.com/d/msgid/pandoc-discuss/e63b0064-87dd-431a-b346-de9e4c220785n%40googlegroups.com?utm_medium=email&utm_source=footer
> [10] https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxi%3D4ZT%2BRyhGPAtWiWFE1phYgshYubzA-%2BG7B2mESXJrpA%40mail.gmail.com?utm_medium=email&utm_source=footer
> [11] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [12] https://groups.google.com/d/msgid/pandoc-discuss/a2c95871-daca-41e5-a971-deb1f3085eb4n%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/YtPEJ6Ggm3p3Ze2C%40localhost.


      parent reply	other threads:[~2022-07-17  8:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14  0:16 almaghfuur lahu
     [not found] ` <e63b0064-87dd-431a-b346-de9e4c220785n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-07-14  8:47   ` William Lupton
     [not found]     ` <CAEe_xxi=4ZT+RyhGPAtWiWFE1phYgshYubzA-+G7B2mESXJrpA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-14  8:57       ` Bastien DUMONT
2022-07-17  5:29         ` almaghfuur lahu
     [not found]           ` <a2c95871-daca-41e5-a971-deb1f3085eb4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-07-17  8:11             ` Bastien DUMONT [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=YtPEJ6Ggm3p3Ze2C@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).