From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giuseppe Lipari Subject: Tabs in export of code Date: Sun, 11 Jan 2015 17:31:06 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bf10b3a9f356f050c62ea47 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YALPx-0007s6-Nc for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 11:31:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YALPv-00022u-P0 for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 11:31:09 -0500 Received: from mail-wg0-x22a.google.com ([2a00:1450:400c:c00::22a]:62132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YALPv-00022c-Fi for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 11:31:07 -0500 Received: by mail-wg0-f42.google.com with SMTP id k14so15620543wgh.1 for ; Sun, 11 Jan 2015 08:31:06 -0800 (PST) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --047d7bf10b3a9f356f050c62ea47 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dear all, I am preparing a set of slides with examples of java code. I am using the beamer exporter, configured for using minted with the following options: #+BEGIN_SRC emacs-lisp :exports none :results silent (setq org-latex-minted-options '(("frame" "lines") ("bgcolor" "mybg") ("fontsize" "\\scriptsize") ("mathescape" "") ("samepage" "") ("xrightmargin" "0.1cm") ("xleftmargin" "0.1cm") )) #+END_SRC Also, I have my emacs init.org containing: #+begin_src emacs-lisp (setq org-src-fontify-natively t) (setq org-src-tab-acts-natively t) #+end_src and later #+BEGIN_SRC emacs-lisp (add-hook 'java-mode-hook (lambda () (setq c-basic-offset 4 tab-width 4 indent-tabs-mode nil))) #+END_SRC Ok, now the problem.I want to export a slide with this snippet: #+BEGIN_SRC java class PrimeThread extends Thread { long minPrime; PrimeThread(long minPrime) { this.minPrime =3D minPrime; } public void run() { // compute primes larger than minPrime ... } } ... PrimeThread p =3D new PrimeThread(143); p.start(); #+END_SRC There is not tab in this snipper (I never use tabs in code, only spaces). Unfortunately, when opening the tex file, I see that a tab has been introduced whenever 8 consecutive spaces are found, in particular at line 4= . Here is the produced code: \begin{frame}[fragile,label=3Dsec-3-2]{Thread implementation through sub-classing} \begin{minted}[frame=3Dlines,bgcolor=3Dmybg,fontsize=3D\scriptsize,mathesc= ape,samepage,xrightmargin=3D0.1cm,xleftmargin=3D0.1cm]{java} class PrimeThread extends Thread { long minPrime; PrimeThread(long minPrime) { this.minPrime =3D minPrime; } public void run() { // compute primes larger than minPrime ... } } ... PrimeThread p =3D new PrimeThread(143); p.start(); \end{minted} \end{frame} As you can maybe see (it depends on how your email client shows tabs), there is a tab character in front of the fourth line. Where this tab comes from? Is there any org-mode variable I can configure to prevent this behaviour? I did a quick search on google, but could find nothing Thanks in advance Giuseppe Lipari --=20 Giuseppe Lipari LIFL Universit=C3=A9 de Lille 1 blogs: http://scacciamennule.blogspot.com (Italian) http://okpanico,wordpress.com (Italian) http://algoland.wordpress.com (English) --047d7bf10b3a9f356f050c62ea47 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dear all,

I am preparing a set of = slides with examples of java code. I am using the beamer exporter, configur= ed for using minted with the following options:


#+BEGIN_SRC emac= s-lisp :exports none :results silent
=C2=A0 (setq org-latex-minted-optio= ns
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 '(("frame" &= quot;lines")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= ("bgcolor" "mybg")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 ("fontsize" "\\scriptsize")=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("mathescape&q= uot; "")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ("samepage" "")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 ("xrightmargin" "0.1cm")
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("xleftmargin&q= uot;=C2=A0 "0.1cm")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ))
#+END_SRC


Also, I have my emacs init.org containing:


#+begin_src emacs-l= isp
=C2=A0 (setq org-src-fontify-natively=C2=A0 t)
=C2=A0 (setq org-s= rc-tab-acts-natively t)
#+end_src

and later

#+= BEGIN_SRC emacs-lisp
=C2=A0 (add-hook 'java-mode-hook (lambda ()
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (setq c-basic-offset 4
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tab-width 4
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 indent-tabs-mode nil)))
#+END_SR= C



Ok, now the problem.I want to = export a slide with this snippet:


#+BEGIN_SRC java
=C2= =A0 class PrimeThread extends Thread {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 lo= ng minPrime;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PrimeThread(long minPrime) {=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 this.minPrime = =3D minPrime;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }

=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 public void run() {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 // compute primes larger than minPrime
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ...
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 }
=C2=A0 }
=C2=A0 ...
=C2=A0 PrimeThread p =3D new PrimeThread= (143);
=C2=A0 p.start();
#+END_SRC

There is not tab in this snipper (I never use tabs in cod= e, only spaces).
Unfortunately, when opening the tex file, I = see that a tab has been introduced whenever 8 consecutive spaces are found,= in particular at line 4.

Here is the produced code:
=
\begin{frame}[fragile,label=3Dsec-3-2]{Thread implementation through su= b-classing}
=C2=A0\begin{minted}[frame=3Dlines,bgcolor=3Dmybg,fontsize= =3D\scriptsize,mathescape,samepage,xrightmargin=3D0.1cm,xleftmargin=3D0.1cm= ]{java}
class PrimeThread extends Thread {
=C2=A0=C2=A0=C2=A0 long mi= nPrime;
=C2=A0=C2=A0=C2=A0 PrimeThread(long minPrime) {
=C2=A0=C2=A0= =C2=A0 this.minPrime =3D minPrime;
=C2=A0=C2=A0=C2=A0 }

=C2=A0=C2= =A0=C2=A0 public void run() {
=C2=A0=C2=A0=C2=A0 // compute primes large= r than minPrime
=C2=A0=C2=A0=C2=A0 ...
=C2=A0=C2=A0=C2=A0 }
}
.= ..
PrimeThread p =3D new PrimeThread(143);
p.start();
\end{minted}=
\end{frame}

As you can maybe see (it depends on how y= our email client shows tabs), there is a tab character in front of the four= th line.

Where this tab comes from? Is there any org-mod= e variable I can configure to prevent this behaviour? I did a quick search = on google, but could find nothing


Thanks = in advance

Giuseppe Lipari


--
<= div class=3D"gmail_signature">
Giuseppe Lipari
LIFL=
Universit=C3=A9 de Lille 1
blogs: http://scacciamennule.blogspot.com=C2=A0= (Italian)
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0http://okpanico,wordpress.com=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 (Italian)
=C2=A0=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0ht= tp://algoland.wordpress.com=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (English)
--047d7bf10b3a9f356f050c62ea47--