Le 18/10/22 à 04h14, Ihor Radchenko a écrit : > Denis Bitouzé <denis.bito...@univ-littoral.fr> writes: > >> 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. > > Confirmed. > Is there a way to apply \lstset locally for the environment?
It is enough to put it in a group: ┌──── │ \bgroup │ \lstset{...} │ \begin{lstlisting} │ ... │ \end{lstlisting} │ \egroup └──── Otherwise, all the options specified by `\lstset` can be applied as an option of the `lstlisting` environment: ┌──── │ \begin{lstlisting}[language=⟨language⟩,...] └──── -- Denis