yangsheng6810 / org-latex-impatient Goto Github PK
View Code? Open in Web Editor NEWInstant Previews LaTeX snippets in Org-mode
License: GNU General Public License v3.0
Instant Previews LaTeX snippets in Org-mode
License: GNU General Public License v3.0
When there are two org
buffers both containing equations, the preview sometimes is not working properly.
Reproduce steps:
org
buffer 1, keep the cursor inside latex
environment.org
buffer 2 in the new window, keep the cursor inside latex
environment.I tried to use org-latex-impatient
, but the popup buffer that I get just looks like a tiny wall of text.
In the process of debugging, I called tex2svg x^2
from the commandline and noticed output like this:
(node:77903) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="2.384ex" height="2.676ex" style="vertical-align: -0.338ex;" viewBox="0 -1006.6 1026.4 1152.1" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" aria-labelledby="MathJax-SVG-1-Title">
<title id="MathJax-SVG-1-Title">x squared</title>
<defs aria-hidden="true">
<path stroke-width="1" id="E1-MJMATHI-78" d="M52 289Q59 331 106 386T222 442Q257 442 286 424T329 379Q371 442 430 442Q467 442 494 420T522 361Q522 332 508 314T481 292T458 288Q439 288 427 299T415 328Q415 374 465 391Q454 404 425 404Q412 404 406 402Q368 386 350 336Q290 115 290 78Q290 50 306 38T341 26Q378 26 414 59T463 140Q466 150 469 151T485 153H489Q504 153 504 145Q504 144 502 134Q486 77 440 33T333 -11Q263 -11 227 52Q186 -10 133 -10H127Q78 -10 57 16T35 71Q35 103 54 123T99 143Q142 143 142 101Q142 81 130 66T107 46T94 41L91 40Q91 39 97 36T113 29T132 26Q168 26 194 71Q203 87 217 139T245 247T261 313Q266 340 266 352Q266 380 251 392T217 404Q177 404 142 372T93 290Q91 281 88 280T72 278H58Q52 284 52 289Z"></path>
<path stroke-width="1" id="E1-MJMAIN-32" d="M109 429Q82 429 66 447T50 491Q50 562 103 614T235 666Q326 666 387 610T449 465Q449 422 429 383T381 315T301 241Q265 210 201 149L142 93L218 92Q375 92 385 97Q392 99 409 186V189H449V186Q448 183 436 95T421 3V0H50V19V31Q50 38 56 46T86 81Q115 113 136 137Q145 147 170 174T204 211T233 244T261 278T284 308T305 340T320 369T333 401T340 431T343 464Q343 527 309 573T212 619Q179 619 154 602T119 569T109 550Q109 549 114 549Q132 549 151 535T170 489Q170 464 154 447T109 429Z"></path>
</defs>
<g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)" aria-hidden="true">
<use xlink:href="#E1-MJMATHI-78" x="0" y="0"></use>
<use transform="scale(0.707)" xlink:href="#E1-MJMAIN-32" x="809" y="583"></use>
</g>
</svg>
which looked just like the wall of text I was seeing in emacs.
The issue seems to be that the deprecation warning at the top (which comes on stderr) is getting intermingled with the svg (which comes on stdout), and org-latex-impatient
doesn't separate stdout from stderr.
I have submitted a PR (#22) that directs stderr to its own buffer so that the output of tex2svg
is once again valid svg, but wanted to raise it as an issue as well in case others are encountering the same problem.
My configuration :
(use-package org-latex-impatient
:defer t
:hook (org-mode . org-latex-impatient-mode)
:init
(setq org-latex-impatient-tex2svg-bin "d:/xxx/Documents/utils/scoop/persist/nodejs/bin/tex2svg")
:config
(setq org-latex-impatient-delay 0.1
org-latex-impatient-scale 1
org-latex-impatient-posframe-position 'tex-end
org-latex-impatient-border-width 1))
When I try to render simple formula (
In the message buffer, each time I updated math formulas I get :
Invalid image size (see ‘max-image-size’)
Error parsing SVG image ‘(image :type svg :data <svg height="110%"><g transform="scale(1)"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0.343ex" style="vertical-align: -0.171ex;" viewBox="0 -73.8 0 147.5" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" aria-labelledby="MathJax-SVG-1-Title">
<title id="MathJax-SVG-1-Title"></title>
<defs aria-hidden="true"></defs>
<g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)" aria-hidden="true"></g>
</svg>
</g></svg> :scale 1 :max-width 2941 :max-height 1813 :format nil :transform-smoothing t)’
However, I checked that tex2svg
works fine :
tex2svg "\frac{x}{y}$ > test.svg
I can see the svg in emacs.
What is wrong ?
the error message is: "tex parse error: undefined control sequence \justifying" below the latex's code in org file buffer
The file tex2svg
installed with mathjax-node-cli is a script NodeJS that can be launched directly on Linux and macOS thanks to shebang, but Windows doesn't understand shebang. So it took me some time to figure out why things were not working and to make it work.
I see two options:
tex2svg.cmd
containingnode tex2svg %1
and call this file in the configuration
(setq org-latex-impatient-tex2svg-bin
;; location of tex2svg executable
"~/node_modules/mathjax-node-cli/bin/tex2svg.cmd")
When cursor moves out of LaTeX fragments or buffer changes, the preview does not auto hide.
Sorry if this already documented somewhere, but what should I do if I want to use latex commands from mathjax physics extension?
https://docs.mathjax.org/en/latest/input/tex/extensions/physics.html
Thanks for the great package! It would be nice to have an option show preview right below current cursor.
The default generated text is black, and due to transparent background, it is barely visible in emacs dark theme.
Great package! But now it's only display the svg when the user moves cursor within the formula. Can you make it work like "org-latex-preview-mode" ?
Thanks.
Weird error I'm getting on emacs 29.0.60 and org 9.6, causes the whole screen to flash/redisplay but the preview does display correctly.
⛔ Warning (org-element-cache): org-element--cache: Org parser error in main.org::86. Resetting.
The error was: (error "Invalid search bound (wrong side of point)")
Backtrace:
" backtrace-to-string(nil)
org-element-at-point()
org--collect-keywords-1((\"SETUPFILE\" \"LATEX_CLASS\" \"LATEX_CLASS_OPTIONS\" \"LATEX_HEADER\" \"LATEX_HEADER_EXTRA\" \"DESCRIPTION\" \"KEYWORDS\" \"SUBTITLE\" \"LATEX_ENGRAVED_THEME\" \"LATEX_COMPILER\" \"DATE\" \"TITLE\" \"DATE\" \"AUTHOR\" \"EMAIL\" \"LANGUAGE\" \"SELECT_TAGS\" \"EXCLUDE_TAGS\" \"CREATOR\" \"CITE_EXPORT\" \"FILETAGS\" \"OPTIONS\") nil nil (\"/Users/alex/Documents/knowledge/main.org\") nil)
org-collect-keywords((\"LATEX_CLASS\" \"LATEX_CLASS_OPTIONS\" \"LATEX_HEADER\" \"LATEX_HEADER_EXTRA\" \"DESCRIPTION\" \"KEYWORDS\" \"SUBTITLE\" \"LATEX_ENGRAVED_THEME\" \"LATEX_COMPILER\" \"DATE\" \"TITLE\" \"DATE\" \"AUTHOR\" \"EMAIL\" \"LANGUAGE\" \"SELECT_TAGS\" \"EXCLUDE_TAGS\" \"CREATOR\" \"CITE_EXPORT\" \"FILETAGS\" \"OPTIONS\"))
org-export--get-inbuffer-options(#s(org-export-backend :name latex :parent nil :transcoders ((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-block) (entity . org-latex-entity) (example-block . org-latex-example-block) (export-block . org-latex-export-block) (export-snippet . org-latex-export-snippet) (fixed-width . org-latex-fixed-width) (footnote-definition . org-latex-footnote-definition) (footnote-reference . org-latex-footnote-reference) (headline . org-latex-headline) (horizontal-rule . org-latex-horizontal-rule) (inline-src-block . org-latex-inline-src-block) (inlinetask . org-latex-inlinetask) (italic . org-latex-italic) (item . org-latex-item) (keyword . org-latex-keyword) (latex-environment . org-latex-latex-environment) (latex-fragment . org-latex-latex-fragment) (line-break . org-latex-line-break) (link . org-latex-link) (node-property . org-latex-node-property) (paragraph . org-latex-paragraph) (plain-list . org-latex-plain-list) (plain-text . org-latex-plain-text) (planning . org-latex-planning) (property-drawer . org-latex-property-drawer) (quote-block . org-latex-quote-block) (radio-target . org-latex-radio-target) (section . org-latex-section) (special-block . org-latex-special-block) (src-block . org-latex-src-block) (statistics-cookie . org-latex-statistics-cookie) (strike-through . org-latex-strike-through) (subscript . org-latex-subscript) ...) :options ((:latex-class \"LATEX_CLASS\" nil org-latex-default-class t) (:latex-class-options \"LATEX_CLASS_OPTIONS\" nil nil t) (:latex-header \"LATEX_HEADER\" nil nil newline) (:latex-header-extra \"LATEX_HEADER_EXTRA\" nil nil newline) (:description \"DESCRIPTION\" nil nil parse) (:keywords \"KEYWORDS\" nil nil parse) (:subtitle \"SUBTITLE\" nil nil parse) (:latex-active-timestamp-format nil nil org-latex-active-timestamp-format) (:latex-caption-above nil nil org-latex-caption-above) (:latex-classes nil nil org-latex-classes) (:latex-default-figure-position nil nil org-latex-default-figure-position) (:latex-default-table-environment nil nil org-latex-default-table-environment) (:latex-default-quote-environment nil nil org-latex-default-quote-environment) (:latex-default-table-mode nil nil org-latex-default-table-mode) (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-format) (:latex-engraved-options nil nil org-latex-engraved-options) (:latex-engraved-preamble nil nil org-latex-engraved-preamble) (:latex-engraved-theme \"LATEX_ENGRAVED_THEME\" nil org-latex-engraved-theme) (:latex-footnote-defined-format nil nil org-latex-footnote-defined-format) (:latex-footnote-separator nil nil org-latex-footnote-separator) (:latex-format-drawer-function nil nil org-latex-format-drawer-function) (:latex-format-headline-function nil nil org-latex-format-headline-function) (:latex-format-inlinetask-function nil nil org-latex-format-inlinetask-function) (:latex-hyperref-template nil nil org-latex-hyperref-template t) (:latex-image-default-scale nil nil org-latex-image-default-scale) (:latex-image-default-height nil nil org-latex-image-default-height) (:latex-image-default-option nil nil org-latex-image-default-option) (:latex-image-default-width nil nil org-latex-image-default-width) (:latex-images-centered nil nil org-latex-images-centered) (:latex-inactive-timestamp-format nil nil org-latex-inactive-timestamp-format) (:latex-inline-image-rules nil nil org-latex-inline-image-rules) (:latex-link-with-unknown-path-format nil nil org-latex-link-with-unknown-path-format) (:latex-src-block-backend nil nil org-latex-src-block-backend) (:latex-listings-langs nil nil org-latex-listings-langs) (:latex-listings-options nil nil org-latex-listings-options) (:latex-listings-src-omit-language nil nil org-latex-listings-src-omit-language) (:latex-minted-langs nil nil org-latex-minted-langs) (:latex-minted-options nil nil org-latex-minted-options) ...) :filters ((:filter-options . org-latex-math-block-options-filter) (:filter-paragraph . org-latex-clean-invalid-line-breaks) (:filter-parse-tree org-latex-math-block-tree-filter org-latex-matrices-tree-filter org-latex-image-link-filter) (:filter-verse-block . org-latex-clean-invalid-line-breaks)) :blocks nil :menu (108 \"Export to LaTeX\" ((76 \"As LaTeX buffer\" org-latex-export-as-latex) (108 \"As LaTeX file\" org-latex-export-to-latex) (112 \"As PDF file\" org-latex-export-to-pdf) (111 \"As PDF file and open\" (lambda ... ...))))))
org-export-get-environment(#s(org-export-backend :name latex :parent nil :transcoders ((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-block) (entity . org-latex-entity) (example-block . org-latex-example-block) (export-block . org-latex-export-block) (export-snippet . org-latex-export-snippet) (fixed-width . org-latex-fixed-width) (footnote-definition . org-latex-footnote-definition) (footnote-reference . org-latex-footnote-reference) (headline . org-latex-headline) (horizontal-rule . org-latex-horizontal-rule) (inline-src-block . org-latex-inline-src-block) (inlinetask . org-latex-inlinetask) (italic . org-latex-italic) (item . org-latex-item) (keyword . org-latex-keyword) (latex-environment . org-latex-latex-environment) (latex-fragment . org-latex-latex-fragment) (line-break . org-latex-line-break) (link . org-latex-link) (node-property . org-latex-node-property) (paragraph . org-latex-paragraph) (plain-list . org-latex-plain-list) (plain-text . org-latex-plain-text) (planning . org-latex-planning) (property-drawer . org-latex-property-drawer) (quote-block . org-latex-quote-block) (radio-target . org-latex-radio-target) (section . org-latex-section) (special-block . org-latex-special-block) (src-block . org-latex-src-block) (statistics-cookie . org-latex-statistics-cookie) (strike-through . org-latex-strike-through) (subscript . org-latex-subscript) ...) :options ((:latex-class \"LATEX_CLASS\" nil org-latex-default-class t) (:latex-class-options \"LATEX_CLASS_OPTIONS\" nil nil t) (:latex-header \"LATEX_HEADER\" nil nil newline) (:latex-header-extra \"LATEX_HEADER_EXTRA\" nil nil newline) (:description \"DESCRIPTION\" nil nil parse) (:keywords \"KEYWORDS\" nil nil parse) (:subtitle \"SUBTITLE\" nil nil parse) (:latex-active-timestamp-format nil nil org-latex-active-timestamp-format) (:latex-caption-above nil nil org-latex-caption-above) (:latex-classes nil nil org-latex-classes) (:latex-default-figure-position nil nil org-latex-default-figure-position) (:latex-default-table-environment nil nil org-latex-default-table-environment) (:latex-default-quote-environment nil nil org-latex-default-quote-environment) (:latex-default-table-mode nil nil org-latex-default-table-mode) (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-format) (:latex-engraved-options nil nil org-latex-engraved-options) (:latex-engraved-preamble nil nil org-latex-engraved-preamble) (:latex-engraved-theme \"LATEX_ENGRAVED_THEME\" nil org-latex-engraved-theme) (:latex-footnote-defined-format nil nil org-latex-footnote-defined-format) (:latex-footnote-separator nil nil org-latex-footnote-separator) (:latex-format-drawer-function nil nil org-latex-format-drawer-function) (:latex-format-headline-function nil nil org-latex-format-headline-function) (:latex-format-inlinetask-function nil nil org-latex-format-inlinetask-function) (:latex-hyperref-template nil nil org-latex-hyperref-template t) (:latex-image-default-scale nil nil org-latex-image-default-scale) (:latex-image-default-height nil nil org-latex-image-default-height) (:latex-image-default-option nil nil org-latex-image-default-option) (:latex-image-default-width nil nil org-latex-image-default-width) (:latex-images-centered nil nil org-latex-images-centered) (:latex-inactive-timestamp-format nil nil org-latex-inactive-timestamp-format) (:latex-inline-image-rules nil nil org-latex-inline-image-rules) (:latex-link-with-unknown-path-format nil nil org-latex-link-with-unknown-path-format) (:latex-src-block-backend nil nil org-latex-src-block-backend) (:latex-listings-langs nil nil org-latex-listings-langs) (:latex-listings-options nil nil org-latex-listings-options) (:latex-listings-src-omit-language nil nil org-latex-listings-src-omit-language) (:latex-minted-langs nil nil org-latex-minted-langs) (:latex-minted-options nil nil org-latex-minted-options) ...) :filters ((:filter-options . org-latex-math-block-options-filter) (:filter-paragraph . org-latex-clean-invalid-line-breaks) (:filter-parse-tree org-latex-math-block-tree-filter org-latex-matrices-tree-filter org-latex-image-link-filter) (:filter-verse-block . org-latex-clean-invalid-line-breaks)) :blocks nil :menu (108 \"Export to LaTeX\" ((76 \"As LaTeX buffer\" org-latex-export-as-latex) (108 \"As LaTeX file\" org-latex-export-to-latex) (112 \"As PDF file\" org-latex-export-to-pdf) (111 \"As PDF file and open\" (lambda ... ...))))))
org-latex-impatient--get-headers()
org-latex-impatient-start()
apply(org-latex-impatient-start nil)
timer-event-handler([t 0 0 100000 nil org-latex-impatient-start nil idle 0 nil])
"
Please report this to Org mode mailing list (M-x org-submit-bug-report).
Possible, even likely, that this is a configuration error on my part, but I wanted to submit in case it's not, so apologies if this is my fault...
config:
(use-package org-latex-instant-preview
:quelpa (org-latex-instant-preview :fetcher github :repo "yangsheng6810/org-latex-instant-preview")
:hook (org-mode . org-latex-instant-preview-mode))
I got Error getting PACKAGE-DESC: (error Version must be a string)
quelpa-package-install: Wrong type argument: package-desc, nil
bactrace:
Debugger entered--Lisp error: (error "Version must be a string")
signal(error ("Version must be a string"))
error("Version must be a string")
version-to-list(28\.0\.50)
#f(compiled-function (elt) #<bytecode 0x4105caad>)((emacs 28\.0\.50))
mapcar(#f(compiled-function (elt) #<bytecode 0x4105caad>) ((emacs 28\.0\.50) (cl-lib "0.5")))
package-desc-from-define("org-latex-instant-preview" "20200607.1338" "Preview org-latex Fragments Instantly via MathJax" ((emacs 28\.0\.50) (cl-lib "0.5")) :kind single :url "https://github.com/yangsheng6810/org-latex-instant-preview" :maintainer ("Sheng Yang" . "[email protected]") :authors (("Sheng Yang" . "[email protected]")))
package-buffer-info()
quelpa-get-package-desc("/Users/wangtianshu/.emacs.d/quelpa/packages/org-latex-instant-preview-20200607.1338.el")
quelpa-package-install((org-latex-instant-preview :fetcher github :repo "yangsheng6810/org-latex-instant-preview"))
apply(quelpa-package-install (org-latex-instant-preview :fetcher github :repo "yangsheng6810/org-latex-instant-preview") nil)
quelpa((org-latex-instant-preview :fetcher github :repo "yangsheng6810/org-latex-instant-preview"))
apply(quelpa (org-latex-instant-preview :fetcher github :repo "yangsheng6810/org-latex-instant-preview"))
(if (and quelpa-use-package-inhibit-loading-quelpa (package-installed-p (quote org-latex-instant-preview))) nil (apply (quote quelpa) (quote ((org-latex-instant-preview :fetcher github :repo "yangsheng6810/org-latex-instant-preview")))))
(progn (if (and quelpa-use-package-inhibit-loading-quelpa (package-installed-p (quote org-latex-instant-preview))) nil (apply (quote quelpa) (quote ((org-latex-instant-preview :fetcher github :repo "yangsheng6810/org-latex-instant-preview"))))) (if (fboundp (quote org-latex-instant-preview-mode)) nil (autoload (function org-latex-instant-preview-mode) "org-latex-instant-preview" nil t)) (add-hook (quote org-mode-hook) (function org-latex-instant-preview-mode)))
(progn (progn (if (and quelpa-use-package-inhibit-loading-quelpa (package-installed-p (quote org-latex-instant-preview))) nil (apply (quote quelpa) (quote ((org-latex-instant-preview :fetcher github :repo "yangsheng6810/org-latex-instant-preview"))))) (if (fboundp (quote org-latex-instant-preview-mode)) nil (autoload (function org-latex-instant-preview-mode) "org-latex-instant-preview" nil t)) (add-hook (quote org-mode-hook) (function org-latex-instant-preview-mode))))
eval((progn (progn (if (and quelpa-use-package-inhibit-loading-quelpa (package-installed-p (quote org-latex-instant-preview))) nil (apply (quote quelpa) (quote ((org-latex-instant-preview :fetcher github :repo "yangsheng6810/org-latex-instant-preview"))))) (if (fboundp (quote org-latex-instant-preview-mode)) nil (autoload (function org-latex-instant-preview-mode) "org-latex-instant-preview" nil t)) (add-hook (quote org-mode-hook) (function org-latex-instant-preview-mode)))) t)
elisp--eval-last-sexp(nil)
#f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation.\nInteger values are printed in several formats (decimal, octal,\nand hexadecimal). When the prefix argument is -1 or the value\ndoesn't exceed `eval-expression-print-maximum-character', an\ninteger value is also printed as a character of that codepoint.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400df5fb>)(nil)
#f(compiled-function (&rest _it) #<bytecode 0x40f33159>)()
eval-sexp-fu-flash-doit-simple(#f(compiled-function (&rest _it) #<bytecode 0x40f33159>) #f(compiled-function (&rest args2) #<bytecode 0x44d1b44d>) #f(compiled-function (&rest args2) #<bytecode 0x44d1b46d>))
eval-sexp-fu-flash-doit(#f(compiled-function (&rest _it) #<bytecode 0x40f33159>) #f(compiled-function (&rest args2) #<bytecode 0x44d1b44d>) #f(compiled-function (&rest args2) #<bytecode 0x44d1b46d>))
esf-flash-doit(#f(compiled-function (&rest _it) #<bytecode 0x40f33159>) #f(compiled-function (&rest args2) #<bytecode 0x44d1b44d>) #f(compiled-function (&rest args2) #<bytecode 0x44d1b46d>) #f(compiled-function (&rest args2) #<bytecode 0x44d1b7a1>))
ad-Advice-eval-last-sexp(#f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation.\nInteger values are printed in several formats (decimal, octal,\nand hexadecimal). When the prefix argument is -1 or the value\ndoesn't exceed `eval-expression-print-maximum-character', an\ninteger value is also printed as a character of that codepoint.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400df5fb>) nil)
apply(ad-Advice-eval-last-sexp #f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation.\nInteger values are printed in several formats (decimal, octal,\nand hexadecimal). When the prefix argument is -1 or the value\ndoesn't exceed `eval-expression-print-maximum-character', an\ninteger value is also printed as a character of that codepoint.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400df5fb>) nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
emacs 29 / mingw64 / windows 11
It was working nicely since I reinstalled some components. The process is active and working but
nothing more shows up except a small white square. In the *Messages*
buffer, each time I try to preview,
I get the following error report :
Error parsing SVG image: XML parse error: Error domain 1 code 4 on line 1 column 1 of data: Start tag expected, '<' not found [13 times]
It seems there are some errors in the produced svg. What can I do ?
Regards
With recent packages update, I noticed that whenever the cursor enters in a math environment, the major mode
changes from orgmode to latex/MPS. This seems to break the org-latex-impatient
previews.
\begin{equation} <= works if cursor on this line
a = b +c <= does not work whatever you type
\end{equation} <= also works when cursor on this line
I tried to add this :
(use-package org-latex-impatient
:defer t
:hook
(org-mode . org-latex-impatient-mode)
(LaTeX-math-mode . org-latex-impatient-mode)
(LaTeX-mode . org-latex-impatient-mode)
to the org-latex-impatient
config, but this does nothing.
How could I reenable the previews as you type within math environments ?
Regards
Hi,
Thanks for creating this package! The basic usage works perfectly for me. I went further to try to include the physics package, following readme, with the config
(setq org-latex-impatient-user-latex-definitions
'("\\usepackage{physics}"
"\\newcommand{\\ensuremath}[1]{#1}"
"\\renewcommand{\\usepackage}[2][]{}"))
but got TeX parse error: Undefined control sequence \usepackage. As indicated in readme, Mathjax does not support the usepackage command, so any way to include the raw usepackage
would seem to fail. So I think that the related example in the readme is somewhat misleading.
Okay, so by default.. they preview is giant. If I change the scale to 0.5, it disappears. Any thoughts?
(use-package org-latex-impatient
:defer t
:hook org-mode
:ensure-system-package ((tex2svg . "npm install -g mathjax-node-cli"))
:config
(setq org-latex-impatient-tex2svg-bin "/usr/local/bin/tex2svg"
org-latex-impatient-scale 0.5))
The box in the middle is the preview pane
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.