[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Different listing styles for same babel language?

From: Charles C. Berry
Subject: Re: [O] Different listing styles for same babel language?
Date: Mon, 24 Jul 2017 09:37:45 -0700
User-agent: Alpine 2.20 (OSX 67 2015-01-07)

On Mon, 24 Jul 2017, Michael Gauland wrote:

My org documents include lots of source code blocks, in a variety of
languages. I use the listings package to give each language a
distinctive look.

Lately, my work has involved using shell commands on different machines,
as different users. I'd like to give each shell environment (e.g., local
user, normal user on remote host, root on remote host) a different look.
At the moment, I'm doing this by specifying different shells (bash,
dash, sh) for each. This works, especially since I'm not executing the
commands from emacs, so it doesn't matter which shell I specify.

Is there a better way to do this?


        (info "(org) Advanced configuration")

and scroll down to "Extending an existing back-end" where you will find a template for modifying the output of a src-block.

Assuming you derive your exporter from the latex backend, you want to have something like

#+ATTR_LATEX: :lstyle basic
#+BEGIN_SRC shell
  echo "Hello World"

in your *.org file and use

(org-export-read-attribute :attr_latex src-block :lstyle)

to grab the "basic" or whatever in setting up the transcoded result.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]