From mboxrd@z Thu Jan 1 00:00:00 1970 From: "vendo.libri@libero.it" Subject: LaTeX export of org file uses listings instead of minted, why? Date: Sun, 23 Apr 2017 14:02:59 +0200 (CEST) Message-ID: <1105418608.15045921492948979720.JavaMail.httpd@webmail-38.iol.local> Reply-To: "vendo.libri@libero.it" Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1778364_1963300509.1492948979719" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2GEM-0004bD-Uk for emacs-orgmode@gnu.org; Sun, 23 Apr 2017 08:03:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2GEJ-0002bG-Rj for emacs-orgmode@gnu.org; Sun, 23 Apr 2017 08:03:07 -0400 Received: from smtp-16.italiaonline.it ([212.48.25.144]:44541 helo=libero.it) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d2GEJ-0002aJ-FL for emacs-orgmode@gnu.org; Sun, 23 Apr 2017 08:03:03 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org ------=_Part_1778364_1963300509.1492948979719 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello again, I'm still trying to find out why emacs doesn't pick up MINTED = instead of LISTINGS to handle code blocks when exporting files from .org to= .pdf, via .tex. I backed-up my previous .emacs file (which had a lot of customization for B= eamer, AUCTeX etc.), loaded Nick Dokos' minimal init file, restarted emacs = then tried exporting a minimal working example (MWE) of an Org file. IT WOR= KS!!! (Even though the background color is Black and I'd like it to be Whit= e!) I've tried exporting a more complicated Org file and it works too! (Albeit = with a dark background that makes it hard to read some lines). Now the question is how do I integrate these lines in my old .emacs file so= that I can keep all other modes' settings AND export code flawlessly from = Org mode? This is the result of `C-h v org-latex-listings' variable given while .emac= s file was open. In truth, this was its value also a couple of days ago, wi= th my old .emacs file active. ------------------------------------------------------------------org-latex= -listings is a variable defined in `ox-latex.el'.Its value is mintedOrigina= l value was nil------------------------------------------------------------= ------ Here's the very simple MWE of an Org file:---------------------------------= ---------------------------#+TITLE: My Minted Experiment#+AUTHOR: me#+DATE:= #+STARTUP: nolatexpreview#+OPTIONS: toc:nil#+LATEX_CLASS: article#+LATEX_C= LASS_OPTIONS: [a4paper,10pt]#+ATTR_LATEX: :mode table :booktabs#+LATEX_HEAD= ER: \usepackage{esdiff}#+LATEX_HEADER: \usepackage[version=3D4]{mhchem}#+LA= TEX_HEADER: \usepackage{amssymb}#+LATEX_HEADER: \usepackage{siunitx}#+LATEX= _HEADER: \usepackage{booktabs}#+LATEX_HEADER: \setcounter{secnumdepth}{0}#+= LATEX_HEADER: \usepackage[margin=3D1in]{geometry}#+LATEX_HEADER: \frenchspa= cing \allowdisplaybreaks#+LATEX_HEADER: \usepackage{fancyhdr}#+LATEX_HEADER= : \pagestyle{fancy} % choose page-style#+LATEX_HEADER: \fancyhf{} % erase = and clean up#+LATEX_HEADER: \fancyhf[HLE,HRO]{\thepage} % H or F=3DHeader o= r Footer, LCR=3DLeft, Centre, Right#+LATEX_HEADER: \fancyhf[HC]{My minted e= xperiment} * SECTION#+BEGIN_SRC python print "there's some code here"; a=3D True;#+END= _SRC--------------------------------------------------------------- Here's the TeX file generated with the Export command (C-c C-e l o)--------= -------------------------------------------------------% Created 2017-04-23= Sun 13:23\documentclass[a4paper,10pt]{article}\usepackage[utf8]{inputenc}\= usepackage[T1]{fontenc}\usepackage{fixltx2e}\usepackage{graphicx}\usepackag= e{longtable}\usepackage{float}\usepackage{wrapfig}\usepackage{rotating}\use= package[normalem]{ulem}\usepackage{amsmath}\usepackage{textcomp}\usepackage= {marvosym}\usepackage{wasysym}\usepackage{amssymb}\usepackage{hyperref}\tol= erance=3D1000\usepackage{minted}\usepackage{esdiff}\usepackage[version=3D4]= {mhchem}\usepackage{amssymb}\usepackage{siunitx}\usepackage{booktabs}\setco= unter{secnumdepth}{0}\usepackage[margin=3D1in]{geometry}\frenchspacing \all= owdisplaybreaks\usepackage{fancyhdr}\pagestyle{fancy} % choose page-style\f= ancyhf{} % erase and clean up\fancyhf[HLE,HRO]{\thepage} % H or F=3DHeader= or Footer, LCR=3DLeft, Centre, Right\fancyhf[HC]{My minted experiment}\aut= hor{me}\date{}\title{My Minted Experiment}\hypersetup{ pdfkeywords=3D{}, = pdfsubject=3D{}, pdfcreator=3D{Emacs 24.4.1 (Org mode 8.2.10)}}\begin{docu= ment} \maketitle \section{SECTION}\label{sec-1}\begin{minted}[fontsize=3D\footnotesize,bgcol= or=3Dblack,obeytabs=3Dtrue]{python} print "there's some code here"; a=3D Tr= ue;\end{minted}% Emacs 24.4.1 (Org mode 8.2.10)\end{document}--------------= ------------------------------------------------- This is how the .emacs file looks now: ------------------------------------= ------------- (server-start) ; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (setq reftex-plug-into-AUCTeX= t) ;;; a key for tilde symbol(define-key key-translation-map (kbd "M-2") (kbd = "~"));;; a key for backquote symbol(define-key key-translation-map (kbd "M-= 6") "")(define-key key-translation-map (kbd "M-9") (kbd "`"));;this one's o= nly for CDLaTeX math insertion(define-key key-translation-map (kbd "C-1") (= kbd "`")) ;; visual line word wrapping(global-visual-line-mode t) ;;automatically recognize org files(add-to-list 'auto-mode-alist '("\\.org\= \'" . org-mode)) ;; MINIMAL init FILE. HERE'S WHERE NICK'S INIT FILE STARTS (add-to-list 'load-path "~/src/emacs/org/org-mode/lisp") (require 'org-loaddefs)(require 'org) (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) (global-set-key "\C-cl" 'org-store-link)(global-set-key "\C-cc" 'org-captur= e)(global-set-key "\C-ca" 'org-agenda) ;;;=20 (setq org-latex-listings 'minted org-latex-packages-alist '(("" "minted"))= org-latex-pdf-process '("pdflatex -shell-escape -interaction nonstopmode= -output-directory %o %f" "pdflatex -shell-escape -interaction nonstopmo= de -output-directory %o %f"))----------------------------------------------= --- ------=_Part_1778364_1963300509.1492948979719 Content-Type: text/html;charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello again, 
I'm still trying to find out why emacs do= esn't pick up MINTED instead of LISTINGS to handle code blocks when exporti= ng files from .org to .pdf, via .tex.

