public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Pandoc Markdown: Avoid New Paragraph After Blockquotes?
@ 2014-11-20 16:13 Chris Forster
       [not found] ` <a363e1bd-5346-4dd1-ac62-b3514fbd4ca9-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Forster @ 2014-11-20 16:13 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


[-- Attachment #1.1: Type: text/plain, Size: 1393 bytes --]

Just looking for folks thoughts on this question: Is there an obvious way 
to use a blockquote without starting a new paragraph immediately after it? 
Here is my example.

Here I am making an argument, and it is relatively convincing, but you 
really want to see some of the primary source I'm describing. Sure! Here it 
is:


> Primary evidence, primary evidence, primary evidence. And so on.


As you can see in the quote above, my primary evidence supports my 
contention. I am an insightful and accomplished scholar.


When writing for export to PDF I use \noindent; is there a better way to do 
this---one more robust and less tied to LaTeX? I suspect that the root 
problem here has to do with nested DIVs; do I understand properly that 
HTML5 does not allow <blockquote> within a <p>?

Thanks,

Chris

 


 

 

 

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/a363e1bd-5346-4dd1-ac62-b3514fbd4ca9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2731 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Pandoc Markdown: Avoid New Paragraph After Blockquotes?
       [not found] ` <a363e1bd-5346-4dd1-ac62-b3514fbd4ca9-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2014-11-20 16:30   ` Jesse Rosenthal
       [not found]     ` <878uj5bzrh.fsf-4GNroTWusrE@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Jesse Rosenthal @ 2014-11-20 16:30 UTC (permalink / raw)
  To: Chris Forster, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


Hi Chris,

Chris Forster <chris.s.forster-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Just looking for folks thoughts on this question: Is there an obvious way 
> to use a blockquote without starting a new paragraph immediately after it? 
> Here is my example.

I brought this question up a couple of years back:

https://groups.google.com/forum/#!topic/pandoc-discuss/OL_7b8EW0q4

The issue is basically that a pandoc paragraph is a collection of
inlines, so there's no good way for another block to go inside of
it. And there wouldn't be a good representation of it in html, etc.

There are two things you can do for LaTeX:

  1. Add something to your LaTeX preamble to take care of this. Here's
     what I have, more or less, in my personal macro package:

     ~~~
     \newcommand{\gobblepars}{%
        \@ifnextchar\par%
            {\expandafter\gobblepars\@gobble}%
            {}}

     \newcommand{\forcepar}{\par}

     \newcommand*{\HungryQuotes}{%
        \AfterEndEnvironment{quote}{\expandafter\gobblepars}%
     }
     ~~~

     And then I just put `\HungryQuotes` in the preamble to take care of it.



  2. Run a script on the LaTeX output to remove the blank lines:

     ~~~
     pandoc -s -S --template=article paper2.text -t latex | \
     python2 -c "import sys; print sys.stdin.read().replace('\\\end{quote}\n\n', '\\\end{quote}\n').replace('\n\n\\\begin{quote}', '\n\\\begin{quote}')"
     ~~~

     or the like.

The first option requires less intervention and allows you to go
straight to pdf. The second option produces cleaner tex files if you
want them.

Hope this helps,
Jesse




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Pandoc Markdown: Avoid New Paragraph After Blockquotes?
       [not found]     ` <878uj5bzrh.fsf-4GNroTWusrE@public.gmane.org>
@ 2014-11-21 21:58       ` Chris Forster
       [not found]         ` <9a4b3a78-908e-40e5-aaf9-9b415d91a432-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2015-02-19 15:13       ` david.pw.smith-Re5JQEeQqe8AvxtiuMwx3w
  1 sibling, 1 reply; 6+ messages in thread
From: Chris Forster @ 2014-11-21 21:58 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


