0

I'm using Org-Mode to write documents that I export to LaTeX. Org-Mode exports its quote blocks to:

\begin{quote}
...
\end{quote}

In order to color these quotes I'm using the following code (found here) in the preamble of some of my Org-Mode documents.

#+LATEX_HEADER: \usepackage{xcolor}
#+LATEX_HEADER: \definecolor{grey}{rgb}{0.9,0.9,0.9}
#+LATEX_HEADER: \usepackage{framed}
#+LATEX_HEADER: \usepackage{quoting}
#+LATEX_HEADER:  \colorlet{shadecolor}{grey}
#+LATEX_HEADER:\newenvironment{shadedquotation}
#+LATEX_HEADER: {\begin{shaded*}
#+LATEX_HEADER:  \quoting[leftmargin=0pt, vskip=0pt]}
#+LATEX_HEADER: {\endquoting
#+LATEX_HEADER: \end{shaded*}}

The issue that I have is that I have to replace {quote} by {shadedquotation} each time I do an export.

In order to avoid this, I thought of changing LaTeX quote behavior (so it would behave as shadedquotation) by adding some code in the preamble of the exported LaTeX document.

How could I achieve this?

5
  • Isn't this more of a org-mode/emacs question then? You need a way to reconfigure org-mode such than when it handles quotes (blockquotes?) then it should use your custom env name. That hasn't much to do with LaTeX it self
    – daleif
    Feb 27, 2023 at 16:44
  • No, the idea is not to change Emacs config, since I'd like the behavior change to be on LaTeX side. I tried to use \renewcommand but it didn't work (may be I don't know how to use it).
    – crocefisso
    Feb 27, 2023 at 16:48
  • Said differently, I don't want quote to be replaced by shadedquotation, I'd like quote to behave like shaded quotation.
    – crocefisso
    Feb 27, 2023 at 16:51
  • Then why are you defining shadedquotation in the first place? You could just redefine quote
    – daleif
    Feb 27, 2023 at 16:55
  • That's what I wanted to do at first, but I didn't find how... I only found solutions where people created new commands.
    – crocefisso
    Feb 27, 2023 at 16:56

1 Answer 1

1

Replace \newenvironment{shadedquotation} by \renewenvironment{quote}:

#+LATEX_HEADER: \usepackage{xcolor}
#+LATEX_HEADER: \definecolor{grey}{rgb}{0.9,0.9,0.9}
#+LATEX_HEADER: \usepackage{framed}
#+LATEX_HEADER: \usepackage{quoting}
#+LATEX_HEADER:  \colorlet{shadecolor}{grey}
#+LATEX_HEADER: \renewenvironment{quote}
#+LATEX_HEADER: {\begin{shaded*}
#+LATEX_HEADER:  \quoting[leftmargin=0pt, vskip=0pt]}
#+LATEX_HEADER: {\endquoting
#+LATEX_HEADER: \end{shaded*}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .