language=Julia for LaTeX listings.sty?

1,651 views
Skip to first unread message

Douglas Bates

unread,
May 22, 2012, 4:55:35 PM5/22/12
to juli...@googlegroups.com
Has anyone looked at creating a language=Julia specialization for the LaTeX listings style?  Right now I am setting language=Matlab which I find vaguely offensive (not a fan of proprietary software).

Stefan Karpinski

unread,
May 22, 2012, 5:51:41 PM5/22/12
to juli...@googlegroups.com
What is the LaTeX listings style?

I'm also not a fan of proprietary software, which is, of course, a huge part of the raison d'être for Julia — the code that researchers express linear algebra algorithms in should not be proprietary and closed source.

Patrick O'Leary

unread,
May 22, 2012, 6:13:56 PM5/22/12
to juli...@googlegroups.com
I think he's referring to the listings package: https://en.wikibooks.org/wiki/LaTeX/Packages/Listings

Stefan Karpinski

unread,
May 22, 2012, 6:15:49 PM5/22/12
to juli...@googlegroups.com
Oh! Yes, that's a great idea. It would be amazing to start seeing algorithm published in Julia!!!

Mike Nolta

unread,
May 22, 2012, 6:29:21 PM5/22/12
to juli...@googlegroups.com
pygments can output latex, e.g.,

$ ./pygmentize -O full -o randg.tex randg.jl

-Mike

Lucas Virgili

unread,
May 22, 2012, 6:31:01 PM5/22/12
to juli...@googlegroups.com
And you can use minted to use that directly in the documents.

Miguel Bazdresch

unread,
May 23, 2012, 11:41:23 AM5/23/12
to juli...@googlegroups.com
On Tuesday, May 22, 2012 5:29:21 PM UTC-5, Mike Nolta wrote:
pygments can output latex, e.g.,

  $ ./pygmentize -O full -o randg.tex randg.jl

-Mike

You need to install the development version, unless I'm mistaken. The good news is that it's very easy to install.

I use minted and latest pygments in Gaston's documentation here: https://bitbucket.org/mbaz/gaston/src/57811c0ae41d/doc/gastondoc.tex

-- mb

Remo Hertig

unread,
Mar 12, 2014, 1:53:42 PM3/12/14
to juli...@googlegroups.com
I found this listings language definition, which looks quit nice:

https://gist.github.com/chi-feng/6589066

Joseph PENG

unread,
Mar 17, 2014, 12:26:59 AM3/17/14
to juli...@googlegroups.com
A great idea. I am interested in contributing : )

Miguel Bazdresch

unread,
Mar 17, 2014, 2:18:03 PM3/17/14
to juli...@googlegroups.com
Personally, I find minted to be much better than listings:

https://github.com/gpoore/minted

Since minted uses pygments, it supports julia.

-- mb

Douglas Bates

unread,
Mar 17, 2014, 2:25:12 PM3/17/14
to juli...@googlegroups.com
On Monday, March 17, 2014 1:18:03 PM UTC-5, Miguel Bazdresch wrote:
Personally, I find minted to be much better than listings:

https://github.com/gpoore/minted

Since minted uses pygments, it supports julia.

That's what I ended up using, as I should have reported back to the list.

Then I had to convince my co-authors to use minted with its requirement of the --shell-escape flag. 

Miguel Bazdresch

unread,
Mar 17, 2014, 2:50:08 PM3/17/14
to juli...@googlegroups.com
Yes, having to use the shell-escape flag is a disadvantage. The output is so nice, though.
Reply all
Reply to author
Forward
0 new messages