Also, it's not an elegant or automated solution, but check out Section 2.8:
Emphasize Identifiers in the listings manual. You could basically add
something like
emph={ReferenceDeskPanel}, emphstyle=\color{blue}
to your =lstset= to get that particular class to have a blue font. You
could add such a line for /every/ class you have by putting in the optional
<class number> argument as described in the manual. I don't know how one
could do this for every word that follows the Python =class= directive, as
the =lstset= /key-value/ setup doesn't allow for such things...
HTH,
Chris
On Sun, Feb 13, 2011 at 8:46 PM, Chris Malone <[email protected]>wrote:
>
> Hi Chris,
>
> I doubt this will fix the problem (it is more of a curiosity), but why in
> your =lstset= do you have the language as "\Python" instead of "Python"?
>
> Chris
>
>
>
> On Sun, Feb 13, 2011 at 7:35 PM, Christopher Allan Webber <
> [email protected]> wrote:
>
>> Hello all,
>>
>> I currently am trying to export something vaguely like this for a
>> presentation in beamer:
>>
>> #+BEGIN_SRC python :exports code
>> class ReferenceDeskPanel(bpy.types.Panel):
>> bl_label = 'Reference Desk'
>> bl_space_type = 'VIEW_3D'
>> bl_region_type = 'TOOLS'
>>
>> def draw(self, context):
>> layout = self.layout
>>
>> row = layout.row()
>> row.prop(
>> context.scene, 'refdesk_search',
>> text="", icon='VIEWZOOM')
>>
>> search_string = context.scene.get('refdesk_search')
>> #+END_SRC
>>
>> I've tried using listings with:
>>
>> #+begin_LaTeX
>> \definecolor{keywords}{RGB}{255,0,90}
>> \definecolor{comments}{RGB}{60,179,113}
>>
>> \lstset{
>> language=\Python,
>> keywordstyle=\color{keywords},
>> commentstyle=\color{comments}emph,
>> procnamestyle=\color{blue}\textbf,
>> emphstyle=\color{black}\bfseries,
>> }
>> #+end_LaTeX
>>
>> in my document but I can't figure out how to get the class name
>> (ReferenceDeskPanel) to be highlighted in any form. I've read through
>> the listings manual but I can't find any reference on how to do this.
>>
>> I also tried using minted, but I'm running into the problem discussed in
>> this thread:
>>
>> http://article.gmane.org/gmane.emacs.orgmode/32147/match=minted
>>
>> I'm at wit's end... I just want to figure out how to syntax highlight my
>> whole python snippet! Any examples of good color sets in listings to
>> use would be *greatly* appreciated! Or a solution to that minted +
>> beamer problem! Either one!
>>
>> Super, ultra thanks in advance,
>> - cwebb
>>
>> --
>> 𝓒𝓱𝓻𝓲𝓼𝓽𝓸𝓹𝓱𝓮𝓻 𝓐𝓵𝓵𝓪𝓷 𝓦𝓮𝓫𝓫𝓮𝓻
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> [email protected]
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>
>
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-orgmode