Org-Mode ignore pagebreak latex cmds in HTML export - emacs

I've an org mode file with explicit page breaks using the \pagebreak latex in the file. However if I export it to HTML, I get the literal \pagebreak in the exported file. Is there a way to tell HTML export to ignore such lines?
thanks
SJ

Might try wrapping in Begin and End Latex's like this:
* This is a heading
#+Begin_Latex
\pagebreak
#+End_Latex
* Second heading

Related

Org-mode: Latex Export. I would like borders for examples

I would like to have borders for my examples. I am using the code
#+ATTR_LATEX: :options frame=single
#+begin_example
- stuRollNo:String
# stuName:name
+ subject:Subject
marks:Double
#+end_example
However, when exported to PDF, I am not getting the expected single line border. Any idea where I am doing the mistake?

How to markup org mode src block results?

In emacs org-mode, is it possible to apply markup to the RESULTS section of a SRC block output when exporting to PDF (or any export format)?
For example, here is a src code block:
#+BEGIN_SRC python :results output :exports both
print '*I would like this line to be bold*'
#+END_SRC
#+RESULTS:
: *I would like this line to be bold*
The RESULTS section is generated by the usual C-c C-c.
Normally org-mode will mark up text in * as bold, but it obviously doesn't do this if that text is in a RESULTS block (or, it appears in a SRC block). In my example, if I export this (PDF via Latex) then I just get the exact output of
*I would like this line to be bold*
...there's no markup.
Answering my own question.
There are formatting modifiers you can add in the header section of the SRC block to do what I want. One of them is 'raw'.
#+BEGIN_SRC python :results output raw
print '*I would like this line to be bold*'
#+END_SRC
#+RESULTS:
*I would like this line to be bold*
(Ironically on Stack Overflow I'm not sure how to mix code blocks and bold face, but the bold line is the result of running the code block in org-mode).
There is a full list of ways to format output here:
http://orgmode.org/manual/results.html#results

How can I stop org mode from moving my figures to the last page?

I'm currently trying to write up my thesis in emacs org-mode, and have run into some problems with file inclusions.
When I include figures with:
#+NAME: fig:banana
#+CAPTION: this is a figure caption
[[/path/to/image.png]]
(or using a pdf) it works fine. But when I insert another image, it is somehow moved to the end of the file instead of being inserted where it is called.
My pdf-export process (in my ~/.emacs file) looks like this:
(setq org-latex-pdf-process
'("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f"))
Any ideas on how to fix this?
A friend of mine pointed me to the LaTex package placeins.
#+LATEX_HEADER: \usepackage{placeins}
* section 1
** hi!
#+TITLE: fig:banana
#+CAPTION: this is a banana figure
[[/link/to/banana.png]]
\FloatBarrier
* section 2
The FloatBarrier stops floats (figures are floats) from jumping over them. I will need to look into passing [tbh] options to figures from org mode further.
Check the org-mode manual on how to pass placement options such as [h], [t] etc. to theLaTeX compiler.
If you're not sure how to control where figures (more precisely, floats) get placed by LaTeX, please refer to any introduction.
Or do you want the figure to be placed where you include it? If so, you might not need it to be a float.

Emacs org-mode markdown export: #+TITLE option not exported

I use the great org-mode to easily push modifications of README.md to GitHub projects. Markdown export works great, except for the #+TITLE option not being exported to Markdown - which works flawlessly for HTML export.
I want to keep the file name README.org for convenient converting to Markdown, else I could have chosen the title as file name, which displays the title correctly on GitHub.
Any suggestions on how to achieve this?
Based on your question and subsequent comments, you seem to want to achieve three things:
Define a custom title that gets exported as a top-level headline.
Insert the TOC after the title.
The TOC should not include the title.
Custom location for TOC
Inserting the TOC at a custom location is easy, so let's start with that: Add
#+OPTIONS: toc:nil
to the export options at the top of README.org. By itself, this tells org-mode not to include the default TOC when exporting. You can then place the TOC where you want it to go by inserting
#+TOC: headlines
at the desired location. (This method is not specific to Markdown export.)
Custom title that doesn't show up in TOC
Defining a custom title that is not included in the TOC is a bit trickier, but the basic idea is to exclude the title from the TOC by formatting it as a Markdown headline instead of an org headline. As a first step, change README.org to look like this:
#+OPTIONS: toc:nil
# Emacs als Python-Power-Editor für den RasPi
#+TOC: headlines
* Wieso nur ausgerechnet Emacs???
...
Out of the box this won't yield the desired results because org will interpret the title as a comment and by default the Markdown exporter is configured to ignore comments. However, in order to change the default behavior you can
define a custom transcoder for comments in your .emacs:
(defun org-md-comment (comment contents info)
"Transcode COMMENT object into Markdown format.
CONTENTS is nil. INFO is a plist holding contextual information."
(format "# %s" (org-element-property :value comment)))
redefine the Markdown export backend to make use of this transcoder:
(org-export-define-derived-backend 'md 'html
;; ...
:translate-alist '((bold . org-md-bold)
(code . org-md-verbatim)
(comment . org-md-comment) ;; <--- Use custom transcoder
(comment-block . (lambda (&rest args) ""))
;; ...
))
The original definition of the backend can be found in the file ox-md.el; this file is located in the directory of your org-mode installation. You'll need to copy the full definition to your .emacs file and change the line
(comment . (lambda (&rest args) ""))
as shown above.
Results
With these customizations the resulting README.md file looks like this:
# Emacs als Python-Power-Editor für den RasPi
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li>1. Wieso nur ausgerechnet Emacs???</li>
<li>2. Die Maus ist tot, es leben die shortcuts!</li>
<li>3. Auf den Emacs, fertig, los!</li>
</ul>
</div>
</div>
# Wieso nur ausgerechnet Emacs???
...
See http://article.gmane.org/gmane.emacs.orgmode/82634.
The problem is supposed to be fixed. Only waiting for an update of the converter on GitHub site...
This is useful to get what the answer expects but I think it is not the right path to resolve this question. Let me explain it
I think the issue is about exporting options from org-mode to md but I also want to keep my docs in org-mode and this hacks org-mode export option adding another line for title exporting to md headline 1 but not manages the whole thing.
What I expect and I guess this is the important issue is to export orgmode to md properly, I mean:
the title from orgmode to md heading one (#) -as orgmode to html does.
the heading one from orgmode (*) to md heading two (##)
If this issue is not about it I should open a new one :)
Best!

Escaping org-mode footnote like text

I've got "[16]" in an org-mode file that is the text you would see in an ipython shell. How do I escape that text so that it does not generate an org-mode footnote? It's fine inside of an example block, but not in the general text. The first [16] is trouble and everything I've tried so far has not produced just straight normal "[16]" in the html output when I export the file.
#+BEGIN_SRC python
def setfrequency():
print 'Setting frequency'
# Write code here to set the frequency
setfrequency()
#+END_SRC
# This next line is the footnote problem
Run it again and you should see this, but the command number [16]
will be different for you:
#+BEGIN_EXAMPLE
In [16]: run sonar # This does not export as a footnote.
Setting frequency
#+END_EXAMPLE
Thanks!
You can escape syntax using =[1]= (code) or ~[1]~ (verbatim) blocks. See the Org-Manual section on Emphasis and Monospace.
* This will export the footnote style brackets verbatim
[1] by itself will fail
=[1]= and ~[1]~ will export as is.
The relevant portion of HTML export for this is
<p class="footnote"><sup><a class="footnum" name="fn.1" href="#fnr.1">1</a>
</sup> by itself will fail
<code>[1]</code> and <code>[1]</code> will export as is.
</p>
<p class="footnote"><sup><a class="footnum" name="fn.1" href="#fnr.1">1</a>
</sup> DEFINITION NOT FOUND: 1
I tried this way.
Run it again and you should see this, but the command number
#+latex: [16]
will be different for you: