When I use org mode in emacs to export to latex and pdf file I have a problem. When I export to latex file, it's OK. but when I process latex file to export PDF file, I have this error:
Process completed with errors: [undefined control sequence] [LaTeX error]
Please tell me, how I can fix it.
You have to look at the .log file, if any, in the same directory (where the LaTeX compilation occurred).
Best (IMHO) is to compile the TeX file directly (using AUCTeX, if within Emacs), and to have a finer control on what's going wrong in the LaTeX route.
In Emacs 24 (maybe even in earlier versions) there is variable called org-latex-remove-logfiles, by default it is set to on, toggle it to off and latex will keep the log files.
To get to it, in Emacs do
M-x RET customize-variable RET org-latex-remove-logfiles
Related
I followed this doc: http://orgmode.org/manual/Working-with-LaTeX-math-snippets.html#fn-1
install perl-latexml on my ArchLinux, my emacs is 25.1.1 + spacemacs
My org has one latex formular, when config the following line in emacs, export to odt failed
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."
(require 'org)
(require 'org-chinese-utils)
(ocus-enable)
(setq org-latex-to-mathml-convert-command
"latexmlmath \"%i\" --presentationmathml=%o")
)
Formatting LaTeX using mathml OpenDocument export failed: Wrong type
argument: integer-or-marker-p,
How to fix this, I do not know what causes this problem?
If I remove the configuration in .spacemacs, export works, but no latex formular converted.
(setq org-latex-to-mathml-convert-command
"latexmlmath \"%i\" --presentationmathml=%o")
There was a bug in the odt dispatcher. In the function org-odt--translate-latex-fragments (see ox-odt.el) the function org-format-latex is called with the wrong arguments (or wrong order). I actually believe that this function was changed, and perhaps not all of the dispatchers were updated properly. Anyway, the bug was fixed in late 2016. Here is a link to the patch.
I am having exactly the same problem. My system is identical using Arch Linux, Emacs 25.1.1 and spacemacs. I also installed perl-latexml and configured emacs accordingly.
The error message is
OpenDocument export failed: Wrong type argument: integer-or-marker-p, "/path/to/folder/"
From my understanding the argument should be "/path/to/folder/file.org/" instead of "/path/to/folder/".
The error message is the same when I try to use dvipng or imagemagick to render the math snippets.
I also tried my older emacs config without spacemacs. The problem persists, so its independent of spacemacs.
I tried to compile the auctex from Emacs MELPA. The version is: 11.88.4
When I first open a .tex file, compile AUCTEX, and change to "TeX-latex-mode", Emacs will work properly, the menu bar also change to latex state.
However, when I close Emacs, restart Emacs again and open a .tex file, Emacs will give:
Debugger entered--Lisp error: (error "Autoloading failed to define function TeX-latex-mode")
And auctex will not work...
It seems the problem is in autoloading certain state when initialize the auctex for a tex file.
Any help?
Problem Solved! My mistake.
I modularised my init.el and separated the LaTeX settings to latex.el, which conflict with the latex.el in auctex.
I renamed the file to latex_settings and everyting works fine. (A small warning that no docstring for 'tex-start-shell', but that's fine.)
I have a strange problem, when I run C-c C-e b, the file is not generated, but Emacs opens a file in browser. After the export it says:
HTML export done, pushed to kill ring and clipboard
On top of that, there is not a single error message in Messages buffer. I've checked my Org-mode version (for mixed mode) and it should be ok, it shows:
Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef #
/usr/share/emacs/24.3/lisp/org/)
However, if I run export to temporary buffer, it works as expected, I can save it to file and the export is done correctly.
Other types of export work, for example export to ODT and LaTeX works completely OK.
I'm having some problems with flymake-mode when editing latex files in emacs 23.4.1. First, when I start the mode I see Flymake:! in the mode line. The manual tells me this is because "Flymake was unable to find the master file for the current buffer.", but it doesn't suggest a solution. apropos tells me there is a function TeX-master-file-ask so I call it to set the master file and try flymake-mode again, but now it gives an error about .#file.tex not being found, but the file does exist.
How can I get flymake mode to work when editing latex files?
Try adding this to your .emacs:
(setq flymake-allowed-file-name-masks
(delete '("[0-9]+\\.tex\\'"
flymake-master-tex-init
flymake-master-cleanup)
flymake-allowed-file-name-masks)) ; don't use multipart tex files
By default (Flymake .3), Flymake tries to be smart about multipart .tex files it assumes that if your .tex file ends in a number then you must be working on a multi-part file.
I personally find this behavior annoying since I like to work on files named assingment1.tex and similar. However, by default, Flymake then assumes that there is an assignment.tex master file, and I get stuck with the Flymake:! behavior you describe.
Adding the above block to your .emacs will disable this behavior.
I have a file open in Emacs which highlights the syntax and I want to share the file (with syntax highlighting) with another person who does not use Emacs.
Is it possible to export the file open in Emacs with syntax highlightning?
Any target format is ok: e.g. HTML, PDF, Image
You can use the command M-x htmlfontify-buffer to create an html file with syntax highlighting from any buffer.
It's included in standard Emacs, definitely in version 24, I'm not sure about 23.
You can use htmlize-buffer that comes with 'htmlize.el' (find it at http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el.cgi (dead link?) or install from MELPA or download from the htmlize Github project. This will create a HTML file with all the syntax highlighting of your current buffer.