[Tex/LaTex] ConTeXt: How to change the background color and border of a Pandoc-generated blockquote

backgroundscontextcontext-mkivpandocquoting

Consider the following minimum working example containing a blockquote as defined in a Pandoc-generated document:

\setuppapersize [A4][A4]
\setuplayout    [width=middle,  backspace=1.5in, cutspace=1.5in,
                 height=middle, topspace=0.75in, bottomspace=0.75in]

\setuppagenumbering[location={footer,center}]

\setupdelimitedtext
  [blockquote]
  [before={\blank[medium]},
   after={\blank[medium]},
   indentnext=no,
  ]

\starttext
\input tufte
\startblockquote
\input zapf
\stopblockquote
\input knuth
\stoptext

Question

How could I obtain a light gray background for the blockquote with a dark red 1em-thick left vertical borderline only by changing the preamble?
Other borders should be 0pt.

Best Answer

Since the text is marked up logically within a blockquote environment and pandoc includes custom headers included with the -H option after the default ones, you can simply create an environment which displays the text in the desired way using any mechanism which meets your needs.

I define a framedtext environment with the name blockquote and the desired features, which is used instead of the default definition.

\startsetups framedsetups
  \setupwhitespace[medium]
\stopsetups


\defineframedtext
  [blockquote]
  [
    framecolor=darkred,
    background=color,
    backgroundcolor=lightgray,
    frame=off, 
    leftframe=on,
    rulethickness=1em,
    offset=overlay,
    loffset=2em,
    roffset=1em,
    width=\textwidth,
    setups=framedsetups,
  ]

which gives

enter image description here

Another option is to use background environment with the name blockquote. For example:

\definebackground
  [blockquote]
  [
    framecolor=darkred,
    background=color,
    backgroundcolor=lightgray,
    frame=off, 
    leftframe=on,
    rulethickness=1em,
    offset=overlay,
    leftoffset=2em,
    rightoffset=1em,
    width=\textwidth,
    setups=framedsetups,
    before=\blank,
    after=\blank,
  ]

which gives the same result as before, but has the advantage that the content can break across pages.

Related Question