3

I am trying to register the jfm LaTeX class (Journal of Fluid Mechanics) with the Org LaTeX export backend.

After looking around, I have put the following elisp snippet into my .emacs

(with-eval-after-load 'ox-latex                                                                                                                                                                                                           
   (add-to-list 'org-latex-classes                                                                                                                                                                                                         
                '("jfm" "\\documentclass{jfm}"                                                                                                                                                                                             
                  ("\\section{%s}" . "\\section*{%s}")                                                                                                                                                                                     
                  ("\\subsection{%s}" . "\\subsection*{%s}")                                                                                                                                                                               
                  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")                                                                                                                                                                         
                  ("\\paragraph{%s}" . "\\paragraph*{%s}")                                                                                                                                                                                 
                  ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))) .

Basically, I've looked up how the article class entry looks like and just made the minimal necessary changes.

Exporting the minimal, empty article with only title defined works and pure text works. For example,

#+TITLE: On the Uptightness of Stackoverflow Mods                                                                                                                                                                                          
#+LATEX_CLASS: jfm                                                                                                                                                                                                                             
#+LATEX_HEADER: \usepackage{graphicx}                                                                                                                                                                                                          
#+LATEX_HEADER: \usepackage{epstopdf, epsfig}                                                                                                                                                                                                  
#+LATEX_HEADER: \usepackage{float}                                                                                                                                                                                                             

Here is the text that does not produce any errors. 

shall indeed compile without errors.

However, as soon as I add an Org heading somewhere in the above example,

say * Introduction, and try to export to LaTeX, I get the following error:

org-export-get-all-transcoders: Wrong type argument: org-export-backend, [cl-struct-org-export-backend nil latex ((underline lambda (o c i) (format "\underline{%s}" c))) nil nil nil nil] .

Org package summary on my emacs build:

Status: Installed in ‘org-20170821/’,shadowing a built-in package.
Version: 20170821 Summary: Outline-based notes management and
organizer Other versions: 9.1.14 (gnu), 9.1.9 (builtin)
1
  • 1
    What you have done looks correct and it is probably the case that something in your .emacs is causing the problem. Since it works without your customizations, you should be able to bisect your way back to health: comment out half of them and see if the problem continues. If yes, comment out half of what's left and keep going. If it does not, uncomment half of what you commented out in the previous step and keep going. You should be able to zero in on the culprit fairly quickly.
    – NickD
    Commented Sep 21, 2018 at 18:06

1 Answer 1

1

I figured there might be a conflict between something I have customised before in .emacs and this so I deleted the entire automatic customisation section from .emacs. It works now. With years of customisations gone, I feel like i lost a limb, but it works.

1
  • 2
    I hope you've saved your customizations somewhere. You should be able to make this work without cutting off that limb: it should only require minor surgery, not an amputation :-)
    – NickD
    Commented Sep 21, 2018 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.