I backed-up = my previous .emacs file (which had a lot of customization for Beamer, AUCTe= X etc.), loaded Nick Dokos' minimal init file, restarted emacs then tried e= xporting a minimal working example (MWE) of an Org file. IT WORKS!!! (Even = though the background color is Black and I'd like it to be White!)

I've tried exporting a more complicated Org file and it wo= rks too! (Albeit with a dark background that makes it hard to read some lin= es).

Now the question is how do I integrate these = lines in my old .emacs file so that I can keep all other modes' settings AN= D export code flawlessly from Org mode?

This is the result of `C-h v org-latex-listings' var= iable given while .emacs file was open. In truth, this was its value also a= couple of days ago, with my old .emacs file active.
<= span style=3D"font-size: 12px;">
---------------------------------------------------------------= ---
org-latex-listings is a variable defined in `ox-l= atex.el'.
Its value is minted
Original value was nil
-------------------------------------------------------------= -----

Here's the very simple MWE of an Org file:
------------------------------------------------------------
=
#+TITLE: My Minted Experiment
#+AUTHOR: me
#+= DATE: 
#+STARTUP: nolatexpreview
#+OPTIONS: toc:ni= l
#+LATEX_CLASS: article
#+LATEX_CLASS_OPTIONS: [a4pape= r,10pt]
#+ATTR_LATEX: :mode table :booktabs
#+LATEX_HEA= DER: \usepackage{esdiff}
#+LATEX_HEADER: \usepackage[version=3D4]= {mhchem}
#+LATEX_HEADER: \usepackage{amssymb}
#+LATEX_H= EADER: \usepackage{siunitx}
#+LATEX_HEADER: \usepackage{booktabs}=
#+LATEX_HEADER: \setcounter{secnumdepth}{0}
#+LATEX_HE= ADER: \usepackage[margin=3D1in]{geometry}
#+LATEX_HEADER: \french= spacing \allowdisplaybreaks
#+LATEX_HEADER: \usepackage{fancyhdr}=
#+LATEX_HEADER: \pagestyle{fancy} % choose page-style
= #+LATEX_HEADER: \fancyhf{}  % erase and clean up
#+LATEX_HEA= DER: \fancyhf[HLE,HRO]{\thepage} % H or F=3DHeader or Footer, LCR=3DLeft, C= entre, Right
#+LATEX_HEADER: \fancyhf[HC]{My minted experiment}

* SECTION
#+BEGIN_SRC python
&n= bsp;print "there's some code here";
 a=3D True;
#+= END_SRC
---------------------------------------------------= ------------


Here's the TeX file ge= nerated with the Export command (C-c C-e l o)
-------------------= --------------------------------------------
% Created 2017-= 04-23 Sun 13:23
\documentclass[a4paper,10pt]{article}
\= usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\us= epackage{fixltx2e}
\usepackage{graphicx}
\usepackage{lo= ngtable}
\usepackage{float}
\usepackage{wrapfig}
<= div>\usepackage{rotating}
\usepackage[normalem]{ulem}
\= usepackage{amsmath}
\usepackage{textcomp}
\usepackage{m= arvosym}
\usepackage{wasysym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=3D1000
\usepacka= ge{minted}
\usepackage{esdiff}
\usepackage[version=3D4]= {mhchem}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{booktabs}
\setcounter{secnumdepth}{0}
\usepackage[margin=3D1in]{geometry}
\frenchspacing \allowdisplay= breaks
\usepackage{fancyhdr}
\pagestyle{fancy} % choose= page-style
\fancyhf{}  % erase and clean up
\fanc= yhf[HLE,HRO]{\thepage} % H or F=3DHeader or Footer, LCR=3DLeft, Centre, Rig= ht
\fancyhf[HC]{My minted experiment}
\author{me}
=
\date{}
\title{My Minted Experiment}
\hypersetup{<= /div>
  pdfkeywords=3D{},
  pdfsubject=3D{},
<= div>  pdfcreator=3D{Emacs 24.4.1 (Org mode 8.2.10)}}
\begin{= document}

\maketitle

\sec= tion{SECTION}
\label{sec-1}
\begin{minted}[fontsize=3D\= footnotesize,bgcolor=3Dblack,obeytabs=3Dtrue]{python}
 print= "there's some code here";
 a=3D True;
\end{minted= }
% Emacs 24.4.1 (Org mode 8.2.10)
\end{document}
=
---------------------------------------------------------------<= /div>

This is how the .emacs file looks now: 
=
-------------------------------------------------
 (server-start)
; (ad= d-hook 'LaTeX-mode-hook 'turn-on-reftex)
 (setq reftex-plug-= into-AUCTeX t)

;;; a key for tilde symbol
(define-key key-translation-map (kbd "M-2") (kbd "~"))
;;; a ke= y for backquote symbol
(define-key key-translation-map (kbd "M-6"= ) "")
(define-key key-translation-map (kbd "M-9") (kbd "`"))
;;this one's only for CDLaTeX math insertion
(define-key ke= y-translation-map (kbd "C-1") (kbd "`"))

;; visual= line word wrapping
(global-visual-line-mode t)

;;automatically recognize org files
(add-to-list 'auto-mo= de-alist '("\\.org\\'" . org-mode))

;; MINIMAL ini= t FILE. HERE'S WHERE NICK'S INIT FILE STARTS

(add-= to-list 'load-path "~/src/emacs/org/org-mode/lisp")

(require 'org-loaddefs)
(require 'org)

(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

(global-set-key "\C-cl" 'org-store-link)
(global-set-key = "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
<= div>
;;; 

(setq org-latex-listi= ngs 'minted
  org-latex-packages-alist '(("" "minted"))
  org-latex-pdf-process
  '("pdflatex -shell-esca= pe -interaction nonstopmode -output-directory %o %f"
   = ; "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"= ))
-----------------------------= --------------------
------=_Part_1778364_1963300509.1492948979719--