orgmode
orgmode copied to clipboard
LaTeX export doesn't use Emacs Config
Are you using "tree-sitter" branch?
No
Describe the bug
Exporting to latex (and latex-pdf) using
Steps to reproduce
- Configure latex within emacs
- Export to pdf from neovim
- See export either fail or produce export without emacs config
Expected behavior
It should utilize my emacs config
Emacs functionality
Emacs uses my config to produce the pdf, which tells it to respect certain fonts and use tectonic, etc
Screenshots and recordings
No response
OS / Distro
Debian
Neovim version/commit
0.6
Additional context
No response
Sorry for a late response on this. Can you give me an example config that you have in your emacs so I can check? I'm not using exports so I'm not very familiar with it. Export is called via emacs exacutable , I thought it should pick up emacs configuration. Are you maybe using non default configuration file?
Sorry for the delay My emacs config can be found here: https://github.com/shaunsingh/nix-darwin-dotfiles/tree/main/configs/doom Now I have a different issue, it uses the emacs config but errors out
[orgmode] Export error:
Debugger entered--Lisp error: (user-error "Unknown LaTeX class ‘chameleon’")
user-error("Unknown LaTeX class `%s'" "chameleon")
org-latex-make-preamble((:export-options nil :back-end #s(org-export-backend :name latex :parent nil :transcoders (... ... ... ... ... ... ... ... ... .
.. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) :options (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ...) :filters (... ... ... ...) :blocks nil :menu (108 "Export to LaTeX" ...)) :translate-alist ((bold . org-latex-bold) (
center-block . org-latex-center-block) (clock . org-latex-clock) (code . org-latex-code) (drawer . org-latex-drawer) (dynamic-block . org-latex-dynamic-bl
ock) (entity . org-latex-entity) (example-block . org-latex-example-block) (export-block . org-latex-export-block) (export-snippet . org-latex-export-snip
pet) (fixed-width . org-latex-fixed-width) (footnote-definition . org-latex-footnote-definition) (footnote-reference . org-latex-footnote-reference) (head
line . org-latex-headline) (horizontal-rule . org-latex-horizontal-rule) (inline-src-block . org-latex-inline-src-block) (inlinetask . org-latex-inlinetas
k) (italic . org-latex-italic) (item . org-latex-item) (keyword . org-latex-keyword) (latex-environment . org-latex-latex-environment) (latex-fragment . o
rg-latex-latex-fragment) (line-break . org-latex-line-break) (link . org-latex-link) (node-property . org-latex-node-property) (paragraph . org-latex-para
graph) ...) :exported-data #<hash-table eq 189/4001 0x41fdffad> :input-buffer "irr1.org" :input-file "/Users/shauryasingh/org/se..." :latex-class "chamele
on" :latex-class-options nil :latex-header "\\usepackage[style=mla]{bib..." :latex-header-extra nil :description nil :keywords nil :subtitle nil ...))
org-latex-template(#("\n\\begin{itemize}\n\\it..." 23 35 (:parent ...) 59 300 (:parent ...) 300 410 (:parent ...) 410 899 (:parent ...) 899 973 (:parent
...) 973 1486 (:parent ...) ...) (:export-options nil :back-end #s(org-export-backend :name latex :parent nil :transcoders ... :options ... :filters ...
:blocks nil :menu ...) :translate-alist (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) :exported-data #<hash-table
eq 189/4001 0x41fdffad> :input-buffer "irr1.org" :input-file "/Users/shauryasingh/..." :latex-class "chameleon" :latex-class-options nil :latex-header "\\
usepackage[style=ml..." :latex-header-extra nil ...))
org-export-as(latex nil nil nil (:output-file "irr1.tex"))
org-export-to-file(latex "irr1.tex" nil nil nil nil nil)
org-latex-export-to-latex()
funcall-interactively(org-latex-export-to-latex)
command-execute(org-latex-export-to-latex)
command-line-1(("--visit=/Users/shauryasingh/org/sem/irr1/irr1.org" "--funcall=org-latex-export-to-latex"))
command-line()
normal-top-level()
NOTE: Emacs export issues are most likely caused by bad or missing emacs configuration.
This might be because I lazy load my emacs packages (e.g. https://github.com/shaunsingh/nix-darwin-dotfiles/blob/main/configs/doom/config.org#ox-chameleon), and orgmode might not load them
Is it possible to have orgmode.nvim require both org and ox in emacs before exporting?
Is it possible to have orgmode.nvim require both org and ox in emacs before exporting?
I have no idea TBH. I'm using emacs cli to do the export. Something like this: emacs -nw --batch --visit=/path/to/file --funcall=org-latex-export-to-latex
Could you try not to do lazy loading and see if it works?
Regarding the initial issue, is your path to configuration non standard? Maybe emacs cli is not able to find the configuration file because it's not in the standard location. I'm just guessing here.
If this is an issue, I could expose a configuration option that would allow configuring the emacs cli executable, which would default to emacs and for your case it would be something like emacs --load /path/to/file.
@shaunsingh PR that loads your config for export has been merged. Can you pull latest master and give it a test?
Got another error:

My emacs config config is under ~/.config/emacs instead of ~/.emacs.d, which explains it. Is it possible to support both paths?
Yeah. You can set the path in your config. Checkout the docs or help to get started I think :h org-emacs-config
@shaunsingh Specifically
-- ...
emacs_config = {
executable_path = 'emacs',
config_path = '$HOME/.emacs.d/init.el',
},
-- ...
I ran to the same problem, i misconfigured config_path with configure_path . the DOCS.md don't match up with
default settings. it should be as @aareman pointed out.
I ran to the same problem, i misconfigured
config_pathwithconfigure_path. the DOCS.md don't match up with default settings. it should be as @aareman pointed out.
Good catch, I just fixed it.
I'm closing this now. If any other issue arises, please open another issue.