1

I have the following seemingly innocuous org document that I am trying to export to beamer.

#+TITLE:     Foo
#+AUTHOR:    foo
#+EMAIL:     foo
#+BEAMER_HEADER: \institute[]{Penn State University} 
#+DATE:      
#+DESCRIPTION: 
#+KEYWORDS: 
#+LANGUAGE:  en
#+BEAMER_THEME: Boadilla
#+BEAMER_HEADER: 
#+latex_class: beamer
#+latex_class_options:
#+latex_header: 
#+latex_header_extra:
#+latex_compiler: pdflatex
#+OPTIONS: H:2 toc:nil
#+BEAMER_HEADER: \AtBeginSection[]{\begin{frame}<beamer>\vfill\centering\usebeamerfont{title}\insertsectionhead\vfill\end{frame}}
#+BEAMER_HEADER: \usepackage{pdfpages}
#+BEAMER_HEADER: \setbeamercolor{background canvas}{bg=}
#+BEAMER_HEADER: \makeatletter\beamer@ignorenonframefalse\makeatother
#+BEAMER_HEADER: \usepackage{caption}
#+BEAMER_HEADER: \usepackage{subcaption}
#+BEAMER_HEADER: \usepackage{multicol}
#+BEAMER_HEADER: \beamertemplatenavigationsymbolsempty
#+BEAMER_HEADER: \definecolor{links}{HTML}{4167E1}
#+BEAMER_HEADER: \hypersetup{colorlinks,linkcolor=,urlcolor=links}
#+STARTUP: beamer
#+OPTIONS: d:(not "RELATED") ^:nil

** Spurious Conclusions

#+begin_src R :exports both :results value :session "*R*" 

  w1 <- c(1, 1, 1) 
  w2 <- c(1, 1, 5) 

  x1 <- w1/sum(w1) 
  print(x1)
  
#+end_src

But its not working and I am getting this very odd (to me) cryptic backtrace:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  jit-lock--run-functions(1166 1232)
  jit-lock-fontify-now(1166 #<marker at 1232 in debug.org<2>>)
  #<subr font-lock-ensure>(1166 #<marker at 1232 in debug.org<2>>)
  polymode-inhibit-during-initialization(#<subr font-lock-ensure> 1166 #<marker at 1232 in debug.org<2>>)
  apply(polymode-inhibit-during-initialization #<subr font-lock-ensure> (1166 #<marker at 1232 in debug.org<2>>))
  font-lock-ensure(1166 #<marker at 1232 in debug.org<2>>)
  org-table-align()
  org-babel-insert-result(((0.333333333333333) (0.333333333333333) (0.333333333333333)) ("value" "replace") ("R" "\nw1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum..." ((:colname-names) (:rowname-names) (:result-params "value" "replace") (:result-type . value) (:results . "value replace") (:exports . "both") (:cache . "no") (:hlines . "no") (:noweb . "no") (:session . "*R*") (:tangle . "no")) "" nil 1008 "(ref:%s)") nil "R" (0 0 257399 34000))
  org-babel-execute-src-block(nil ("R" "\nw1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum..." ((:colname-names) (:rowname-names) (:result-params "replace" "value") (:result-type . value) (:results . "replace value") (:exports . "both") (:tangle . "no") (:session . "*R*") (:noweb . "no") (:hlines . "no") (:cache . "no")) "" nil 1008 "(ref:%s)"))
  org-babel-exp-results(("R" "\nw1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum..." ((:cache . "no") (:colname-names) (:exports . "both") (:hlines . "no") (:noweb . "no") (:result-params "replace" "value") (:result-type . value) (:results . "replace value") (:rowname-names) (:session . "*R*") (:tangle . "no")) "" nil 1008 "(ref:%s)") block nil "a9090b6b64c01c79eab1e3ad8b588c708516fd9e")
  org-babel-exp-do-export(("R" "\nw1 <- c(1, 1, 1) \nw2 <- c(1, 1, 5) \n\nx1 <- w1/sum..." ((:cache . "no") (:colname-names) (:exports . "both") (:hlines . "no") (:noweb . "no") (:result-params "replace" "value") (:result-type . value) (:results . "replace value") (:rowname-names) (:session . "*R*") (:tangle . "no")) "" nil 1008 "(ref:%s)") block "a9090b6b64c01c79eab1e3ad8b588c708516fd9e")
  org-babel-exp-src-block((src-block (:language "R" :switches nil :parameters ":exports both :results value :session \"*R*\"" :begin 1008 :end 1157 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :value "\n  w1 <- c(1, 1, 1) \n  w2 <- c(1, 1, 5) \n\n  x1 <- ..." :post-blank 3 :post-affiliated 1008 :mode planning :granularity element :cached nil :parent (section (:begin 1008 :end 1157 :contents-begin 1008 :contents-end 1154 :robust-begin 1008 :robust-end 1152 :post-blank 3 :post-affiliated 1008 :mode section :granularity element :cached nil :parent (headline (:raw-value "Spurious Conclusions" :begin 983 :end 1235 :pre-blank 1 :contents-begin 1008 :contents-end 1232 :robust-begin 1010 :robust-end 1230 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 3 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 983 :title (...) :parent (org-data ...) :cached t :org-element--cache-sync-key (0 . 983))) :org-element--cache-sync-key (0 . 1007))) :org-element--cache-sync-key (0 . 1008))))
  org-babel-exp-process-buffer()
  org-export-as(beamer nil nil nil (:output-file "debug.tex"))
  org-export-to-file(beamer "debug.tex" nil nil nil nil nil org-latex-compile)
  org-beamer-export-to-pdf()
  funcall-interactively(org-beamer-export-to-pdf)
   command-execute(org-beamer-export-to-pdf)

Any advice or help debugging this would be most appreciated!

EDIT: So a few hours of git bisecting later I found the offending lines in my config. HOWEVER, in my mind this just makes things even more confusing! Help please! What is going on?

If I comment out these lines then everything works perfectly:

  ;; (org-babel-do-load-languages
  ;;  'org-babel-load-languages
  ;;  '((R . t)
  ;;    (emacs-lisp . t)
  ;;    (latex . t)))
4
  • I was getting wrong-type-argument at first, but it refused to stop and give me a backtrace when I did toggle-debug-on-error (and I did it a couple of times to make sure that it was enabled). Then I instrumented org-table-align with edebug: there were three calls, with the third aborting with wrong-type-argument. But when I tried to look more closely, the error disappeared and the PDF was produced (correctly AFAICT). Now I cannot make it fail again - weird!
    – NickD
    Oct 6, 2022 at 17:32
  • @NickD It gets werider. See my "EDIT" (org-babel-do-load-languages ...) seemed to be the offender... What?!
    – jds
    Oct 6, 2022 at 20:55
  • *weirder. Not sure what werider means.
    – jds
    Oct 7, 2022 at 0:55
  • 1
    It's how one spells "weirder" when one is werided out...
    – NickD
    Oct 7, 2022 at 2:01

0

Your Answer

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

Browse other questions tagged or ask your own question.