From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daimrod Subject: Re: LaTeX preview Date: Thu, 24 Jan 2013 14:07:48 +0100 Message-ID: <87pq0uloez.fsf@casa.home> References: <87a9sg9fd6.fsf@casa.home> <87sj67hpxm.fsf@bzg.ath.cx> <87obgvvnlj.fsf@casa.home> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyMVM-0005ca-6B for emacs-orgmode@gnu.org; Thu, 24 Jan 2013 08:06:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TyMVG-0007ee-Kc for emacs-orgmode@gnu.org; Thu, 24 Jan 2013 08:06:08 -0500 Received: from mail-lb0-f179.google.com ([209.85.217.179]:59829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyMVG-0007ea-7c for emacs-orgmode@gnu.org; Thu, 24 Jan 2013 08:06:02 -0500 Received: by mail-lb0-f179.google.com with SMTP id j14so2394821lbo.10 for ; Thu, 24 Jan 2013 05:06:01 -0800 (PST) In-Reply-To: <87obgvvnlj.fsf@casa.home> (daimrod@gmail.com's message of "Fri, 11 Jan 2013 14:46:48 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Daimrod writes: > Bastien writes: > >> Hi Daimrod, >> >> Daimrod 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: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-a-new-startup-keyword-to-preview-LaTeX-fragments.patch Content-Transfer-Encoding: quoted-printable From=2063cd29b1d5b0c5758870a14ac3257e69d4560925 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Gr=3DC3=3DA9goire=3D20Jadi?=3D 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. =2D-- 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 =2D-- a/doc/org.texi +++ b/doc/org.texi @@ -9758,6 +9758,19 @@ some aspects of the preview. In particular, the @co= de{:scale} (and for HTML export, @code{:html-scale}) property can be used to adjust the size of the preview images. =20 +@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 =20 +@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 o= utline 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 spreadshe= et (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 automa= tically} 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 gove= rned 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 tags in diff --git a/lisp/org.el b/lisp/org.el index 45842d5..731e116 100644 =2D-- a/lisp/org.el +++ b/lisp/org.el @@ -582,6 +582,16 @@ the following lines anywhere in the buffer: :version "24.1" :type 'boolean) =20 +(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 @@ -4511,6 +4521,8 @@ After a match, the following groups carry important i= nformation: ("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) @@ -5156,6 +5168,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)) =2D-=20 1.7.10.4 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 Daimrod/Greg --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJRATIlAAoJEBNzVHcrZRiU3TcP+gLbykGBsD6PCMCGhh7PP5gI CEldDuN0670gOPlCCx1n5HfGeJ7QYiDBWZO1laJ9dascVBfX0oTRaZwmUo+iNeVc YacUlAuNkYUnPnER7Ynyoj+QionYVevvmYvioaQirdS44OuyQESWuuICNt62H1MW GSVYKo13aTPqAbkqtjf2z+NZxCwHNbe5BesEjpNd6RQZpDJ+F0viMzrfSLIPmLlc H+Gg8t9HilFEKi2sdbu/XsG2zu+18BovxE906s6zfIm/W6GG5i3EBiepUCsDasRi n0ExNRbIT5RSUhDE6srRJGYSJzrvfMV20oSddGN7dr3YoMeCx50lgjZ+P2gvnDKk le1rc4+lwpVe6An1Poxh5G23hcp1NaN5SIA7wV22UCZSiB+tfe7UmwBb/nU9Z4on Be8FD1M86BeI0uU/d92dX9QIeyameU0vD/xb0nIha663ADdJh3r9kJJ4/zXBj8YJ Gtsi79z+gG+LRRbaxhVnXlf0jTcTw94xD8JjHoZgkxNVPiARXp8HRo0pCtHPmnDf /0u7aT5sxC3sW4kYkNQYdRkRi9gPt8ossrziMN5/YzVRviBq5r57aYgTy4lOtvgb xCDtgBTkBQNNcJdHxZd1wo2fLAHbKmvbjWnu/Asghdhz9uFxgknUP0r82W0UAApH J0yGhxcwjXY43VxLjyFo =tft8 -----END PGP SIGNATURE----- --==-=-=--