ox-ipynb ---- export org mode file as jupyter "*.ipynb" file

导出失败问题

最好不要导出 jupyter 不支持的代码块

  • 例如: emacs-lisp 代码块

错误类型:

  • 直接在 headline 之后,导出错误

    * my headline
    #+BEGIN_SRC emacs-lisp
    org-babel-default-header-args:jupyter-python
    #+END_SRC
    
    #+RESULTS:
    : ((:results . both) (:session . jupyter-python) (:kernel . python3) (:pandoc . t) (:exports . both) (:cache . no) (:noweb . no) (:hlines . no) (:tangle . no) (:eval . never-export))
    
    Something else
    
    • 报错:

Org Latex

中文支持

问题:中文直接导出到 latex 和 pdf, 中文不显示

解决方法一

参考:Export Org file To pdf with Chinese Fonts - 知乎

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
(with-eval-after-load 'ox-latex
  (add-to-list 'org-latex-classes
               '("ctexart" "\\documentclass[11pt]{ctexart}"
                 ("\\section{%s}" . "\\section*{%s}")
                 ("\\subsection{%s}" . "\\subsection*{%s}")
                 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
                 ("\\paragraph{%s}" . "\\paragraph*{%s}")
                 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
  (setq org-latex-default-class "ctexart")
  (setq org-latex-compiler "xelatex"))

解决方法二

1
(setq org-latex-compiler "xelatex")
#+LATEX_COMPILER: xelatex
#+LATEX_HEADER: \usepackage{xeCJK}