5here is a command named org-preview-latex-fragment in org-mode. its default binding key is C-c C-x C-l. In the org manual, it says this command could preview a latex fragment inline. but after using it, nothing is produced but blank frames (I can't upload images, sorry).
What happened? I'm using emacs23.1 on Ubuntu10.10, the org-mode version is 6.21b, and I've installed dvipng version 1.13-1.
I tried trace the code, but got lost. How can I fix this?
The easiest way to debug is to try to compile the temporary file created to create the fragment. It is usually located in /tmp and contains orgtex in the filename. You can find the exact name in Emacs's *Messages* buffer.
I resolve the problem by changing the program to convert latex fragment from dvipng to imagemagik.
I guess something is missing on my computer.
\M-x customize-variable RET org-latex-create-formula-image-program \RET
Update:
you can event increase the preview size by doing
\M-x customize-variable RET Org Format Latex Options RET
Update 2
I had some problem with imagemagick Have a look at the and switch back to dvipng after following the instruction in the doc. So both work correclty.
Related
I am using org-mod to take note of some of my work, I have recently switched from sublime where I was used to writing some mathjax snippet.
What would be the correct and easiest way of having this snippet rendered correctly (either in the buffer or if not possible, via C-c C-c or C-c C-e).
\hat{y} = \hat{\beta}_{0}+\hat{\beta}_{1}x_{1}+\hat{\beta}_{2}x_{2}+...+\hat{\beta}_{p}x_{p}
ps : in my .emacs conf file I don't have anything closely related to mathjax or Latex.
Kr,
Enclose the latex fragment in \( ... \) or \[ ... \]and do C-c C-x C-l (bound to org-toggle-latex-fragment). See the doc string of this function for argument usage.
In recent versions of org, you customize org-preview-latex-default-process to set it to the value of the backend you want. You need either dvipng, dvisvgm or ImageMagick as the backend. See also the doc string of the variable org-preview-latex-process-alist: it might help explain some things, although you don't have to do anything with it.
If these variables don't exist, you might be using an earlier version of org where the setup is different. If that's the case, then please post which version you are using: M-x org-version would tell you.
EDIT: in earlier versions, the function is called org-preview-latex-fragment and it's not bound to a key by default. You can call it with M-x org-preview-latex-fragment and you can get rid of the preview with C-c C-c. The backend setup is different as well: there is support for dvipng and ImageMagick only and the variables are different.
I use DocView Mode to display .pdf compilations via "latex-preview-pane-mode." Recently, Emacs will ask me "file ____.pdf changed on disk. Reread from disk? (yes or no)".
Typing "yes" each time disrupts my workflow. I have tried setting auto-revert-mode for the DocView buffer, but this did not help. Is there any way to fix this, or any idea why it changed suddenly (no changes to my .emacs.d in the recent past).
To achieve what Tristan suggests, first I tried M-x customize-variable RET revert-without-query, but couldn't get very far, so I wrote this in my init.el file:
(setq revert-without-query '(".pdf"))
and I'm happily udating my pdf files from org-mode without getting queried every time. (I use pdf-tools).
Source: fourth answer to a similar question in stackoverflow
(defun revert-buffer-no-confirm ()
"Revert buffer without confirmation."
(interactive)
(revert-buffer :ignore-auto :noconfirm))
Source: http://www.emacswiki.org/emacs-en/download/misc-cmds.el
Maybe this function could help you out
Take a look at the variable revert-without-query. From the Emacs Lisp documentation:
This variable holds a list of files that should be reverted without
query. The value is a list of regular expressions. If the visited
file name matches one of these regular expressions, and the file
has changed on disk but the buffer is not modified, then
‘revert-buffer’ reverts the file without asking the user for
confirmation.
Adding .+\.pdf to the list should make buffers visiting pdf files revert when you change the file on disk.
How can I view source code for a builtin Emacs package?
For instance given lisp code (require 'color), I would be interested in which functions are provided by that package. I googled emacs "color.el" and found the source code. But I wonder if this file can be viewed directly from within Emacs itself? By the way, find . -name 'color*' gives
./share/emacs/24.3/lisp/color.el.gz
./share/emacs/24.3/lisp/color.elc
You can get to the source code in a single command with M-x find-library.
You can either open the file directly in Emacs. I think .gz files are by default decompressed. Usually, I pick out one function from the package I'm interested in (e.g. org-mode), look up the documentation for that using C-hf org-mode RET and then click on the file name in the documentation buffer. It will take you the source file.
So ./share/emacs/24.3/lisp/color.el.gz is the gzipped source code, and you can open that in emacs by first doing M-x auto-compression-mode, and then visiting that file.
Emacs was working fine, a few days ago some basic functions stopped working.
Alt+Ctrl+>, Alt+Ctrl+>
go to start/end buffer used to work but now I get an undefined error.
Alt+g+g goto line. It was worked, now I get an undefined error
I can't paste into the mini buffer on search with Alt+y, instead it paste the character that my cursor is on.
No one touched my .emacs file.
What is going on? I used emacs for along time and never had a problem with basic functions or pasting to the mini buffer.
Update:
Latest update on my problem is that everything is working when I use the Esc key instead of the Alt key. I don't know why or how it changes but it has nothing to do with my .emacs file or CapsLock or key pressing mistakes. Has anybody a clue why it changes and how to change it back?
Some things to check:
Is your .emacs file loading at all? Are any of the settings in your .emacs file taking effect? Alternately, try running emacs --load /path/to/your/.emacs. This will load the lisp code in your emacs file. If your settings get loaded now, then you need to move your .emacs into the right location so Emacs can pick it up.
Is another mode unbinding your keys? To check this, go to (for example) your *scratch* buffer, which should be in lisp-interaction-mode, and try a shortcut.
Is your .emacs file broken somehow? Try opening it, and commenting everything out but one binding. Then restart emacs and see what happens. If it works, keep uncommenting out sections (binary search is the way to go) to see what line breaks loading.
Are you sure you're pressing the right keys? Hit C-h c M-g g to run describe-key-briefly to see what keys you're pressing, and what they're currently bound to.
Is something wrong with the lisp code to bind the keys? I know this isn't likely, since it used to work, but try it anyway. Open up your .emacs and go to the line binding M-g g. Put your cursor after the closing parenthesis, then press C-x C-e to evaluate the s-expression containing the binding. Then, try the keyboard shortcut again. If it works, then something isn't loading your .emacs file correctly.
You can open your dot emacs and Alt-x eval-buffer. See if your dot emacs file works, or if there are any bugs.
So, way back in January, I went here:
http://emacsformacosx.com/
I downloaded Emacs and have been using it on my Mac and I like it. I've started trying to get into Elisp programming. To learn more, I'd like to look up some functions. So for instance I do:
C-h f
and then type "scroll-down"
This gives me the following text:
>scroll-down is an interactive built-in function in `window.c'.
>
>It is bound to <kp-prior>, <prior>, C-1, C-x C-1, M-v.
>
>(scroll-down &optional ARG)
>
>Scroll text of selected window down ARG lines.
>If ARG is omitted or nil, scroll down by a near full screen.
>A near full screen is `next-screen-context-lines' less than a full screen.
>Negative ARG means scroll upward.
>If ARG is the atom `-', scroll upward by nearly full screen.
>When calling from a program, supply as argument a number, nil, or `-'.
And the text "window.c" is a link. So I click on the link and I get:
find-function-C-source: The C source file window.c is not available
I'm getting this error a lot while doing a lot of different things. Where do I find the right path, and how do I tell Emacs what that path is?
I did just recently install some ELPA packages, so maybe one of them is causing some chaos?
The variable source-directory will point to the location where the C sources are. If you have a separately downloaded copy, you'll have to point this variable to that directory.
Most packagers don't include the sources, or split them off into a separate package. Install the sources (and maybe tweak an init script to tell Emacs where you put them, if it's not the default location. The pertinent variable is find-function-C-source-directory).
If you didn't manually build Emacs from the source code and patch the C source code, value of source-directory or find-function-C-source-directory would be wrong.
You can manually download Emacs source code, unpack it somewhere and set above two variables accordingly like following
(setq source-directory "/path/to/your-emacs-repo")
;; OR
(setq find-function-C-source-directory "/path/to/your-emacs-repo/src")
GNU Emacs source code and development is hosted on savannah.gnu.org. You can find all the tags here and download the one that matches your M-x emacs-version.