[-- Attachment #1.1: Type: text/plain, Size: 1571 bytes --]

Jesse,

Thanks very much for the reply.  You're script to process the LaTeX output 
sounds like a nice solution... though doesn't it suffer from the problem of 
not being able to distinguish blockquotes that account outside any 
paragraph, and blockquote's *within *a paragraph? By replacing 
\end{quote}\n\n with \end{quote}\n, won't any blockquotes that really are 
independent get shunted into the paragraphs on either side?

I am beginning to suspect that the fundamental problem is that any markup 
system (HTML, pandoc's AST) in which blockquotes as block elements (and 
therefore not nestable within paragraphs) is, despite the shared use of the 
term "block quote," not really capable of representing the way that "block 
quotations" are frequently used in (mostly humanisitic) writing. In which 
case, it might make sense to simply such quotations inline with a span 
(<span class='blockquote'>) and then use a filter to treat them as needed 
them during processing...

Many thanks.

Chris

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9a4b3a78-908e-40e5-aaf9-9b415d91a432%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2129 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Pandoc Markdown: Avoid New Paragraph After Blockquotes?
       [not found]         ` <9a4b3a78-908e-40e5-aaf9-9b415d91a432-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2014-11-21 22:33           ` Daniel Staal
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Staal @ 2014-11-21 22:33 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

--As of November 21, 2014 1:58:21 PM -0800, Chris Forster is alleged to 
have said:

> Thanks very much for the reply.  You're script to process the LaTeX
> output sounds like a nice solution... though doesn't it suffer from the
> problem of not being able to distinguish blockquotes that account outside
> any paragraph, and blockquote's within a paragraph? By replacing
> \end{quote}\n\n with \end{quote}\n, won't any blockquotes that really are
> independent get shunted into the paragraphs on either side?
>
> I am beginning to suspect that the fundamental problem is that any markup
> system (HTML, pandoc's AST) in which blockquotes as block elements (and
> therefore not nestable within paragraphs) is, despite the shared use of
> the term "block quote," not really capable of representing the way that
> "block quotations" are frequently used in (mostly humanisitic) writing.
> In which case, it might make sense to simply such quotations inline with
> a span (<span class='blockquote'>) and then use a filter to treat them as
> needed them during processing...

--As for the rest, it is mine.

Yeah, in general most markup systems assume that a *block*quote is 
different from a normal quote because it's in a separate block - so putting 
one inside an existing block doesn't make much sense.

Other options for you: If you aren't using 'verbatim text' for anything (it 
translates to `<code>` tags in HTML) you could use that and use a filter to 
re-style as needed.  I find I tend to use that markdown markup for that 
type of 'separate but not inside quote'; it's fairly distinct in markdown, 
and visually about right in HTML - I haven't tried LaTeX.

In theory if you were working entirely in HTML you could use a different 
class in the `<q>` elements to treat them different than 'normal' inline 
quotes, and restyle.  I'm not sure if Pandoc would keep that class info 
intact if you were to embed that HTML.

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Pandoc Markdown: Avoid New Paragraph After Blockquotes?
       [not found]     ` <878uj5bzrh.fsf-4GNroTWusrE@public.gmane.org>
  2014-11-21 21:58       ` Chris Forster
@ 2015-02-19 15:13       ` david.pw.smith-Re5JQEeQqe8AvxtiuMwx3w
       [not found]         ` <ca77cf85-4f80-4388-ba68-54f89c6e9995-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: david.pw.smith-Re5JQEeQqe8AvxtiuMwx3w @ 2015-02-19 15:13 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
  Cc: chris.s.forster-Re5JQEeQqe8AvxtiuMwx3w


