From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Malone Subject: Re: Nice python listings colors, or solution to beamer + minted brokenness? Date: Sun, 13 Feb 2011 21:11:47 -0500 Message-ID: References: <87aahz8nd6.fsf@dustycloud.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1481370870==" Return-path: Received: from [140.186.70.92] (port=57420 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Poo9I-0002Hv-Bh for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 21:26:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Poo9G-0005Vz-IS for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 21:26:48 -0500 Received: from mail-iw0-f169.google.com ([209.85.214.169]:55860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ponuo-0002Nk-GG for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 21:11:50 -0500 Received: by iwc10 with SMTP id 10so4779699iwc.0 for ; Sun, 13 Feb 2011 18:11:49 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Christopher Allan Webber Cc: emacs-orgmode@gnu.org --===============1481370870== Content-Type: multipart/alternative; boundary=90e6ba181996f872f2049c3491bf --90e6ba181996f872f2049c3491bf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=3D{ReferenceDeskPanel}, emphstyle=3D\color{blue} to your =3Dlstset=3D 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 argument as described in the manual. I don't know how one could do this for every word that follows the Python =3Dclass=3D directive,= as the =3Dlstset=3D /key-value/ setup doesn't allow for such things... HTH, Chris On Sun, Feb 13, 2011 at 8:46 PM, Chris Malone wro= te: > > Hi Chris, > > I doubt this will fix the problem (it is more of a curiosity), but why in > your =3Dlstset=3D do you have the language as "\Python" instead of "Pytho= n"? > > Chris > > > > On Sun, Feb 13, 2011 at 7:35 PM, Christopher Allan Webber < > cwebber@dustycloud.org> 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 =3D 'Reference Desk' >> bl_space_type =3D 'VIEW_3D' >> bl_region_type =3D 'TOOLS' >> >> def draw(self, context): >> layout =3D self.layout >> >> row =3D layout.row() >> row.prop( >> context.scene, 'refdesk_search', >> text=3D"", icon=3D'VIEWZOOM') >> >> search_string =3D 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=3D\Python, >> keywordstyle=3D\color{keywords}, >> commentstyle=3D\color{comments}emph, >> procnamestyle=3D\color{blue}\textbf, >> emphstyle=3D\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=3Dminted >> >> 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 >> >> -- >> =F0=9D=93=92=F0=9D=93=B1=F0=9D=93=BB=F0=9D=93=B2=F0=9D=93=BC=F0=9D=93=BD= =F0=9D=93=B8=F0=9D=93=B9=F0=9D=93=B1=F0=9D=93=AE=F0=9D=93=BB =F0=9D=93=90= =F0=9D=93=B5=F0=9D=93=B5=F0=9D=93=AA=F0=9D=93=B7 =F0=9D=93=A6=F0=9D=93=AE= =F0=9D=93=AB=F0=9D=93=AB=F0=9D=93=AE=F0=9D=93=BB >> >> _______________________________________________ >> 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 >> > > --90e6ba181996f872f2049c3491bf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Also, it's not an elegant or automated solution, but check out Section = 2.8: Emphasize Identifiers in the listings manual.=C2=A0 You could basicall= y add something like

emph=3D{ReferenceDeskPanel}, emphstyle=3D\color= {blue}

to your =3Dlstset=3D to get that particular class to have a blue font.= =C2=A0 You could add such a line for /every/ class you have by putting in t= he optional <class number> argument as described in the manual.=C2=A0= I don't know how one could do this for every word that follows the Pyt= hon =3Dclass=3D directive, as the =3Dlstset=3D /key-value/ setup doesn'= t allow for such things...

HTH,

Chris

On Sun, Feb 13, 201= 1 at 8:46 PM, Chris Malone <chris.m.malone@gmail.com> wrote:

Hi Chris,

I doubt this will fix the problem (it is more of a cur= iosity), but why in your =3Dlstset=3D do you have the language as "\Py= thon" instead of "Python"?

Ch= ris



On Sun, Feb 13, 2011 at 7:35 PM, Christopher Allan Webber <cwebber@du= stycloud.org> 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):
=C2=A0 =C2=A0bl_label =3D 'Reference Desk'
=C2=A0 =C2=A0bl_space_type =3D 'VIEW_3D'
=C2=A0 =C2=A0bl_region_type =3D 'TOOLS'

=C2=A0 =C2=A0def draw(self, context):
=C2=A0 =C2=A0 =C2=A0 =C2=A0layout =3D self.layout

=C2=A0 =C2=A0 =C2=A0 =C2=A0row =3D layout.row()
=C2=A0 =C2=A0 =C2=A0 =C2=A0row.prop(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0context.scene, 'refdesk_searc= h',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0text=3D"", icon=3D'= VIEWZOOM')

=C2=A0 =C2=A0 =C2=A0 =C2=A0search_string =3D context.scene.get('refdes= k_search')
#+END_SRC

I've tried using listings with:

#+begin_LaTeX
=C2=A0\definecolor{keywords}{RGB}{255,0,90}
=C2=A0\definecolor{comments}{RGB}{60,179,113}

=C2=A0\lstset{
=C2=A0 =C2=A0language=3D\Python,
=C2=A0 =C2=A0keywordstyle=3D\color{keywords},
=C2=A0 =C2=A0commentstyle=3D\color{comments}emph,
=C2=A0 =C2=A0procnamestyle=3D\color{blue}\textbf,
=C2=A0 =C2=A0emphstyle=3D\color{black}\bfseries,
=C2=A0 =C2=A0}
#+end_LaTeX

in my document but I can't figure out how to get the class name
(ReferenceDeskPanel) to be highlighted in any form. =C2=A0I've read thr= ough
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 i= n
this thread:

http://article.gmane.org/gmane.emacs.orgmode/32147/mat= ch=3Dminted

I'm at wit's end... I just want to figure out how to syntax highlig= ht my
whole python snippet! =C2=A0Any examples of good color sets in listings to<= br> use would be *greatly* appreciated! =C2=A0Or a solution to that minted + beamer problem! =C2=A0Either one!

Super, ultra thanks in advance,
=C2=A0- cwebb

--
=F0=9D=93=92=F0=9D=93=B1=F0=9D=93=BB=F0=9D=93=B2=F0=9D=93=BC=F0=9D=93=BD=F0= =9D=93=B8=F0=9D=93=B9=F0=9D=93=B1=F0=9D=93=AE=F0=9D=93=BB =F0=9D=93=90=F0= =9D=93=B5=F0=9D=93=B5=F0=9D=93=AA=F0=9D=93=B7 =F0=9D=93=A6=F0=9D=93=AE=F0= =9D=93=AB=F0=9D=93=AB=F0=9D=93=AE=F0=9D=93=BB

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


--90e6ba181996f872f2049c3491bf-- --===============1481370870== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1481370870==--