Thanks for the reply Jesse

I did check out the custom styles, but you are right that I'd rather not embed that in every paragraph. I'm dealing with moderately large documents and it would get old pretty fast.

I hadn't considered the lua filters yet. Good idea, I will give it a try.

regards
Alan

On Mon, May 6, 2019 at 5:36 PM Jesse Rosenthal <jrosenthal@jhu.edu> wrote:
Alan McLachlan <alan.mcl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> pandoc today generates the paragraph text set to "Normal"
> style, I want it to use "My Style 1" instead of Normal.

This is a job for custom-styles:
https://pandoc.org/MANUAL.html#custom-styles

So, one (not particularly user-friendly) way to do it would be to wrap
ever paragaph in a div, to give it a custom style

~~~
::: {custom-style="My Style 1"}
Here is a paragraph.
:::

::: {custom-style="My Style 1"}
Here is another.
:::
~~~

But you probably don't want to do that -- instead, it would be nice to
just write as normal:

~~~
Here is a paragraph.

Here is another.
~~~

and then have paragraphs converted on the fly. To do that, you'd use a
pandoc filter (https://pandoc.org/lua-filters.html):

~~~
function Para(blk)
   local attr = pandoc.Attr()
   attr.attributes["custom-style"] = "My Style 1"
   return pandoc.Div({blk}, attr)
end
~~~

That will convert all plain paras into a styled div. Save that in a file
(`style.lua`), and then run it on the simple markdown file:

`pandoc input.md --lua-filter=styler.lua -o output.docx`


--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CABQ_dt8PD7jtvWt-8w92nLqK-hiusUVxR%3DP-JfnYEJembQ2XPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.