all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Option that prevents Org to add \lstset{language=⟨language⟩,...} when code blocks are exported to LaTeX
@ 2022-02-26 17:27 Denis Bitouzé
  2022-10-18  4:14 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Bitouzé @ 2022-02-26 17:27 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

here is a feature request about the LaTeX export.

With ~(setq org-latex-listings t)~, code blocks such as:

  ┌────
  │ #+BEGIN_SRC ⟨language⟩ :exports code
  │ ...
  │ #+END_SRC
  └────

are exported to LaTeX into:

  ┌────
  │ \lstset{language=⟨language⟩,label= ,caption= ,captionpos=b,numbers=none}
  │ \begin{lstlisting}
  │ ...
  │ \end{lstlisting}
  └────

But the:

  ┌────
  │ \lstset{language=⟨language⟩,label= ,caption= ,captionpos=b,numbers=none}
  └────

systematically added before each of the ~lstlisting~ LaTeX environments
is not always desirable and let me explain why.

Sometimes, you want the ~listings~ package to have some global settings
that are overridden by this ~\lstset{...}~ added by Org. Typically, you
may define some dialects ⟨dialect1⟩, ..., ⟨dialectN⟩ of a given
⟨language⟩ and you want to load them in addition to the (main)
⟨language⟩. This can be done by the following global setting:

  ┌────
  │ \lstset{
  │     language=⟨language⟩,
  │     alsolanguage=[⟨dialect1⟩]⟨language⟩,
  │     ...
  │     alsolanguage=[⟨dialectN⟩]⟨language⟩,
  │ }
  └────

Unfortunately, it is overridden by each ~\lstset{...}~ added by Org.

So would it be possible to provide an option that prevents Org to add
these systematic:

  ┌────
  │ \lstset{language=⟨language⟩,label= ,caption= ,captionpos=b,numbers=none}
  └────

Thanks!
-- 
Denis

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

end of thread, other threads:[~2022-10-31  8:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-26 17:27 Option that prevents Org to add \lstset{language=⟨language⟩,...} when code blocks are exported to LaTeX Denis Bitouzé
2022-10-18  4:14 ` Ihor Radchenko
2022-10-18  7:32   ` Denis Bitouzé
2022-10-18  8:11     ` Ihor Radchenko
2022-10-31  8:19       ` Ihor Radchenko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.