-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ox-epub exported source block has big indent space #25
Comments
Can you add a source snippet, which creates this image? |
Here is one section of headlines which corresponding to upper screenshot:
|
I have tested with |
I tested with another simple example:
Found the generated epub <div id="outline-container-orgab50461" class="outline-2">
<h2 id="orgab50461"><span class="section-number-2">1</span> source block indent in exporting</h2>
<div class="outline-text-2" id="text-1">
<div class="org-src-container">
<pre><code class="src src-clojure"><span style="color: #4f97d7;">(</span><span style="color: #4f97d7; font-weight: bold;">defn</span> <span style="color: #bc6ec5; font-weight: bold;">hello</span>
<span style="color: #bc6ec5;">[</span>name<span style="color: #bc6ec5;">]</span>
<span style="color: #bc6ec5;">(</span><span style="color: #4f97d7;">prn</span> <span style="color: #2d9574;">(</span><span style="color: #4f97d7;">str</span> <span style="color: #2d9574;">"Hello, "</span> name <span style="color: #2d9574;">"."</span><span style="color: #2d9574;">)</span><span style="color: #bc6ec5;">)</span><span style="color: #4f97d7;">)</span>
<span style="color: #4f97d7;">(</span>hello <span style="color: #2d9574;">"Chris"</span><span style="color: #4f97d7;">)</span>
</code></pre>
</div>
<pre class="example">
nil#'user/hellonil
</pre>
</div>
</div> Here is the screenshot It's because I tried to change some options: (setq org-html-indent t)
(setq org-src-preserve-indentation t) But still does not work. |
Thanks, will look into it in the evening |
I checked out <div class="org-src-container">
<pre><code class="src src-clojure">
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defn</span> <span class="org-function-name">hello</span>
<span class="org-rainbow-delimiters-depth-2">[</span>name<span class="org-rainbow-delimiters-depth-2">]</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">prn</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">str</span> <span class="org-string">"Hello, "</span> name <span class="org-string">"."</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> 1
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">prn</span> <span class="org-string">"kk"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-string">"a"</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">println</span> <span class="org-string">"hi"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>hello <span class="org-string">"Chris"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</code></pre>
</div> If |
I think I can fix this. But I'm currently a little bit pressed for time, please allow me to look into it on the weekend. |
Sorry for this if my update give you stress. Don't mind this. I update detail info here so that you can get more description about the problem. And Thanks. |
@ofosos Sorry for my distribution. I'm exporting a book to epub format with Org Mode content. So I need to fix this problem. What's update on this issue? |
I'll finally have some time on sunday to debug this :) |
Hey @stardiviner,
I get the same behaviour you have. If I set
It's back to the right way. Does that help? |
Confirmed, with minimal Emacs config, it works fine. Thanks @ofosos |
I found why now, it is caused by package (use-package aggressive-indent
:ensure t
:delight aggressive-indent-mode
:init (setq aggressive-indent-sit-for-time 0.1)
:config
;; global
;; only work if `global-aggressive-indent-mode'
(add-to-list 'aggressive-indent-excluded-modes 'python-mode)
(add-to-list 'aggressive-indent-excluded-modes 'haskell-mode)
(add-to-list 'aggressive-indent-excluded-modes 'lua-mode)
(add-to-list 'aggressive-indent-excluded-modes 'coq-mode)
(add-to-list 'aggressive-indent-excluded-modes 'snippet-mode)
;; (global-aggressive-indent-mode 1)
;; specific
(defun my/aggressive-indent-enable ()
(unless (or (member major-mode aggressive-indent-excluded-modes)
(member major-mode aggressive-indent-dont-electric-modes))
(aggressive-indent-mode 1)))
(add-hook 'prog-mode-hook #'my/aggressive-indent-enable)
(add-to-list 'aggressive-indent-dont-electric-modes 'python-mode)
;; The variable `aggressive-indent-dont-indent-if' lets you customize when you
;; **don't** want indentation to happen. For instance, if you think it's
;; annoying that lines jump around in `c++-mode' because you haven't typed the
;; `;' yet, you could add the following clause:
(add-to-list 'aggressive-indent-dont-indent-if
'(and (derived-mode-p 'c++-mode)
(null (string-match "\\([;{}]\\|\\b\\(if\\|for\\|while\\)\\b\\)"
(thing-at-point 'line)))))
) Can you try it out? |
It looks like this:
Always, the first line is 0-space indented. But following lines are all long-space indented.
org version: 9.1.14
emacs version: 26.1
platform: Arch Linux, 4.18.16
installed via: MELPA
The text was updated successfully, but these errors were encountered: