Re: [Orgmode] Re: Nice python listings colors, or solution to beamer + minted brokenness?
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 < 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 > > ___ 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
[Orgmode] Re: Nice python listings colors, or solution to beamer + minted brokenness?
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
[Orgmode] Re: Nice python listings colors, or solution to beamer + minted brokenness?
Christopher Allan Webber writes: > Dan Davison writes: > >> Hi Christopher, >> >> I believe I have just fixed the problem with minted and beamer. Please >> pull latex org from git and restart emacs, or ^^^ Oops, I meant to write "latest" org. I.e. just pull as normal. >> >> (setq org-beamer-fragile-re "^[ >> \t]*begin{\\(verbatim\\|lstlisting\\|minted\\)}") >> >> Personally I think that minted will be preferable to listings for your >> application. >> >> Dan > > Dan: > > It works! That looks *fantastic.* Great. If you want to play around with styles, you can use a line like #+latex_header: \usemintedstyle{tango} To see all the available styles, use the command pygmentize -L styles (my output is below) Also, if you'd like to experiment with the different options for the \begin{minted} environment, and if you're comfortable switching between git branches, then try the branch "minted" of the main org git repo, and look at the variable `org-export-latex-minted-options'. For example (setq org-export-latex-minted-options '(("frame" "lines"))) puts a frame around the src block. Of course, see minted.pdf for the options. Dan $ pygmentize -L styles Pygments version 1.4, (c) 2006-2008 by Georg Brandl. Styles: ~~~ * monokai: This style mimics the Monokai color scheme. * manni: A colorful style, inspired by the terminal highlighting style. * perldoc: Style similar to the style used in the perldoc code blocks. * borland: Style similar to the style used in the borland IDEs. * colorful: A colorful style, inspired by CodeRay. * default: The default style (inspired by Emacs 22). * murphy: Murphy's style from CodeRay. * vs: * trac: Port of the default trac highlighter design. * tango: The Crunchy default Style inspired from the color palette from the Tango Icon Theme Guidelines. * fruity: Pygments version of the "native" vim theme. * autumn: A colorful style, inspired by the terminal highlighting style. * bw: * emacs: The default style (inspired by Emacs 22). * vim: Styles somewhat like vim 7.0 * pastie: Style similar to the pastie default style. * friendly: A modern style based on the VIM pyte theme. * native: Pygments version of the "native" vim theme. > Thank you *so* much! :D :D :D > > - 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
[Orgmode] Re: Nice python listings colors, or solution to beamer + minted brokenness?
Dan Davison writes: > Hi Christopher, > > I believe I have just fixed the problem with minted and beamer. Please > pull latex org from git and restart emacs, or > > (setq org-beamer-fragile-re "^[ > \t]*begin{\\(verbatim\\|lstlisting\\|minted\\)}") > > Personally I think that minted will be preferable to listings for your > application. > > Dan Dan: It works! That looks *fantastic.* Thank you *so* much! :D :D :D - 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
[Orgmode] Re: Nice python listings colors, or solution to beamer + minted brokenness?
Christopher Allan Webber writes: > 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 Hi Christopher, I believe I have just fixed the problem with minted and beamer. Please pull latex org from git and restart emacs, or (setq org-beamer-fragile-re "^[ \t]*begin{\\(verbatim\\|lstlisting\\|minted\\)}") Personally I think that minted will be preferable to listings for your application. Dan > > 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. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode