emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "vendo.libri@libero.it" <vendo.libri@libero.it>
To: emacs-orgmode@gnu.org
Subject: LaTeX export of org file uses listings instead of minted, why?
Date: Sun, 23 Apr 2017 14:02:59 +0200 (CEST)	[thread overview]
Message-ID: <1105418608.15045921492948979720.JavaMail.httpd@webmail-38.iol.local> (raw)

[-- Attachment #1: Type: text/plain, Size: 4920 bytes --]

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 Beamer, AUCTeX etc.), loaded Nick Dokos' minimal init file, restarted emacs then tried exporting 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 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 .emacs file was open. In truth, this was its value also a couple of days ago, with my old .emacs file active.

------------------------------------------------------------------org-latex-listings is a variable defined in `ox-latex.el'.Its value is mintedOriginal 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_CLASS_OPTIONS: [a4paper,10pt]#+ATTR_LATEX: :mode table :booktabs#+LATEX_HEADER: \usepackage{esdiff}#+LATEX_HEADER: \usepackage[version=4]{mhchem}#+LATEX_HEADER: \usepackage{amssymb}#+LATEX_HEADER: \usepackage{siunitx}#+LATEX_HEADER: \usepackage{booktabs}#+LATEX_HEADER: \setcounter{secnumdepth}{0}#+LATEX_HEADER: \usepackage[margin=1in]{geometry}#+LATEX_HEADER: \frenchspacing \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=Header or Footer, LCR=Left, Centre, Right#+LATEX_HEADER: \fancyhf[HC]{My minted experiment}
* SECTION#+BEGIN_SRC python print "there's some code here"; a= 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}\usepackage{longtable}\usepackage{float}\usepackage{wrapfig}\usepackage{rotating}\usepackage[normalem]{ulem}\usepackage{amsmath}\usepackage{textcomp}\usepackage{marvosym}\usepackage{wasysym}\usepackage{amssymb}\usepackage{hyperref}\tolerance=1000\usepackage{minted}\usepackage{esdiff}\usepackage[version=4]{mhchem}\usepackage{amssymb}\usepackage{siunitx}\usepackage{booktabs}\setcounter{secnumdepth}{0}\usepackage[margin=1in]{geometry}\frenchspacing \allowdisplaybreaks\usepackage{fancyhdr}\pagestyle{fancy} % choose page-style\fancyhf{}  % erase and clean up\fancyhf[HLE,HRO]{\thepage} % H or F=Header or Footer, LCR=Left, Centre, Right\fancyhf[HC]{My minted experiment}\author{me}\date{}\title{My Minted Experiment}\hypersetup{  pdfkeywords={},  pdfsubject={},  pdfcreator={Emacs 24.4.1 (Org mode 8.2.10)}}\begin{document}
\maketitle
\section{SECTION}\label{sec-1}\begin{minted}[fontsize=\footnotesize,bgcolor=black,obeytabs=true]{python} print "there's some code here"; a= True;\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 only 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-capture)(global-set-key "\C-ca" 'org-agenda)
;;; 
(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 nonstopmode -output-directory %o %f"))-------------------------------------------------

[-- Attachment #2: Type: text/html, Size: 6899 bytes --]

             reply	other threads:[~2017-04-23 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-23 12:02 vendo.libri [this message]
2017-04-23 13:00 ` LaTeX export of org file uses listings instead of minted, why? Kaushal Modi
  -- strict thread matches above, loose matches on Subject: below --
2017-04-23 16:03 vendo.libri
2017-04-19 22:35 vendo.libri
2017-04-20  0:31 ` Nick Dokos

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=1105418608.15045921492948979720.JavaMail.httpd@webmail-38.iol.local \
    --to=vendo.libri@libero.it \
    --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).