From: Giuseppe Lipari <giulipari@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Tabs in export of code
Date: Sun, 11 Jan 2015 17:31:06 +0100 [thread overview]
Message-ID: <CABHo5SBxfUWnc6YhoRc7YGzv6USC=ho-p6eDROxMCqMMrJk4=g@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2706 bytes --]
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 = minPrime;
}
public void run() {
// compute primes larger than minPrime
...
}
}
...
PrimeThread p = 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=sec-3-2]{Thread implementation through
sub-classing}
\begin{minted}[frame=lines,bgcolor=mybg,fontsize=\scriptsize,mathescape,samepage,xrightmargin=0.1cm,xleftmargin=0.1cm]{java}
class PrimeThread extends Thread {
long minPrime;
PrimeThread(long minPrime) {
this.minPrime = minPrime;
}
public void run() {
// compute primes larger than minPrime
...
}
}
...
PrimeThread p = 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
--
Giuseppe Lipari
LIFL
Université de Lille 1
blogs: http://scacciamennule.blogspot.com (Italian)
<http://scacciamennule.blogspot.com>
http://okpanico,wordpress.com (Italian)
http://algoland.wordpress.com (English)
[-- Attachment #2: Type: text/html, Size: 3960 bytes --]
next reply other threads:[~2015-01-11 16:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-11 16:31 Giuseppe Lipari [this message]
2015-01-11 18:01 ` Tabs in export of code Eric S Fraga
2015-01-11 18:30 ` Giuseppe Lipari
2015-01-11 21:16 ` Grant Rettke
2015-01-12 2:05 ` Charles C. Berry
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='CABHo5SBxfUWnc6YhoRc7YGzv6USC=ho-p6eDROxMCqMMrJk4=g@mail.gmail.com' \
--to=giulipari@gmail.com \
--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).