From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Michael Gauland <mikelygee@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Different listing styles for same babel language?
Date: Mon, 24 Jul 2017 09:37:45 -0700 [thread overview]
Message-ID: <alpine.OSX.2.20.1707240936280.1562@charlessmacbook.attlocal.net> (raw)
In-Reply-To: <c531cd80-44d5-8b1c-a36d-ec29969c1bd9@gmail.com>
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?
>
See
(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"
#+END_SRC
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.
HTH,
Chuck
next prev parent reply other threads:[~2017-07-24 16:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-24 0:34 Different listing styles for same babel language? Michael Gauland
2017-07-24 16:37 ` Charles C. Berry [this message]
2017-08-07 1:06 ` Michael Gauland
2017-07-24 23:54 ` Adam Porter
-- strict thread matches above, loose matches on Subject: below --
2017-07-20 1:14 Michael Gauland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.OSX.2.20.1707240936280.1562@charlessmacbook.attlocal.net \
--to=ccberry@ucsd.edu \
--cc=emacs-orgmode@gnu.org \
--cc=mikelygee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).