This is the official manual for the latest Org-mode release.

Next: , Previous: Plain lists in LaTeX export, Up: LaTeX export

#### 12.10.8 Source blocks in LaTeX export

In addition to syntax defined in Literal examples, names and captions (see Images and tables), source blocks also accept two additional attributes: `:float` and `:options`.

You may set the former to

• `t`: if you want to make the source block a float. It is the default value when a caption is provided.
• `multicolumn`: if you wish to include a source block which spans multiple columns in a page.
• `nil`: if you need to avoid any floating environment, even when a caption is provided. It is useful for source code that may not fit in a single page.
```     #+ATTR_LATEX: :float nil
#+BEGIN_SRC emacs-lisp
Code that may not fit in a single page.
#+END_SRC
```

The latter allows to specify options relative to the package used to highlight code in the output (e.g., `listings`). This is the local counterpart to `org-latex-listings-options` and `org-latex-minted-options` variables, which see.

```     #+ATTR_LATEX: :options commentstyle=\bfseries
#+BEGIN_SRC emacs-lisp
(defun Fib (n)                          ; Count rabbits.
(if (< n 2) n (+ (Fib (- n 1)) (Fib (- n 2)))))
#+END_SRC
```