latex - Disabling automatic footnotes in Emacs org-mode

07
2014-07
  • Trevor Alexander

    I have some LaTeX inside an org-mode file that is wrapping a Ruby code snippet and providing nice color formatting, which looks kind of like this:

    #+LATEX_HEADER: \usepackage[dvipsnames]{xcolor}
    #+LATEX_HEADER: \usepackage{listings}
    #+LATEX_HEADER: \lstloadlanguages{Ruby}
    #+LATEX_HEADER: \lstset{%
    #+LATEX_HEADER: basicstyle=\ttfamily\color{black},
    #+LATEX_HEADER: commentstyle = \ttfamily\color{red},
    #+LATEX_HEADER: keywordstyle=\ttfamily\color{blue},
    #+LATEX_HEADER: stringstyle=\color{orange}}
    
    \begin{lstlisting}[language=Ruby]
    pairs_list.each {|pair|
        if (pair[0]-pair[1]).magnitude < min_dist
            min_dist = (pair[0]-pair[1]).magnitude
            best_pair = pair
        end
      }
    \end{lstlisting}
    

    All of this works fine except for the square brackets in the array addressing, which are erroneously identified as org footnotes. I tried setting autofn:nil in options, tried adding #+STARTUP: nofninline, noautofn and refreshing, but nothing worked. org-mode tries to export the nonexistent footnotes and makes a bunch of garbage.

    What's the easiest way to turn this off on a per-file basis?

    edit: The reason why you would bother doing this instead of #+BEGIN_SRC #+END_SRC is because that format is uglier and does not include colors (although that may hint at a way to solve it).

  • Answers
  • Trevor Alexander

    As reported in this mailing list, the way to stop org-mode from trying to parse the LaTeX block is to put #+BEGIN_LATEX #+END_LATEX wrappers around it. This will get you proper (LaTeX) export behavior while ensuring it is interpreted only as LaTeX.


  • Related Question

    Emacs org mode as a work diary
  • Buzzzz

    Is emacs org mode a good choice if you want to maintain a work diary?

    I have tried to use it and archive old tasks (TODOs) but is there an easy way see which tasks I worked on for example last week (some task have been timestamped more than one day) ?


  • Related Answers
  • rayners

    To see what I have done by day (there is probably a way to limit it to a particular period of time, but putting that together is a low priority for me), here is what I do. Start with C-c a that brings up the orgmode agenda menu, then L to display the timeline for the current file and finally l to turn log mode on.

    That gives me output that looks like this:

    ...
    Wednesday   9 March 2011
    Clocked:   (7:21) One of my tasks
    Clocked:   (0:07) Another of my tasks
    ...
    

    Given that this is in emacs, there is probably a way to make this simpler/quicker to use, but this is what I do at the moment.

  • Nikana Reklawyks

    I personally have a binding to insert a now timestamp, and scatter them over the tasks I work on while I do so. Then, I can see what I've been doing in the agenda (C-a a a), looking at past days.
    Maybe rayners' idea of the timeline is better, I just never used it.
    It has the advantage you can put multiple temistamps for some tasks, without depending on state changes (which I personaly don't log).

    It goes :

    ;; Insert immediate active timestamp
    (define-key global-map (kbd "<f9>")
    '(lambda () (interactive)
       (when (eq major-mode 'org-mode)
         (org-insert-time-stamp nil t nil)
         ;; (insert "\n")
         )))
    

    And may requiere org-agenda-skip-timestamp-if-done to be nil.

  • Rémi

    I've never tried it yet, but org-mode can be used to clock your working times. See : http://orgmode.org/manual/Clocking-work-time.html