Re: [O] Latex preview foreground color problem
Eric S Fraga writes: > On Monday, 30 Jul 2018 at 12:43, Jarmo Hurri wrote: >> In my emacs config file I now have: >> >> (plist-put org-format-latex-options :foreground "white") >> (plist-put org-format-latex-options :scale 2) > > This works for me but in the context that I also change the background > to black (which does not necessarily match my Emacs background...). Try > that just to see? It may be a LaTeX issue. This seems to be a compatibility issue with the forest package in Latex. The problem is demonstrated and explained in the org file below. I don't know yet what the solution is. Jarmo # - #+LATEX_HEADER: \usepackage{forest} * \LaTeX{} fragments: package ~forest~ confuses foreground color setting Interestingly enough, the foreground color set by #+BEGIN_SRC elisp (plist-put org-format-latex-options :foreground "White") #+END_SRC does /not/ change the foreground color in this simple invariant equation \[ ab^n = ab\cdot b^{n-1} \] if ~usepackage{forest}~ is included in \LaTeX{} header. When package ~forest~ is not used, setting the color works just fine. To make things a bit more complicated, after commenting or uncommenting the ~LATEX_HEADER~ line, you need to remove the contents of directory ~ltximg~ in the working directory to see the difference, because the system caches the generated images of the equations there.
Re: [O] Latex preview foreground color problem
Hello, Here is mine. But I live with a black background. You might have trouble with the table environment though. For some mysterious reason, although the background changes,the foreground in the table environment remains black. (setq org-format-latex-options '(:foreground "White" :background "Black" :scale 1.8 :html-foreground "Black" :html-background "Transparent" :html-scale 1.1 )) HTH, Jeremie
Re: [O] Latex preview foreground color problem
On Monday, 30 Jul 2018 at 12:43, Jarmo Hurri wrote: > In my emacs config file I now have: > > (plist-put org-format-latex-options :foreground "white") > (plist-put org-format-latex-options :scale 2) This works for me but in the context that I also change the background to black (which does not necessarily match my Emacs background...). Try that just to see? It may be a LaTeX issue. -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545
[O] Latex preview foreground color problem
Greetings. Previewing Latex fragments is one cool feature. However, I have one problem tailoring it to my use. In my emacs config file I now have: (plist-put org-format-latex-options :foreground "white") (plist-put org-format-latex-options :scale 2) These seem to set the correct properties, because my value of org-format-latex-options is (:foreground "white" :background default :scale 2 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")) The scale factor property works just fine: I get a larger preview. Unfortunately changing foreground has no effect. The default black foreground - which I still get - is pretty useless for me, because my default background in buffers is dark blue. Any tips? Jarmo
Re: [O] latex preview table environment
Hello, Eric S Fragawrites: > When I switched my colour theme to one with a dark background, I found I > had to set org-format-latex-options to > > '(:background default :foreground default) > '(:background default :foreground default) work for be as well. > actually specifying colours did not seem to work for me. I had as far as I can tell the following setting works for me. but I need to remove the table environment for the foreground to turn blue (in this case). may be modifying the table after changing the color might help. I always fall in this trap. (setq org-format-latex-options '(:foreground "blue" :background "gray" :scale 1.4)) \begin{table} \begin{center} \begin{tabular}{ | l | c | r } \hline 1 & 2 & 3 \\ \hline 4 & 5 & 6 \\ \hline 7 & 8 & 9 \\ \hline \end{tabular} \end{center} \end{table} Best wishes, Jeremie
Re: [O] latex preview table environment
On Saturday, 18 Feb 2017 at 07:25, Jeremie Juste wrote: > I found the culprit. > > I have set my background color to black and forground color to white. > > Yet when I adust the org-format-latex-options to see the preview white > on black, the tabular environment displays the expected color setting > but not the table environment. When I switched my colour theme to one with a dark background, I found I had to set org-format-latex-options to '(:background default :foreground default) actually specifying colours did not seem to work for me. -- : Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.4-242-g2c27b8 signature.asc Description: PGP signature
Re: [O] latex preview table environment
I found the culprit. I have set my background color to black and forground color to white. Yet when I adust the org-format-latex-options to see the preview white on black, the tabular environment displays the expected color setting but not the table environment. So far I can only change the background color to preview the table environment but not the foreground color. I'll try to find a solution and come back if I do. In the meantime any idea to fix this issue is welcome :-). Below are the settings with which I hope you could reproduce this phenomenon. (set-background-color "black") (set-foreground-color "white") (setq org-format-latex-options '(:foreground "white" :background "black" :scale 1.4 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin{.*[^table]}" "end{.*[^le]}" "$1" "$" "$$" "\\(" "\\["))) Thanks again, Jeremie
Re: [O] latex preview table environment
Hello, Thanks for replying > For me, the preview shows both tables. My org-preview-latex-default-process > is set to imagemagick. my org-preview-latex-default-process variable is set to imagemagick as well. Interesting..., I wonder why the tabular would work but not the table environment
Re: [O] latex preview table environment
Jeremie Justewrites: > Hello, > > I would like to preview easily latex table environment. I noticed that > org-toggle-latex-fragment shows the latex-preview for the tabular > environment but not for the table environment. > For me, the preview shows both tables. My org-preview-latex-default-process is set to imagemagick. > > \begin{center} > > \begin{tabular}{ l | c | r } > > \hline > > 1 & 2 & 3 \\ \hline > 4 & 5 & 6 \\ \hline > 7 & 8 & 9 \\ > > \hline > > \end{tabular} > > \end{center} > > > > \begin{table} > \begin{center} > > \begin{tabular}{ l | c | r } > > \hline > > 1 & 2 & 3 \\ \hline > 4 & 5 & 6 \\ \hline > 7 & 8 & 9 \\ > > \hline > > \end{tabular} > > \end{center} > \end{table} > -- Nick
[O] latex preview table environment
Hello, I would like to preview easily latex table environment. I noticed that org-toggle-latex-fragment shows the latex-preview for the tabular environment but not for the table environment. Would it be possible to find a to do that? I tried to tweak org-latex-options in the following way in the hope that the org-format latex would use only the tabular environment but it did not work as expected. (setq org-format-latex-options '(:foreground default :background default :scale 1.4 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin{.*[^table]}" "end{.*[^le]}" "$1" "$" "$$" "\\(" "\\["))) Do you have any suggestions? Best wishes, Jeremie \begin{center} \begin{tabular}{ l | c | r } \hline 1 & 2 & 3 \\ \hline 4 & 5 & 6 \\ \hline 7 & 8 & 9 \\ \hline \end{tabular} \end{center} \begin{table} \begin{center} \begin{tabular}{ l | c | r } \hline 1 & 2 & 3 \\ \hline 4 & 5 & 6 \\ \hline 7 & 8 & 9 \\ \hline \end{tabular} \end{center} \end{table}
Re: [O] Latex Preview Fragment is not working on org 9.0.3 from elpa
Thank you, and, could you let me know what version would be gotten this fix, please? On Sat, Jan 21, 2017 at 2:59 AM, Nicolas Goaziouwrote: > Hello, > > Young-whan writes: > > > Looks like it is a bug? Why it is not loaded automatically while 8.2 has > no > > issue? > > Fixed. Thank you. > > Regards, > > -- > Nicolas Goaziou >
Re: [O] Latex Preview Fragment is not working on org 9.0.3 from elpa
Hello, Young-whanwrites: > Looks like it is a bug? Why it is not loaded automatically while 8.2 has no > issue? Fixed. Thank you. Regards, -- Nicolas Goaziou
Re: [O] Latex Preview Fragment is not working on org 9.0.3 from elpa
Looks like it is a bug? Why it is not loaded automatically while 8.2 has no issue? On Wed, Jan 18, 2017 at 12:56 PM, Charles C. Berrywrote: > On Wed, 18 Jan 2017, Young-whan wrote: > > I've installed the emacs-app via port, and there was no problem with Latex >> Preview Fragment in a buffer at all. >> >> Now, using the M-x package-list-packages, I've installed the latest org >> 9.0.3, then the latex preview is not working at all. >> >> It comes with following error: >> >> org-create-formula--latex-header: Symbol’s function definition is void: >> org-export-get-backendError during redisplay: (eval (mode-line-mode-name)) >> signaled (void-function mode-line-mode-name) >> > > That is because `org-export-get-backend' is not loaded (nor autoloaded). > > You can type C-c C-e q to force loading of the org-export-* functions. Or > put (require 'ox) in your init file. > > I don't see why `org-export-get-backend' is lacking an autoload directive. > > Bug?? > > Chuck >
Re: [O] Latex Preview Fragment is not working on org 9.0.3 from elpa
On Wed, 18 Jan 2017, Young-whan wrote: I've installed the emacs-app via port, and there was no problem with Latex Preview Fragment in a buffer at all. Now, using the M-x package-list-packages, I've installed the latest org 9.0.3, then the latex preview is not working at all. It comes with following error: org-create-formula--latex-header: Symbol’s function definition is void: org-export-get-backendError during redisplay: (eval (mode-line-mode-name)) signaled (void-function mode-line-mode-name) That is because `org-export-get-backend' is not loaded (nor autoloaded). You can type C-c C-e q to force loading of the org-export-* functions. Or put (require 'ox) in your init file. I don't see why `org-export-get-backend' is lacking an autoload directive. Bug?? Chuck
[O] Latex Preview Fragment is not working on org 9.0.3 from elpa
I've installed the emacs-app via port, and there was no problem with Latex Preview Fragment in a buffer at all. Now, using the M-x package-list-packages, I've installed the latest org 9.0.3, then the latex preview is not working at all. It comes with following error: org-create-formula--latex-header: Symbol’s function definition is void: org-export-get-backendError during redisplay: (eval (mode-line-mode-name)) signaled (void-function mode-line-mode-name) The version I'm working on is like this: Org mode version 9.0.3 (9.0.3-elpa @ /Users/ysong/.emacs.d/elpa/org-20161224/) GNU Emacs 25.1.1 (x86_64-apple-darwin16.5.0, NS appkit-1504.82 Version 10.12.4 (Build 16E138)) of 2017-01-09 Is this known bug or is there something I need to do more?
[O] latex preview in latex block
Hello, > > Jérémie Justewrites: > >> Is it possible to activate the latex preview in org-mode within in latex >> bloc? Nicolas Goaziou writes: > > It isn't possible out of the box. Org doesn't look at the contents of > src blocks, which are supposed to be written in a foreign language. > > However, you can probably write a function for your own use, starting > from `org-format-latex'. > > Regards, Actually, there is a simpler way of previewing the latex code from the output of a babel source block. We just need to specify :results output raw. For example #+begin_src R :results output raw #+end_src Best regards Jeremie Juste
Re: [O] latex preview in latex block
Nicolas Goaziouwrites: > Hello, > > Jérémie Juste writes: > >> Is it possible to activate the latex preview in org-mode within in latex >> bloc? > > It isn't possible out of the box. Org doesn't look at the contents of > src blocks, which are supposed to be written in a foreign language. > > However, you can probably write a function for your own use, starting > from `org-format-latex'. > > Regards, Thanks for the lead, I'll give it a try post the code back here if it works. Best regards, Jeremie
Re: [O] latex preview in latex block
Hello, Jérémie Justewrites: > Is it possible to activate the latex preview in org-mode within in latex > bloc? It isn't possible out of the box. Org doesn't look at the contents of src blocks, which are supposed to be written in a foreign language. However, you can probably write a function for your own use, starting from `org-format-latex'. Regards, -- Nicolas Goaziou
[O] latex preview in latex block
Hello, Is it possible to activate the latex preview in org-mode within in latex bloc? My idea was to comment the table when I get the output. I noticed also that preview does not work with the table environment but works fine with the tablular environment. This does not work #+BEGIN_SRC Latex \begin{align*} y = x^2 \end{align*} #+END_SRC This fragment works fine. \begin{align*} y = x^2 \end{align*} Best regards -- Jeremie Juste
[O] Latex Preview Equations(with C-u C-u)
Recently the latex preview equation in org-mode was improved. Particularly 'C-c C-c' no longer removes the latex equations overlays, and now we have a single function, org-toggle-latex-fragment, to create/remove the image and overlays. I think these changes were very good. One small inconvenient, however, is that I usually pass two prefix arguments, 'C-u C-u', to org-toggle-latex-fragment to render everything in the buffer. If I add a new equation and then call org-toggle-latex-fragment again with 'C-u C-u' org-mode will simply remove the overlays. This was not a problem when there was a single function that only created overlays and another to remove them. I think having a 'toggle function' is better, but if the user passes two prefix arguments he wants to render everything in the buffer, even if there are already equations overlays in the buffer. Could org-mode be changed to behave like that? -- Darlan Cavalcante Moreira
Re: [O] LaTeX preview
Hi Greg, Daimrod daim...@gmail.com writes: Here is a better formatted patch: I applied this change, thanks a lot! -- Bastien
Re: [O] LaTeX preview
+1 This is great, I wanted to do something but did not know how. I am going to look at the patch. If you have an interest in explaining to an interested Noob what you did. I would be grateful. Best, Evan On Thu, Feb 14, 2013 at 3:17 AM, Bastien b...@altern.org wrote: Hi Greg, Daimrod daim...@gmail.com writes: Here is a better formatted patch: I applied this change, thanks a lot! -- Bastien -- Evan Misshula Doctoral Student (Criminal Justice) CUNY John Jay Let us reform our schools, and we shall find little reform needed in our prisons. John Ruskin, Unto This Last, essay 2 (1862) English critic, essayist, reformer (1819 - 1900) Instruction does much, but encouragement does everything. Johann Wolfgang Von Goethe www.snrg-nyc.org
Re: [O] LaTeX preview
Evan Misshula evanmissh...@gmail.com writes: +1 This is great, I wanted to do something but did not know how. I am going to look at the patch. I'm glad to know other people like it too :) If you have an interest in explaining to an interested Noob what you did. I would be grateful. Sure, I knew I wanted something like the inlineimages STARTUP keywords. So, I've searched in the source all references to inlineimages. M-x moccur-grep RET inlineimages RET I've found: a custom variable: `org-startup-with-line-images' an entry in `org-startup-options' Then I've searched for `org-startup-with-inline-images' and found: (when org-startup-with-inline-images (org-display-inline-images)) Then, I've searched the name of the function which toggled the latex preview. C-h a latex RET then C-s preview in the *Apropos* buffer. At this point I had everything and I just needed to copy what was done for inlineimages and adapt it for latexpreview. Best, Evan -- Daimrod/Greg pgpj9253qHCTK.pgp Description: PGP signature
Re: [O] LaTeX preview
Daimrod daim...@gmail.com writes: Bastien b...@altern.org writes: Hi Daimrod, Daimrod daim...@gmail.com writes: Is there an #+STARTUP parameter to automatically display LaTeX fragments? Nope, sorry. Here is a patch to add `org-startup-with-latex-preview'. It should work like `org-startup-with-inline-images'. Here is a better formatted patch: From 63cd29b1d5b0c5758870a14ac3257e69d4560925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= gregoire.j...@gmail.com Date: Thu, 24 Jan 2013 14:02:00 +0100 Subject: [PATCH] Add a new startup keyword to preview LaTeX fragments * doc/org.texi (Previewing @LaTeX{} fragments): Document the startup keywords which can be used to preview or not LaTeX fragments. (Summary of in-buffer settings): Improve formatting and add an entry for the variable `org-startup-with-latex-preview'. * org.el (org-mode, org-startup-options, org-startup-with-inline-images): Add the variable `org-startup-with-latex-preview' which can be used to preview LaTeX fragments on startup. This variable is set to `nil' by default. --- doc/org.texi | 32 lisp/org.el | 14 ++ 2 files changed, 46 insertions(+) diff --git a/doc/org.texi b/doc/org.texi index 37c7ac5..43a89ca 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -9758,6 +9758,19 @@ some aspects of the preview. In particular, the @code{:scale} (and for HTML export, @code{:html-scale}) property can be used to adjust the size of the preview images. +@vindex org-startup-with-latex-preview +You can turn on the previewing of all @LaTeX{} fragments in a file with + +@example +#+STARTUP: latexpreview +@end example + +To disable it, simply use + +@example +#+STARTUP: nolatexpreview +@end example + @node CDLaTeX mode, , Previewing @LaTeX{} fragments, Embedded @LaTeX{} @subsection Using CD@LaTeX{} to enter math @cindex CD@LaTeX{} @@ -14955,6 +14968,18 @@ inlineimages @r{show inline images} noinlineimages @r{don't show inline images on startup} @end example +@vindex org-startup-with-latex-preview +When visiting a file, @LaTeX{} fragments can be converted to images +automatically. The variable @code{org-startup-with-latex-preview} which +controls this behavior, is set to @code{nil} by default to avoid delays on +startup. +@cindex @code{latexpreview}, STARTUP keyword +@cindex @code{nolatexpreview}, STARTUP keyword +@example +latexpreview @r{preview @LaTeX{} fragments} +nolatexpreview @r{don't preview @LaTeX{} fragments} +@end example + @vindex org-log-done @vindex org-log-note-clock-out @vindex org-log-repeat @@ -15005,6 +15030,7 @@ nologdrawer @r{store log outside of drawer} logstatesreversed @r{reverse the order of states notes} nologstatesreversed @r{do not reverse the order of states notes} @end example + @vindex org-hide-leading-stars @vindex org-odd-levels-only Here are the options for hiding leading stars in outline headings, and for @@ -15023,6 +15049,7 @@ noindent @r{no virtual indentation according to outline level} odd@r{allow only odd outline levels (1,3,...)} oddeven@r{allow all outline levels} @end example + @vindex org-put-time-stamp-overlays @vindex org-time-stamp-overlay-formats To turn on custom format overlays over timestamps (variables @@ -15032,6 +15059,7 @@ To turn on custom format overlays over timestamps (variables @example customtime @r{overlay custom time format} @end example + @vindex constants-unit-system The following options influence the table spreadsheet (variable @code{constants-unit-system}). @@ -15041,6 +15069,7 @@ The following options influence the table spreadsheet (variable constcgs @r{@file{constants.el} should use the c-g-s unit system} constSI@r{@file{constants.el} should use the SI unit system} @end example + @vindex org-footnote-define-inline @vindex org-footnote-auto-label @vindex org-footnote-auto-adjust @@ -15067,6 +15096,7 @@ fnplain @r{create @code{[1]}-like labels automatically} fnadjust@r{automatically renumber and sort footnotes} nofnadjust @r{do not renumber and sort automatically} @end example + @cindex org-hide-block-startup To hide blocks on startup, use these keywords. The corresponding variable is @code{org-hide-block-startup}. @@ -15076,6 +15106,7 @@ To hide blocks on startup, use these keywords. The corresponding variable is hideblocks @r{Hide all begin/end blocks on startup} nohideblocks @r{Do not hide blocks on startup} @end example + @cindex org-pretty-entities The display of entities as UTF-8 characters is governed by the variable @code{org-pretty-entities} and the keywords @@ -15085,6 +15116,7 @@ The display of entities as UTF-8 characters is governed by the variable entitiespretty @r{Show entities as UTF-8 characters where possible} entitiesplain @r{Leave entities plain} @end example + @item #+TAGS: TAG1(c1) TAG2(c2) @vindex org-tag-alist These lines (several such lines are allowed) specify the valid
[O] LaTeX preview
Hi, Is there an #+STARTUP parameter to automatically display LaTeX fragments? If not, where do I have to look to add it? -- Daimrod/Greg pgpwOUfDZhYGv.pgp Description: PGP signature
Re: [O] LaTeX preview
Hi Daimrod, Daimrod daim...@gmail.com writes: Is there an #+STARTUP parameter to automatically display LaTeX fragments? Nope, sorry. -- Bastien
Re: [O] LaTeX preview
Bastien b...@altern.org writes: Hi Daimrod, Daimrod daim...@gmail.com writes: Is there an #+STARTUP parameter to automatically display LaTeX fragments? Nope, sorry. Here is a patch to add `org-startup-with-latex-preview'. It should work like `org-startup-with-inline-images'. diff --git a/doc/org.texi b/doc/org.texi index 030eaf8..a13d565 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -9752,6 +9752,19 @@ some aspects of the preview. In particular, the @code{:scale} (and for HTML export, @code{:html-scale}) property can be used to adjust the size of the preview images. +@vindex org-startup-with-latex-preview +You can turn on the previewing of all @LaTeX{} fragments of a file with + +@example +#+STARTUP: latexpreview +@end example + +To disable it, simply use + +@example +#+STARTUP: nolatexpreview +@end example + @node CDLaTeX mode, , Previewing @LaTeX{} fragments, Embedded @LaTeX{} @subsection Using CD@LaTeX{} to enter math @cindex CD@LaTeX{} diff --git a/lisp/org.el b/lisp/org.el index effb231..2e7f3a4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -580,6 +580,16 @@ the following lines anywhere in the buffer: :version 24.1 :type 'boolean) +(defcustom org-startup-with-latex-preview nil + Non-nil means preview LaTeX fragments when loading a new Org file. + +This can also be configured on a per-file basis by adding one of +the followinglines anywhere in the buffer: + #+STARTUP: latexpreview + #+STARTUP: nolatexpreview + :group 'org-startup + :type 'boolean) + (defcustom org-insert-mode-line-in-empty-file nil Non-nil means insert the first line setting Org-mode in empty files. When the function `org-mode' is called interactively in an empty file, this @@ -4509,6 +4519,8 @@ After a match, the following groups carry important information: (noalign org-startup-align-all-tables nil) (inlineimages org-startup-with-inline-images t) (noinlineimages org-startup-with-inline-images nil) +(latexpreview org-startup-with-latex-preview t) +(nolatexpreview org-startup-with-latex-preview nil) (customtime org-display-custom-times t) (logdone org-log-done time) (lognotedone org-log-done note) @@ -5154,6 +5166,8 @@ The following commands are available: (set-buffer-modified-p bmp))) (when org-startup-with-inline-images (org-display-inline-images)) +(when org-startup-with-latex-preview + (org-preview-latex-fragment)) (when org-startup-indented (require 'org-indent) (org-indent-mode 1)) -- Daimrod/Greg pgpgs1Ek3Eswb.pgp Description: PGP signature
Re: [O] LaTeX preview
Hi, Daimrod daim...@gmail.com writes: Here is a patch to add `org-startup-with-latex-preview'. It should work like `org-startup-with-inline-images'. Thanks for the patch. Did you already sign a FSF copyright assignment or do you plan to sign one? http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt I cannot apply/accept the patch otherwise :( Thanks, -- Bastien
Re: [O] LaTeX preview
Bastien b...@altern.org writes: Hi, Daimrod daim...@gmail.com writes: Here is a patch to add `org-startup-with-latex-preview'. It should work like `org-startup-with-inline-images'. Thanks for the patch. Did you already sign a FSF copyright assignment or do you plan to sign one? http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt I cannot apply/accept the patch otherwise :( Thanks, I've sent a request. I will tell you when it's done, I hope this won't take too much time. -- Daimrod/Greg pgpKi4EPvKFx2.pgp Description: PGP signature
Re: [O] LaTeX preview
Daimrod daim...@gmail.com writes: I've sent a request. I will tell you when it's done, I hope this won't take too much time. Thanks!! -- Bastien