export org that has latex formular to odt failed - emacs

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.

Related

Required feature ‘scheme’ was not provided (scheme REPL in emacs)

It's probably very easy but I simply can't get a running scheme REPL in emacs.
First I installed MIT scheme and added
(setq scheme-program-name "my/path/to/bin/mit-scheme.exe")
to my init.el. But when I typed M-x run-scheme RET I got the error
Required feature ‘scheme’ was not provided
So I installed quack and added (require 'quack) to my init.el
Now when I start emacs I get the same error:Required feature ‘scheme’ was not provided
Am I missing a step?
Update
Maybe it simply doesn't work under windows:
Running Scheme under gnu-emacs If you want to run Scheme as an
inferior process in gnu-emacs or xemacs (again, this is not an option
on Windows machines), then you'll need to:
Download the xscheme.elc file. This is a byte-compiled elisp file that tells emacs how to run and interact with MIT Scheme. (Source file
is xscheme.el in case you're interested.)
This file should replace the xscheme.elc file that comes with emacs. You'll have to find the appropriate directory on your system.
On my Mandrake Linux system, this is the directory:
/usr/share/emacs/21.3/lisp. (This step is not necessary if you are
running MIT/GNU Scheme from the CS department machines.)
Add the following line to your ~/.emacs file
(load-library "xscheme")
Source (from 2005): http://www.cs.rpi.edu/academics/courses/fall05/ai/scheme/starting.html
Following doesn't work either
Quick Setup
Here is the short list of instruction's for those of you who want to
get started in a hurry. An explanation of each step follows below.
Open up emacs (or any other editor) in you home directory.
Open up the file ".emacs" and add the following line: (set-variable (quote scheme-program-name) "stk")
Save the file. You only need to do steps 1-3 once. If you were editing the file in Emacs, restart Emacs.
Start up Emacs and type the following sequence of keys:
M-x
run-scheme
A new buffer will open up with stk started inside of it.
Source: http://www-users.cs.umn.edu/~gini/1901-07s/emacs_scheme/
The error "required feature scheme was not provided" means that the first "scheme.el" found in your load-path does not contain a provide statement. Either your Emacs installation is broken (unlikely), or (more likely) you've installed some random scheme.el that hides the default one. Find it and remove it. Eg try M-x list-load-path-shadows.

Markdown-preview does't work in emacs markdown mode

Markdown preview command doesn't work.
I installed markdown-mode.el on emacs by using package-install.
Then I created test.md file as a trial. Syntax hi-lighting apparently works fine in the text.
When I used "C-c C-c p" command in order to show markdown preview, I got following error message in backtrace buffer. Even if I saved test.md file in current directory, it still said "No such file or directory". The file is located in "~/workspace/daily_log/test.md."
I tried "M-x markdown-preview" instead of shortcut key. But it doesn't work,too.
Do I make a mistake about usage of markdown-mode? Any help would be appreciated. Thanks in advance.
Error message in backtrace buffer
Debugger entered--Lisp error: (file-error "Searching for program" "No such file or directory" "bash.exe")
call-process-region(1 36 "bash.exe" "/tmp/emacsAxnXZ9" #<buffer *markdown-output*> nil "-c" "markdown")
shell-command-on-region(1 36 "markdown" "*markdown-output*")
markdown("*markdown-output*")
markdown-preview()
call-interactively(markdown-preview nil nil)
command-execute(markdown-preview)
my environment
OS: Ubuntu 14.10
emacs: 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2)
markdown-mode: markdown-mode-20140914.1012/
If you inspect the backtrace you'll see that this has nothing to do with your Markdown file.
markdown-preview needs an external markdown command that can generate HTML. It looks like whatever Markdown processor you are using is trying to call bash.exe (not bash) when converting your file.
You might have installed some Windows-centric Markdown converter.
You might have customized markdown-command, directly or indirectly causing it to call bash.exe.
Since you are on Ubuntu, a simple apt-get install markdown should give you a decent Markdown that works with markdown-mode's markdown-preview function. After installing markdown at the system level, make sure that Emacs has markdown-command set to markdown (the default value).

Emacs update-file-autoloads failing

I'm trying to setup emacs to be my GO IDE by following this tutorial with this code . I'm running into problems when I have to have emacs generate a file
From within Emacs, run M-x update-file-autoloads, point it at the go-mode.el file and tell it to generate a go-mode-load.el file.
I get this error when I enter the path of the file (location ~/.emacs.d/go-mode/go-mode.el)
Opening output file: no such file or directory, /build/buildd/emacs23-23.3+1/debian/build-x/lisp/loaddefs.el
I did a locate on this file and see I do have it but not at the path specified path above
$ locate loaddefs.el
/usr/share/emacs/23.3/lisp/loaddefs.el
...
If I had to guess I would say some kind of path problem. Do I have to set a path variable somewhere?
I installed emacs through apt-get install emacs23
I'm on Ubuntu 12.04
Thanks
EDIT
The process I'm doing to get the error.
M-x update-file-autoloads Enter
Update autoloads for file: ~/.emacs.d/go-mode/go-mode.el Enter
Opening output file: no such file or directory, /build/buildd/emacs23-23.3+1/debian/build-x/lisp/loaddefs.el
I had the same problem and finally got it working. Open your scratch buffer (or any other empty file) and type in the following two lines
(setq generated-autoload-file "~/.emacs.d/go-mode/go-mode-load.el")
(update-file-autoloads "~/.emacs.d/go-mode/go-mode.el")
Then evaluate both lines by putting the cursor at then of each line and type in C-x C-e to evaluate the line before the cursor. Do this for both lines. Then make sure to open go-mode-load.el and save the buffer - apparently emacs does not do this by default.
Once you've done this you can continue to follow the instructions at http://www.honnef.co/posts/2013/03/writing_go_in_emacs/
Disclaimer: I am sure there is a better way to do this and lisp experts will shriek at my answer. I have no clue about lisp and how to use lisp in emacs. I just did an informed guess :-)
Just recently hit this while attempting to get go-mode.el set up on my raspberry pi. Luckily, I had already generated a go-mode-load.el file successfully on my Mac and was able to take a look at that.
In there I saw this comment:
;; To update this file, evaluate the following form
;; (let ((generated-autoload-file buffer-file-name)) (update-file-autoloads "go-mode.el"))
So I cd'ed into the directory where I had downloaded go-mode.el, then touched a new file called go-mode-load.el, opened it up in emacs, pasted in that line of code, evaluated it with C-x C-e and it worked like a charm.
EDIT
Wasn't able to get the generated file working until I added these lines to the end. As of writing this I haven't taken the time to figure out why they are needed but adding them fixed the problem:
(provide 'go-mode-load)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; go-mode-load.el ends here
(Not an answer, but needs formatting)
Is there a local definition of `generated-autoload-file' in go-mode.el? If so, it will write there, so you need to remove that line.
;; update-file-autoloads docs
update-file-autoloads is an interactive compiled Lisp function in
`autoload.el'.
(update-file-autoloads FILE &optional SAVE-AFTER OUTFILE)
Update the autoloads for FILE.
If prefix arg SAVE-AFTER is non-nil, save the buffer too.
If FILE binds generated-autoload-file' as a file-local variable,
autoloads are written into that file. Otherwise, the autoloads
file is determined by OUTFILE. If called interactively, prompt
for OUTFILE; if called from Lisp with OUTFILE nil, use the
existing value ofgenerated-autoload-file'.
Return FILE if there was no autoload cookie in it, else nil.
Checkout the actual installation instructions from the go-mode-el GitHub webpage. It looks like there have been some changes which are not reflected in the tutorial.
Just try to either use ELPA or follow the manual instructions:
(add-to-list 'load-path "/place/where/you/put/it/")
(require 'go-mode-autoloads)

Emacs configuration for dirtree

I'm currently trying to get dirtree for Emacs working. I'm unfamiliar with configuration files and I'm having trouble getting it to work. Currently I have dirtree.el, along with the other required files, inside of my .emacs.d directory, and I've added the following lines to my .emacs file.
(add-to-list 'load-path "~/.emacs.d/")
(autoload 'dirtree "dirtree" "Add directory to tree view")
I don't get any errors when I open Emacs, but when I type M-x dirtree, I get a message saying there is no match. Can anyone see what I'm missing in order to get this to work correctly?
The dirtree that I'm using can be found at: http://www.emacswiki.org/emacs/dirtree.el
The error is in the autoload declaration suggested by the library. It does not include the interactive flag to tell Emacs that it is a command (interactive function), and only commands may be invoked via M-x.
The corrected declaration is:
(autoload 'dirtree "dirtree" "Add directory to tree view" t)
I've tried to load it on my machine. It seems that dirtree requires a second module called tree-mode (which I don't have installed). Did you install that one too? If not, you may have the same error.
By the way, you shouldn't have to add ~/.emacs.d to your load path; I'm reasonably sure it's there by default.

nXhtml is not highlighting PHP code, gives errors on loading

I'm using the latest nXhtml checked out from the repo, and using GNU Emacs version 24.0.91.1. When I open a PHP file it shows as un-syntax-highlighted text, and I get a compile error:
Error: Wrong type argument: number-or-marker-p, nil
and a message in the log:
File mode specification error: (cl-assertion-failed (functionp byte-compiled-fun))
I'm avoiding my .emacs and .emacs.d by running emacs with this command:
emacs -Q --eval '(load "/path/to/nxhtml/autostart")' /path/to/nxhtml/tests/in/heredoc.php
Even if you don't have a fix, how can I go about debugging this issue?
There seem to be a fair amount of such wrong-type-argument errors lately with the development version of Emacs (24). This might represent an Emacs bug. Or it might represent an nXhtml bug.
I suggest starting by notifying Lennart, the nXhtml author, trying to give him a clear recipe, starting from emacs -Q.
If that doesn't help, consider filing an Emacs bug: M-x report-emacs-bug.
To try to debug it a bit yourself, be sure to load only source files (e.g. for nXhtml), i.e., *.el, not *.elc, starting preferably with emacs -Q (no init file). Do M-x set-variable debug-on-error t to see where the error is raised. Then perhaps use M-x debug-on-entry FUNCTION, where FUNCTION is the function where the error seems to have been raised. Then step through the Emacs debugger, hitting d to step and c to skip through a step.
But again, I suggest starting with Lennart.
Try the newest version of Emacs.
I had the same problem (on Windows 7):
Error: Wrong type argument: number-or-marker-p, nil
at line 1471 of nxhtml-loaddefs.el.
Nxhtml seems fine on Emacs 24.1.50.1 (23 April 2012).
http://alpha.gnu.org/gnu/emacs/windows/?C=M;O=D