emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Chris Malone <chris.m.malone@gmail.com>
To: Christopher Allan Webber <cwebber@dustycloud.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: Nice python listings colors, or solution to beamer + minted brokenness?
Date: Tue, 22 Feb 2011 22:21:24 -0500	[thread overview]
Message-ID: <AANLkTimEraA0zAB4r0LAnD6dK8FG5XKk=T1pNeSBTv9L@mail.gmail.com> (raw)
In-Reply-To: <87r5ba7fzb.fsf@dustycloud.org>


[-- Attachment #1.1: Type: text/plain, Size: 3566 bytes --]

Hi Chris

Just for completeness - and because I had little previous experience with
using =org-babel= stuff - I attempted to write a small =sh= source block
that parses the current =org-mode= file and builds an appropriate "emph"
entry in the listings =lstset=:

==========================================================================================
#+startup:
beamer

#+LaTeX_CLASS:
beamer

#+BEAMER_HEADER_EXTRA:
\usetheme{Madrid}\usecolortheme{default}

#+source: parse-classes


#+begin_src sh :var fileName=(buffer-file-name) :exports none :results
output latex
  for class in `sed -n 's/.*class \([a-zA-Z0-9_]*\)(.*):/\1/p' $fileName`;
do

str="$str,$class"


done

  cat
<<EOF


\\definecolor{keywords}{RGB}{255,0,90}


\\definecolor{comments}{RGB}{60,179,113}


\\lstset{


language=Python,


keywordstyle=\\color{keywords},


commentstyle=\\color{comments},


procnamestyle=\\color{blue}\bfseries,


emph={${str:1}},


emphstyle=\\color{blue}\bfseries


}


EOF

#+end_src



*
test

** Panels in the UI (part
1)


Scripting the UI is pretty much the same as scripting the
operator,
but it goes to a separate
location..


*** Panel operator
:B_block:

:PROPERTIES:

   :BEAMER_env:
block


:END:



#+BEGIN_SRC python :exports
code
class
ReferenceDeskPanel(bpy.types.Panel):


pass

#+END_SRC



#+BEGIN_SRC python :exports
code
class
ReferenceDeskPanel23(bpy.types.Panel):


pass

#+END_SRC
==========================================================================================

There are two somewhat inconvenient issues with this approach:

- One has to evaluate the =parse-classes= source block before export, via a
=C-c C-c=.  This allows the results to be added directly to buffer as LaTeX
source code.  This was the only way I could figure out how to get it to work
- maybe someone else has a clever work around?

Part of the problem is that by the point that the code would be evaluated,
you are already within the body of the LaTeX document.  It would be nice if
there were a =#+begin_latex_document= command which would allow for anything
before this command to be in the document's preamble, and anything
afterwords to follow the LaTeX command =\begin{document}=.  Maybe this is a
feature request?

- One cannot use listings ability to use /class numbers/ to mark particular
emphasis because they get interpreted by =org-mode= as footnotes.  For
example, say you wanted all the /class/ emphasis words to be blue, but you
wanted all /def/ emphasis words to be red.  In LaTeX one could write

#+begin_latex
  \lstset{
    emph={def}, emphstyle=\color{red},
    emph={[2]class}, emphstyle=\color{blue}
#+end_latex

This can't be done with the above =parse-classes= code.

Anyway, it's a bit long-winded and probably moot seeing as how you decided
to use =minted=, but I thought I'd give it a shot.

Chris
On Mon, Feb 14, 2011 at 11:12 AM, Christopher Allan Webber <
cwebber@dustycloud.org> wrote:

> Dan, all this information is super helpful.  Thanks!  My presentation is
> going to look great now, I think!
>
> I really appreciate your help!
>  - cwebb
>
> --
> 𝓒𝓱𝓻𝓲𝓼𝓽𝓸𝓹𝓱𝓮𝓻 𝓐𝓵𝓵𝓪𝓷 𝓦𝓮𝓫𝓫𝓮𝓻
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

[-- Attachment #1.2: Type: text/html, Size: 10214 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

      reply	other threads:[~2011-02-23  3:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14  0:35 Nice python listings colors, or solution to beamer + minted brokenness? Christopher Allan Webber
2011-02-14  1:46 ` Chris Malone
2011-02-14  2:11   ` Chris Malone
2011-02-14  5:24     ` Christopher Allan Webber
2011-02-14 11:07 ` Dan Davison
2011-02-14 14:50   ` Christopher Allan Webber
2011-02-14 15:22     ` Dan Davison
2011-02-14 16:12       ` Christopher Allan Webber
2011-02-23  3:21         ` Chris Malone [this message]

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='AANLkTimEraA0zAB4r0LAnD6dK8FG5XKk=T1pNeSBTv9L@mail.gmail.com' \
    --to=chris.m.malone@gmail.com \
    --cc=cwebber@dustycloud.org \
    --cc=emacs-orgmode@gnu.org \
    /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).