[-- Attachment #1.1: Type: text/plain, Size: 3026 bytes --]

Hi, and sorry to resurrect an old thread but this seems a pretty important 
issue to me. In lieu of a fix for this in Pandoc (which seems unlikely, for 
understandable reasons) could you please explain how to use that latex 
preamble code -- I just get an error when I try, with the whole lot copied 
into the default pandoc template and using xelatex (which I have to because 
of the languages I need to use):

! You can't use `\spacefactor' in vertical mode.
\@->\spacefactor
                 \@m {}
l.249 \end{quote}

Unfortunately I'm a shameless straight-to-pdf user, with very little 
knowledge of Latex!


On Thursday, 20 November 2014 16:30:12 UTC, Jesse Rosenthal wrote:
>
>
> Hi Chris, 
>
> Chris Forster <chris.s...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>
> > Just looking for folks thoughts on this question: Is there an obvious 
> way 
> > to use a blockquote without starting a new paragraph immediately after 
> it? 
> > Here is my example. 
>
> I brought this question up a couple of years back: 
>
> https://groups.google.com/forum/#!topic/pandoc-discuss/OL_7b8EW0q4 
>
> The issue is basically that a pandoc paragraph is a collection of 
> inlines, so there's no good way for another block to go inside of 
> it. And there wouldn't be a good representation of it in html, etc. 
>
> There are two things you can do for LaTeX: 
>
>   1. Add something to your LaTeX preamble to take care of this. Here's 
>      what I have, more or less, in my personal macro package: 
>
>      ~~~ 
>      \newcommand{\gobblepars}{% 
>         \@ifnextchar\par% 
>             {\expandafter\gobblepars\@gobble}% 
>             {}} 
>
>      \newcommand{\forcepar}{\par} 
>
>      \newcommand*{\HungryQuotes}{% 
>         \AfterEndEnvironment{quote}{\expandafter\gobblepars}% 
>      } 
>      ~~~ 
>
>      And then I just put `\HungryQuotes` in the preamble to take care of 
> it. 
>
>
>
>   2. Run a script on the LaTeX output to remove the blank lines: 
>
>      ~~~ 
>      pandoc -s -S --template=article paper2.text -t latex | \ 
>      python2 -c "import sys; print 
> sys.stdin.read().replace('\\\end{quote}\n\n', 
> '\\\end{quote}\n').replace('\n\n\\\begin{quote}', '\n\\\begin{quote}')" 
>      ~~~ 
>
>      or the like. 
>
> The first option requires less intervention and allows you to go 
> straight to pdf. The second option produces cleaner tex files if you 
> want them. 
>
> Hope this helps, 
> Jesse 
>
>
>
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ca77cf85-4f80-4388-ba68-54f89c6e9995%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 4664 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Pandoc Markdown: Avoid New Paragraph After Blockquotes?
       [not found]         ` <ca77cf85-4f80-4388-ba68-54f89c6e9995-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2015-02-19 15:27           ` Jesse Rosenthal
  0 siblings, 0 replies; 6+ messages in thread
From: Jesse Rosenthal @ 2015-02-19 15:27 UTC (permalink / raw)
  To: david.pw.smith-Re5JQEeQqe8AvxtiuMwx3w,
	pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
  Cc: chris.s.forster-Re5JQEeQqe8AvxtiuMwx3w

Dear David,

If you use it in your preamble, you have to enclose the definition in
`makeatletter` and `makeatother`, so it would be like this:

~~~
\makeatletter
\newcommand{\gobblepars}{%
    \@ifnextchar\par%
        {\expandafter\gobblepars\@gobble}%
        {}}

\newcommand{\eatpar}{\@ifnextchar\par{\@gobble}{}}

\newcommand{\forcepar}{\par}

\newcommand*{\HungryQuotes}{%
  \AfterEndEnvironment{quote}{\expandafter\gobblepars}%
}
\makeatother

\HungryQuotes
~~~

You don't need to surround it like that if it's in a separate .sty file.

(Note that this also requires the etoolbox package, but I think pandoc's
default maybe already pulls that in).

Best,
Jesse

david.pw.smith-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org writes:

> Hi, and sorry to resurrect an old thread but this seems a pretty important 
> issue to me. In lieu of a fix for this in Pandoc (which seems unlikely, for 
> understandable reasons) could you please explain how to use that latex 
> preamble code -- I just get an error when I try, with the whole lot copied 
> into the default pandoc template and using xelatex (which I have to because 
> of the languages I need to use):
>
> ! You can't use `\spacefactor' in vertical mode.
> \@->\spacefactor
>                  \@m {}
> l.249 \end{quote}
>
> Unfortunately I'm a shameless straight-to-pdf user, with very little 
> knowledge of Latex!
>
>
> On Thursday, 20 November 2014 16:30:12 UTC, Jesse Rosenthal wrote:
>>
>>
>> Hi Chris, 
>>
>> Chris Forster <chris.s...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>>
>> > Just looking for folks thoughts on this question: Is there an obvious 
>> way 
>> > to use a blockquote without starting a new paragraph immediately after 
>> it? 
>> > Here is my example. 
>>
>> I brought this question up a couple of years back: 
>>
>> https://groups.google.com/forum/#!topic/pandoc-discuss/OL_7b8EW0q4 
>>
>> The issue is basically that a pandoc paragraph is a collection of 
>> inlines, so there's no good way for another block to go inside of 
>> it. And there wouldn't be a good representation of it in html, etc. 
>>
>> There are two things you can do for LaTeX: 
>>
>>   1. Add something to your LaTeX preamble to take care of this. Here's 
>>      what I have, more or less, in my personal macro package: 
>>
>>      ~~~ 
>>      \newcommand{\gobblepars}{% 
>>         \@ifnextchar\par% 
>>             {\expandafter\gobblepars\@gobble}% 
>>             {}} 
>>
>>      \newcommand{\forcepar}{\par} 
>>
>>      \newcommand*{\HungryQuotes}{% 
>>         \AfterEndEnvironment{quote}{\expandafter\gobblepars}% 
>>      } 
>>      ~~~ 
>>
>>      And then I just put `\HungryQuotes` in the preamble to take care of 
>> it. 
>>
>>
>>
>>   2. Run a script on the LaTeX output to remove the blank lines: 
>>
>>      ~~~ 
>>      pandoc -s -S --template=article paper2.text -t latex | \ 
>>      python2 -c "import sys; print 
>> sys.stdin.read().replace('\\\end{quote}\n\n', 
>> '\\\end{quote}\n').replace('\n\n\\\begin{quote}', '\n\\\begin{quote}')" 
>>      ~~~ 
>>
>>      or the like. 
>>
>> The first option requires less intervention and allows you to go 
>> straight to pdf. The second option produces cleaner tex files if you 
>> want them. 
>>
>> Hope this helps, 
>> Jesse 
>>
>>
>>
>>
>
> -- 
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ca77cf85-4f80-4388-ba68-54f89c6e9995%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-02-19 15:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-20 16:13 Pandoc Markdown: Avoid New Paragraph After Blockquotes? Chris Forster
     [not found] ` <a363e1bd-5346-4dd1-ac62-b3514fbd4ca9-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-11-20 16:30   ` Jesse Rosenthal
     [not found]     ` <878uj5bzrh.fsf-4GNroTWusrE@public.gmane.org>
2014-11-21 21:58       ` Chris Forster
     [not found]         ` <9a4b3a78-908e-40e5-aaf9-9b415d91a432-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-11-21 22:33           ` Daniel Staal
2015-02-19 15:13       ` david.pw.smith-Re5JQEeQqe8AvxtiuMwx3w
     [not found]         ` <ca77cf85-4f80-4388-ba68-54f89c6e9995-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-02-19 15:27           ` Jesse Rosenthal

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).