From: Daimrod <daimrod@gmail.com>
To: Bastien <bzg@altern.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: LaTeX preview
Date: Fri, 11 Jan 2013 14:46:48 +0100 [thread overview]
Message-ID: <87obgvvnlj.fsf@casa.home> (raw)
In-Reply-To: <87sj67hpxm.fsf@bzg.ath.cx> (Bastien's message of "Fri, 11 Jan 2013 13:20:05 +0100")
[-- Attachment #1.1: Type: text/plain, Size: 300 bytes --]
Bastien <bzg@altern.org> writes:
> Hi Daimrod,
>
> Daimrod <daimrod@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'.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: org-startup-with-latex-preview.patch --]
[-- Type: text/x-diff, Size: 2320 bytes --]
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))
[-- Attachment #1.3: Type: text/plain, Size: 21 bytes --]
--
Daimrod/Greg
[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]
next prev parent reply other threads:[~2013-01-11 13:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 10:35 LaTeX preview Daimrod
2013-01-11 12:20 ` Bastien
2013-01-11 13:46 ` Daimrod [this message]
2013-01-11 16:23 ` Bastien
2013-01-11 16:47 ` Daimrod
2013-01-11 16:53 ` Bastien
2013-01-24 13:07 ` Daimrod
2013-02-14 8:17 ` Bastien
2013-02-14 13:03 ` Evan Misshula
2013-02-14 16:56 ` Daimrod
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87obgvvnlj.fsf@casa.home \
--to=daimrod@gmail.com \
--cc=bzg@altern.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).