39

The simplest way to tweak the formatting of a LaTeX export is by using the geometry package. Try something like this: #+LATEX_HEADER: \usepackage[margin=0.5in]{geometry}


36

Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title: #+TITLE: Foo @@latex:\\@@ Bar I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this: #+TITLE: Foo @@latex:\\@@ @@html:<br>@@ Bar Source: https://lists.gnu.org/archive/...


28

This may be a preferred way (due to it's simplicity) of accomplishing your goal -- it seems to have gotten buried in the comments of another answer: Add the following to your .emacs file: (require 'ox-extra) (ox-extras-activate '(ignore-headlines)) Use the ignore tag on headlines you'd like to have ignored (while not ignoring their content) NOTE: if you ...


27

The following command lets you choose a back-end and then exports each top-level subtree to a separate file: (defun org-export-all (backend) "Export all subtrees that are *not* tagged with :noexport: to separate files. Note that subtrees must have the :EXPORT_FILE_NAME: property set to a unique value for this to work properly." (interactive "sEnter ...


25

The full sequence of steps that worked for me: From the command line: Run emacs without loading the init file: emacs -q In emacs: run C-u M-x org-reload Use package-list-packages to uninstall org: select it then d x Use package-list-packages to reinstall org: select it then i x After restarting emacs, everything worked.


20

This page has a nice description on how to extend org-mode links. It doesn’t address your specific concern, but it explains the basic principle. Let’s say we want your links to be defined like this, anywhere in the buffer, #+LINK-ID: wiki http://www.emacswiki.org and invoked like this [[lid:wiki][You should check out the wiki]] First, you need to tell ...


19

Add the following at the beginning of your file. #+OPTIONS: ^:nil It should do the trick. If it doesn't, I'd check org-symbols: http://orgmode.org/worg/org-symbols.html


17

If you want to construct examples yourself (that's what I'm getting from your question, but correct me if I'm wrong), use an EXAMPLE block instead of a SRC block: #+BEGIN_EXAMPLE $ ls dir1 dir2 file1 file2 ... #+END_EXAMPLE When exporting to HTML, this block becomes: <pre class="example"> $ ls dir1 dir2 file1 file2 ... </pre> As you can see, ...


17

Yes, this is entirely possible. Add the following code to your init-file: (defun org-remove-headlines (backend) "Remove headlines with :no_title: tag." (org-map-entries (lambda () (delete-region (point-at-bol) (point-at-eol))) "no_title")) (add-hook 'org-export-before-processing-hook #'org-remove-headlines) Acknowledgments This ...


15

Hyperlinks in pdfs exported from org documents are generated by the LaTeX hyperref package. This package is included by default, and options can be set in the customize interface for org-latex-default-packages-alist. For example, adding the option colorlinks=true to the entry for hyperref will switch from boxed links to coloured links. There are quite a few ...


15

is #+OPTIONS: \n:t what you want? place this line anywhere in your org-file will preserve line breaks


13

Org uses org-export-collect-headlines to collect headlines that should be in the TOC. This function already includes two criteria for excluding headlines: the headline depth and whether it is a "footnote section" (*), so it is easy to add another one. See the modified version of org-export-collect-headlines below. This version makes it possible to prevent a ...


13

Another way to achieve the same effect more permanently is to modify org-latex-packages-alist to add the geometry package, as follows: (setq org-latex-packages-alist '(("margin=2cm" "geometry" nil)))


13

According to the cited manual page, EXPORT_FILE_NAME applies only for subtree export. Whole file export will take its name from the buffer file name. If you only have 1 level-1 headline, you may add this property to a drawer inside the first heading, and always export as subtree from inside this top-level heading to get your desired file name.


13

org-mode exports _ as subscripts and ^ as superscripts The default export behavior can be customized using the menus Org -> Customize -> Browse Org Group. To update the default behavior for subscripts & superscripts, choose: [-]-\ Group Org Export [-]-\ Group Org Export General — Option Org Export With Sub Superscripts Org Export With ...


13

Following the links given here, you can get rid of the ugly red boxes by adding the following line in the beginning of your org file: #+latex_header: \hypersetup{colorlinks=true} If red isn't your color, then add the following line: #+latex_header: \hypersetup{colorlinks=true,linkcolor=blue} for a blue color.


12

You can add advice to org-latex--inline-image: (advice-add 'org-latex--inline-image :around (lambda (orig link info) (concat "\\begin{center}" (funcall orig link info) "\\end{center}"))) Note that this puts every inline image in \begin{center} ... \end{center}, even ones that are ...


12

You may try something like this: #+ATTR_LATEX: :environment longtable :align |l|p{10cm}|l| | | <30> | | | Column | Wide Column | Column | |------------+----------------------------------------------------+--------| | Some stuff | Lots and lots of ...


12

From a LaTeX point of view, these are different cases. In the first case, LaTeX isn't going to wrap -- and it shouldn't! A "verbatim" environment, which is what source-code is set in, respects lines precisely and doesn't break paragraphs, because LaTeX simply can't know where to break them. If you want to wrap the lines, you have to wrap them in the source-...


12

For others who stumble upon this question, the following is available. As hinted to by yantar92, this is included in ox-extra which is included in the org-plus-contrib elpa package. Headers can take an :ignore: tag, which excludes the heading upon export while still including its contents. To make it work, add the following to your emacs setup (having ...


11

First, I believe org can use htmlize to automatically color your source code blocks according to your theme. Alternatively. Check out http://definitelyaplug.b0.cx/post/custom-inlined-css-in-org-mode-html-export/. It has a great example of how to use the org-export-before-processing-hook to throw custom css onto an org document before an html export. Here'...


11

A solution that doesn't depend on org-export-filter-src-block-functions and gives you more flexibility is using the :exports header argument (see (info "(org) Exporting code blocks")). Setting the argument to :exports none results in neither the code block nor its results being exported. If you prefer a backend specific rule, you may use a conditional as ...


11

As JeanPierre answer pointed, you need to specify the language export setting. For French the next line does the work: #+LANGUAGE: fr No all languages are supported and, as you said, is possible to see which ones are viewing the org-latex-export-dictionary variable (you can use the emacs command C-h v then write the variable name). Some languages might be ...


11

A possible solution is to write a file with the LaTeX preamble, like %% This is the file MyTeXHeader.tex \usepackage[main=british,polutonikogreek]{babel} \usepackage{fontspec} \usepackage{hanging} \setmainfont{ebgaramond}[Contextuals=Alternate] \newcount\instr \instr=1 % hide/show instructions \babelhyphenation[british]{philo-sophy} and then use a single ...


11

Org-mode files get exported to PDF with the document preparation system LaTeX. Code blocks by default get exported into verbatim environment which does not have line wrapping. You can see this by visiting the .tex file created in the same folder when you export; your code blocks should look like this: \begin{verbatim} import socket # etc \end{verbatim} ...


10

I've written a function that does what you want in a quite extendable manner. It checks which headlines contain the property CUSTOM_LABEL (or some other property you configure) and calls the function endless/insert-org-label-latex on each of them with the value of the property as an argument. The example snippet also shows how to extend it for html or other ...


10

Also, it is good to know that the dollar syntax $...$ is not always recommended in LaTeX (and the double dollar syntax, $$...$$, for displayed equations, in strongly discouraged). For further info see this and this question on TeX.SE. Needless to say, Org-mode supports both \(...\) and \[...\]. Try exporting this to LaTeX: * Dollars hello $E=mc^2$ * ...


10

Maybe something like this (tested with LaTeX and HTML) #+TITLE: An Orged Paper #+AUTHOR: Rasmus #+DATE: A Dark Day for Science #+RESULTS: html-header #+begin_abstract #+begin_center {{{html-only(*Abstract*)}}} #+end_center my long abstract that is longer than one line. my long abstract that is longer than one line. #+end_abstract #+toc: headlines * ...


10

The solution for this spans elisp, org-mode and css customization. elisp By default, the fontification information is embedded in the exported html file. We need to disable that and tell org-mode that we are planning to specify the font formatting information using an external css file. I have chosen to prefix the html class names with org- string. ;; (...


10

It's worth mentioning that Org 9.0 is out and the #+BEGIN_HTML syntax you used is replaced with #+BEGIN_EXPORT language for export blocks. There are different ways to achieve what you want, I'm using Org-babel's noweb references here. The syntax <<inline-js>> inserts the literal javascript block before the elisp code block is evaluated: #+name: ...


Only top voted, non community-wiki answers of a minimum length are eligible