From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: Different listing styles for same babel language? Date: Mon, 24 Jul 2017 09:37:45 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZgMk-0003ha-Ds for emacs-orgmode@gnu.org; Mon, 24 Jul 2017 12:37:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZgMg-00067t-Fx for emacs-orgmode@gnu.org; Mon, 24 Jul 2017 12:37:54 -0400 Received: from iport-acv1-out.ucsd.edu ([132.239.0.176]:20128) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZgMg-00067V-34 for emacs-orgmode@gnu.org; Mon, 24 Jul 2017 12:37:50 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Michael Gauland Cc: emacs-orgmode@gnu.org 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