Provide a way to continue paragraphs after block quotes #9375
Replies: 5 comments
-
I wrote a filter some time ago that does this thing: https://bastien-dumont.onmypc.net/git/bdumont/pandoc-lua-filters/src/branch/master/composite-paragraphs
I can extend it to other formats if you indicate what it should do.
|
Beta Was this translation helpful? Give feedback.
-
This is a problem I run into all the time, and eventually I'd like some built-in way to deal with it. But this is the filter I use: You start a paragraph with a single function Para(el)
local ils = el.content
if #ils >= 2 and ils[1].t == "Str" and ils[1].text == "_" and ils[2].t == "Space" then
el.content:remove(1)
el.content[1] = pandoc.RawInline("latex", "\\noindent ")
return el
end
end This is a bit simpler to write than an enclosing div. Currently it only works for LaTeX, though. |
Beta Was this translation helpful? Give feedback.
-
Here's a link to an discussion of the same issue in the djot repository: jgm/djot#50 |
Beta Was this translation helpful? Give feedback.
-
I have used @badumont's lua filter in the past, and it's worked great. The flexibility across latex/pdf/docx is exactly what I need. (My standard workflow, however, begins with composition in Scrivener, which I have set up to apply If Pandoc doesn't end up incorporating a format-flexible no-indent command natively, I'd be most grateful if that lua filter could be kept compatible with Pandoc going forward. It's that essential for me, since a lot of my writing these days involves equation blocks, after which I often want a continuation rather than a new paragraph. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I'm happy that it helps! At least as long as I use it, it will be kept compatible. By the way, it could be easily adapted to support John's lighter syntax too.
|
Beta Was this translation helpful? Give feedback.
-
I am using
pandoc
to write a paper that includes many block quotes that I need to comment on.There is currently no native way to indicate that the text after the block quote is a continuation of the paragraph that precedes it. For example,
What I chiefly need is a way to indicate that the text after the block quote should not be indented. Right now, the only work-around is to use the
\noindent
LaTeX command.This works well if the output is LaTeX or PDF, obviously, and it sort of works for Word. (The text is given the “First Paragraph” style, but this only gives the correct output if the template does not indent the first paragraph, which is not correct for many publications.) However, it does not work at all for HTML.
My suggestion is to include a native syntax to indicate that the paragraph continues. Thinking out loud, that could be:
or perhaps just continuing the > with an entirely blank line, but connected to the continuing text:
In LaTeX, this should output a
\noindent
command for text immediately below the block quote, and in Word, it should apply a style like “Paragraph Continued after Block Quote” or “Paragraph with No Indent” instead of “First Paragraph.” In HTML it should add a class like.noindent
to the<p>
element. That way, in Word and HTML, the user can easily modify the styles to get the desired effect.Beta Was this translation helpful? Give feedback.
All reactions