public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: problem setting style after blocktext in docx output
Date: Fri, 11 Mar 2022 08:22:51 +0100	[thread overview]
Message-ID: <CADAJKhDFJSM=6eeoNszTwjKczgKPDTzAZZSN1O+jO6C7cCoKCw@mail.gmail.com> (raw)
In-Reply-To: <bc83b25d-d676-4582-ba04-830e3f378c2an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

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

You can use a custom-style div:

``````markdown
::: {custom-style="Body Text 2"}
Paragraph text.
:::
``````



Den tors 10 mars 2022 21:45Paul Kelleher <paul-JZTKsBFbLNkkm2bSNb+QWw@public.gmane.org> skrev:

> Thank you so much for posting this filter that converts the paragraph
> after block quote to Body Text 2! It worked great for me. But: I also have
> other element environments (e.g. equations) that I'd like to suppress
> indents after when I use pandoc to compile md to docx. I couldn't get your
> complex paragraphs filter to work for me. However, I'm already used to
> writing "\noindent" from my LaTeX days (and it helps to have that if I want
> to compile md to tex anyway). Would it be possible to write a filter that
> assigns the Block Text 2 style to every paragraph that starts with
> "\noindent"?
>
> On Wednesday, October 27, 2021 at 11:57:34 AM UTC-5 Bastien Dumont wrote:
>
>> If all you want is to prevent indentation, you can use a filter that I
>> wrote for a similar need:
>> https://github.com/badumont/lua-filters/tree/complex-paragraphs/complex-paragraphs
>> (which supports other output formats and enables you to control more
>> precisely what is indented or not). If you really need to set a style, the
>> following filter should work:
>>
>> ```
>> is_preceding_BlockQuote = false
>>
>> function Block(block)
>> if block.t == 'BlockQuote' then
>> is_preceding_BlockQuote = true
>> elseif is_preceding_BlockQuote == true then
>> is_preceding_BlockQuote = false
>> return pandoc.Div(block, {['custom-style'] = 'Body Text 2'})
>> end
>> end
>> ```
>>
>> Le Wednesday 27 October 2021 à 09:32:34AM, Landon Yarrington a écrit :
>> > To clarify, in the MRE above, my goal is to get the paragraph
>> immediately after
>> > the blockquote to render as "Body Text 2" according to the style in the
>> > ref_template.docx. Using this and every other stylesheet I've made, the
>> > following paragraphs always come out as style "First Paragraph."
>> >
>> > On Wednesday, October 27, 2021 at 12:28:02 PM UTC-4 Landon Yarrington
>> wrote:
>> >
>> > I'm trying to process block quotes in a way such that the following
>> > paragraph directly after a block quote is styled as a continuation of
>> the
>> > paragraph in which the blockquote is nested. I tried several different
>> > styles, but cannot seem to achieve this. I almost filed an issue on GH,
>> but
>> > thought twice :-)
>> >
>> > I'm using pandoc 2.15 with the following command.
>> >
>> > `pandoc -N -t docx -f
>> >
>> markdown+markdown_attribute+mmd_link_attributes+simple_tables+multiline_tables+auto_identifiers+table_captions+yaml_metadata_block+raw_attribute+implicit_figures+latex_macros+header_attributes
>>
>> > --reference-doc=ref_template.docx example.md -o TEST_example.docx`
>> > Is this a user-error, a problem with my ref_template.docx, or what?
>> >
>> > And here's `example.md`
>> > ````
>> > # Heading1
>> >
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text. Here's some text.
>> >
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> >
>> > ## Heading 2
>> >
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text.
>> >
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text.
>> >
>> > > Block quote time. Block quote time. Block quote time. Block quote
>> time.
>> > Block quote time. Block quote time. Block quote time. Block quote time.
>> > Block quote time. Block quote time. Block quote time. Block quote time.
>> > Block quote time. Block quote time. Block quote time. Block quote time.
>> > Block quote time. Block quote time. Block quote time.
>> >
>> > Back to the text. Back to the text. Back to the text. Back to the text.
>> > Back to the text.
>> >
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text. Here's some text. Here's some text.
>> > Here's some text. Here's some text.
>> > ````
>> >
>> > --
>> > 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 [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> > To view this discussion on the web visit [2]
>> https://groups.google.com/d/msgid/
>> > pandoc-discuss/86c4d6cd-4ea3-41ad-aae9-c301f049a2can%40googlegroups.com.
>>
>> >
>> > References:
>> >
>> > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> > [2]
>> https://groups.google.com/d/msgid/pandoc-discuss/86c4d6cd-4ea3-41ad-aae9-c301f049a2can%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/bc83b25d-d676-4582-ba04-830e3f378c2an%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/bc83b25d-d676-4582-ba04-830e3f378c2an%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/CADAJKhDFJSM%3D6eeoNszTwjKczgKPDTzAZZSN1O%2BjO6C7cCoKCw%40mail.gmail.com.

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

  parent reply	other threads:[~2022-03-11  7:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 16:28 Landon Yarrington
     [not found] ` <ba599eb3-3129-4658-9701-b9243d6c793en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-10-27 16:32   ` Landon Yarrington
     [not found]     ` <86c4d6cd-4ea3-41ad-aae9-c301f049a2can-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-10-27 16:38       ` AW: " denis.maier-NSENcxR/0n0
     [not found]         ` <a1d780a852754aec85dbf01a13456754-NSENcxR/0n0@public.gmane.org>
2021-10-27 16:40           ` denis.maier-NSENcxR/0n0
2021-10-27 16:56       ` Bastien DUMONT
2021-10-27 20:19         ` Landon Yarrington
     [not found]           ` <1b625016-e8cd-4400-9492-fae034e235d8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-10-27 22:48             ` Bastien DUMONT
2022-03-10 20:44         ` Paul Kelleher
     [not found]           ` <bc83b25d-d676-4582-ba04-830e3f378c2an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-03-11  7:22             ` BPJ [this message]
     [not found]               ` <CADAJKhDFJSM=6eeoNszTwjKczgKPDTzAZZSN1O+jO6C7cCoKCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-03-11 16:20                 ` Paul Kelleher
     [not found]                   ` <58f80fd9-5017-4ae2-8a86-225d3fa79463n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-03-11 17:14                     ` BPJ
     [not found]                       ` <CADAJKhBBTXWbvkdARhZTA=eNvmS+48=0wS5_EGb9CCduJVJ4EA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-03-11 17:54                         ` Paul Kelleher
     [not found]                           ` <fd41c606-6011-4bfc-9a6e-33103faaba75n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-03-12  8:53                             ` BPJ
2021-10-27 16:47   ` John MacFarlane

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='CADAJKhDFJSM=6eeoNszTwjKczgKPDTzAZZSN1O+jO6C7cCoKCw@mail.gmail.com' \
    --to=melroch-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).