Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 563
Japhir Avatar asked May 03 '16 07:05

Japhir


People also ask

What is the point of Org mode?

Org mode is routinely used to build and manage complex workflows. It does this using an elegantly simple syntax that scales from basic markup to full LaTeX typesetting and from plain text notes to literate programs. Everything you need to get started is demonstrated in the example.

How do I show images in Org mode?

Such images can be displayed within the buffer with the following command: C-c C-x C-v ( org-toggle-inline-images ) Toggle the inline display of linked images. When called with a prefix argument, also display images that do have a link description.

Is Org mode a text mode?

Org is a highly flexible structured plain text file format, composed of a few simple, yet versatile, structures — constructed to be both simple enough for the novice and powerful enough for the expert.

Who Invented Org mode?

Eric Schulte and Dan Davison. Eric and Dan are jointly responsible for the Org Babel system, which turns Org into a multi-language environment for evaluating code and doing literate programming and reproducible research. This has become one of Org's killer features that define what Org is today. John Wiegley.


2 Answers

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.

like image 188
Japhir Avatar answered Oct 12 '22 12:10

Japhir


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.

like image 24
Markus Heller Avatar answered Oct 12 '22 11:10

Markus Heller