emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: listings and the new LaTeX exporter
Date: Thu, 24 May 2012 22:58:36 +0200	[thread overview]
Message-ID: <8762blwb2b.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: 81zk8xxrpy.fsf@gmail.com

Hi Jambunathan,

> M-x customize-group RET org-export-e-latex RET
>
> (Hint: Search for listing)

Thanks for looking into this.  This variable is set to "t".

Sorry, that I did not give a more complete workflow of how I do *not* get
listings with the new LaTeX exporter.
This now follows.


Here is the .emacs.org
,----
| (add-to-list 'load-path (expand-file-name "~/local/emacs/org-mode-install/lisp"))
| (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
| (require 'org-install)
| (require 'org-habit)
| 
| (add-to-list 'load-path (expand-file-name "~/local/emacs/org-mode/contrib/lisp"))
| (require 'org-export)
| 
| (global-set-key "\C-cl" 'org-store-link)
| (global-set-key "\C-ca" 'org-agenda)
| (global-set-key "\C-cb" 'org-iswitchb)
`----

I do emacs -Q -l .emacs.org, set the 'org-export-latex-listings to t and
run the org-export-dispatch "L" on this file:
,----
| #+TITLE: Test the listings
| 
| 
| * Some listing
| #+begin_src R
|   bh <- basehaz(coxmodel.cont.64)
| #+end_src
| 
| * Options							   :noexport:
| #+LaTeX_CLASS_OPTIONS: [11pt]
| #+LATEX_HEADER: \setlength{\parindent}{0pt}
| #+LATEX_HEADER: \setlength{\parskip}{1ex}
| #+LATEX_HEADER: \usepackage{listings}
| #+LATEX_HEADER: \usepackage{color}
| #+LATEX_HEADER: \definecolor{mylstback}{RGB}{200,200,200} % light gray
| #+LATEX_HEADER: \lstloadlanguages{R}
| #+LATEX_HEADER: \lstdefinelanguage{Renhanced}[]{R}{%
| #+LATEX_HEADER:   morekeywords={acf,ar,arima,arima.sim,colMeans,colSums,is.na,is.null,%
| #+LATEX_HEADER:                 mapply,ms,na.rm,nlmin,replicate,row.names,rowMeans,rowSums,seasonal,%
| #+LATEX_HEADER:                 sys.time,system.time,ts.plot,which.max,which.min},
| #+LATEX_HEADER:   deletekeywords={c},%
| #+LATEX_HEADER:   alsoletter={._\%},%
| #+LATEX_HEADER:   alsoother={:\$}}
| #+LATEX_HEADER: \lstset{%
| #+LATEX_HEADER:     extendedchars=true,%
| #+LATEX_HEADER:     basicstyle=\ttfamily\scriptsize, % the font that is used for the code
| #+LATEX_HEADER:     tabsize=4, % sets default tabsize to 4 spaces
| #+LATEX_HEADER:     numbers=left, % where to put the line numbers
| #+LATEX_HEADER:     numberstyle=\tiny, % line number font size
| #+LATEX_HEADER:     stepnumber=4, % step between two line numbers
| #+LATEX_HEADER:     breaklines=false, %!! don't break long lines of code
| #+LATEX_HEADER:     showtabs=false, % show tabs within strings adding particular underscores
| #+LATEX_HEADER:     showspaces=false, % show spaces adding particular underscores
| #+LATEX_HEADER:     showstringspaces=false, % underline spaces within strings
| #+LATEX_HEADER:     frame=tb,%
| #+LATEX_HEADER:     keywordstyle=\color{blue},
| #+LATEX_HEADER:     identifierstyle=\color{black},
| #+LATEX_HEADER:     stringstyle=\color{green},
| #+LATEX_HEADER:     commentstyle={\color{red}\ttfamily\itshape},
| #+LATEX_HEADER:     backgroundcolor=\color{mylstback}, % sets the background color
| #+LATEX_HEADER:     captionpos=t, % sets the caption position to `bottom'
| #+LATEX_HEADER:     extendedchars=false %!?? workaround for when the listed file is in UTF-8
| #+LATEX_HEADER: }
`----

The result is this:
,----
| % Created 2012-05-24 Do 22:52
| \documentclass[11pt]{article}
| \usepackage[utf8]{inputenc}
| \usepackage[T1]{fontenc}
| \usepackage{fixltx2e}
| \usepackage{graphicx}
| \usepackage{longtable}
| \usepackage{float}
| \usepackage{wrapfig}
| \usepackage{soul}
| \usepackage{textcomp}
| \usepackage{marvosym}
| \usepackage{wasysym}
| \usepackage{latexsym}
| \usepackage{amssymb}
| \usepackage{hyperref}
| \tolerance=1000
| \usepackage{color}
| \usepackage{listings}
| \setlength{\parindent}{0pt}
| \setlength{\parskip}{1ex}
| \usepackage{listings}
| \usepackage{color}
| \definecolor{mylstback}{RGB}{200,200,200} % light gray
| \lstloadlanguages{R}
| \lstdefinelanguage{Renhanced}[]{R}{%
| morekeywords={acf,ar,arima,arima.sim,colMeans,colSums,is.na,is.null,%
| mapply,ms,na.rm,nlmin,replicate,row.names,rowMeans,rowSums,seasonal,%
| sys.time,system.time,ts.plot,which.max,which.min},
| deletekeywords={c},%
| alsoletter={._\%},%
| alsoother={:\$}}
| \lstset{%
| extendedchars=true,%
| basicstyle=\ttfamily\scriptsize, % the font that is used for the code
| tabsize=4, % sets default tabsize to 4 spaces
| numbers=left, % where to put the line numbers
| numberstyle=\tiny, % line number font size
| stepnumber=4, % step between two line numbers
| breaklines=false, %!! don't break long lines of code
| showtabs=false, % show tabs within strings adding particular underscores
| showspaces=false, % show spaces adding particular underscores
| showstringspaces=false, % underline spaces within strings
| frame=tb,%
| keywordstyle=\color{blue},
| identifierstyle=\color{black},
| stringstyle=\color{green},
| commentstyle={\color{red}\ttfamily\itshape},
| backgroundcolor=\color{mylstback}, % sets the background color
| captionpos=t, % sets the caption position to `bottom'
| extendedchars=false %!?? workaround for when the listed file is in UTF-8
| }
| \providecommand{\alert}[1]{\textbf{#1}}
| \author{Andreas Leha}
| \date{\today}
| \title{Test the listings}
| \hypersetup{
|   pdfkeywords={},
|   pdfsubject={},
|   pdfcreator={Generated by Org mode 7.8.10 in Emacs 24.1.50.1.}}
| \begin{document}
| 
| \maketitle
| \tableofcontents
| \vspace*{1cm}
| 
| 
| 
| \section{Some listing}
| \label{sec-1}
| \begin{verbatim}
| bh <- basehaz(coxmodel.cont.64)
| \end{verbatim}
| % Generated by Org mode 7.8.10 in Emacs 24.1.50.1.
| \end{document}
`----

emacs-version: GNU Emacs 24.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2012-05-22 on zelenka, modified by Debian
org-version: Org-mode version 7.8.10 (release_7.8.10-573-g7b33d9 @ /home/andreas/local/emacs/org-mode-install/lisp/)


Any other idea, what I am doing wrong here?

Cheers,
Andreas

  reply	other threads:[~2012-05-24 20:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-24 19:49 listings and the new LaTeX exporter Andreas Leha
2012-05-24 20:13 ` Jambunathan K
2012-05-24 20:58   ` Andreas Leha [this message]
2012-05-24 21:09     ` Nick Dokos
2012-05-24 21:23       ` Andreas Leha

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=8762blwb2b.fsf@med.uni-goettingen.de \
    --to=andreas.leha@med.uni-goettingen.de \
    --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).