* Prevent Org timestamps breaking with paragraph fill? @ 2010-05-05 0:21 Jeff Kowalczyk 2010-05-14 7:18 ` Carsten Dominik 0 siblings, 1 reply; 10+ messages in thread From: Jeff Kowalczyk @ 2010-05-05 0:21 UTC (permalink / raw) To: emacs-orgmode I sometimes use Org timestamps in the body text of a headline. The timestamps break when filling with M-q. Is there a way to prevent this, i.e. Org timestamps as non-breaking words? Thanks. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Prevent Org timestamps breaking with paragraph fill? 2010-05-05 0:21 Prevent Org timestamps breaking with paragraph fill? Jeff Kowalczyk @ 2010-05-14 7:18 ` Carsten Dominik 2010-06-17 7:23 ` Verbatim LaTeX inside delimiters in HTML export with jsMath? Christian Moe 0 siblings, 1 reply; 10+ messages in thread From: Carsten Dominik @ 2010-05-14 7:18 UTC (permalink / raw) To: Jeff Kowalczyk; +Cc: emacs-orgmode On May 5, 2010, at 2:21 AM, Jeff Kowalczyk wrote: > I sometimes use Org timestamps in the body text of a headline. The > timestamps > break when filling with M-q. > > Is there a way to prevent this, i.e. Org timestamps as non-breaking > words? Hi Jeff, unfortunately, there is no way to avoid this currently. I guess the best is to put the timestamps early in the headline, or put them into the body of the entry. - Carsten ^ permalink raw reply [flat|nested] 10+ messages in thread
* Verbatim LaTeX inside delimiters in HTML export with jsMath? 2010-05-14 7:18 ` Carsten Dominik @ 2010-06-17 7:23 ` Christian Moe 2010-06-18 7:25 ` Carsten Dominik 0 siblings, 1 reply; 10+ messages in thread From: Christian Moe @ 2010-06-17 7:23 UTC (permalink / raw) To: emacs-orgmode Hi, To display LaTeX math in Org html export with lovely jsMath, it must be exported verbatim with #+OPTIONS: ^:nil TeX:nil so one cannot use lazy superscripts/subscripts or Org entities in the rest of the text. Is there a simple way to turn these options on, but protect LaTeX where it appears *inside math delimiters* so it's exported verbatim? I.e. inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ? I ask because I'm keeping a note file with much text and only a few equations, but with frequent reference to e.g. CO_2 and m^2. It's possible to always write $CO_2$ and $m^2$, but less readable, and irksome when you've got used to an easier way. An inline formula can be protected by surrounding it with verbatim markup, =$...$=, but then it's only good for jsMath, not for LaTeX export. Yours, Christian ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Verbatim LaTeX inside delimiters in HTML export with jsMath? 2010-06-17 7:23 ` Verbatim LaTeX inside delimiters in HTML export with jsMath? Christian Moe @ 2010-06-18 7:25 ` Carsten Dominik 2010-06-18 10:58 ` Christian Moe 0 siblings, 1 reply; 10+ messages in thread From: Carsten Dominik @ 2010-06-18 7:25 UTC (permalink / raw) To: mail; +Cc: emacs-orgmode Hi Christian, how should, in this case, a literal LaTeX environment like \begin{equation} a=b \end{equation} be handled? - Carsten On Jun 17, 2010, at 9:23 AM, Christian Moe wrote: > Hi, > > To display LaTeX math in Org html export with lovely jsMath, it must > be > exported verbatim with > > #+OPTIONS: ^:nil TeX:nil > > so one cannot use lazy superscripts/subscripts or Org entities in > the rest of the text. > > Is there a simple way to turn these options on, but protect LaTeX > where > it appears *inside math delimiters* so it's exported verbatim? I.e. > inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ? > > I ask because I'm keeping a note file with much text and only a few > equations, but with frequent reference to e.g. CO_2 and m^2. It's > possible to always write $CO_2$ and $m^2$, but less readable, and > irksome when you've got used to an easier way. An inline formula can > be protected by surrounding it with verbatim markup, =$...$=, but > then it's only good for jsMath, not for LaTeX export. > > Yours, > Christian > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Verbatim LaTeX inside delimiters in HTML export with jsMath? 2010-06-18 7:25 ` Carsten Dominik @ 2010-06-18 10:58 ` Christian Moe 2010-06-25 10:06 ` Carsten Dominik 0 siblings, 1 reply; 10+ messages in thread From: Christian Moe @ 2010-06-18 10:58 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode Hi, Carsten, Thanks for taking a look. Your example should be output exactly the same as it is currently with the =LaTeX:nil= option, i. e. verbatim: <p> \begin{equation} a=b \end{equation} </p> - and this minimal example could be interpreted by jsMath without any changes in Org-mode export, since it happens to contain no sub/superscripts or entities. What I'd like is for \begin{equation} \e=mc^2 \end{equation} to be output equally verbatim as <p> \begin{equation} e=mc^2 \end{equation} </p> *even when =^:t= is on*, so I could freely write e.g. m^2 in the text and get it superscripted, but not get <p> \begin{equation} e=mc<sup>2</sup> \end{equation} </p> In other words, to have my cake and eat it, too. I hope it's clearer now. Yours, Christian Carsten Dominik wrote: > Hi Christian, > > how should, in this case, a literal LaTeX environment like > > \begin{equation} > a=b > \end{equation} > > be handled? > > - Carsten > > On Jun 17, 2010, at 9:23 AM, Christian Moe wrote: > >> Hi, >> >> To display LaTeX math in Org html export with lovely jsMath, it must be >> exported verbatim with >> >> #+OPTIONS: ^:nil TeX:nil >> >> so one cannot use lazy superscripts/subscripts or Org entities in the >> rest of the text. >> >> Is there a simple way to turn these options on, but protect LaTeX where >> it appears *inside math delimiters* so it's exported verbatim? I.e. >> inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ? >> >> I ask because I'm keeping a note file with much text and only a few >> equations, but with frequent reference to e.g. CO_2 and m^2. It's >> possible to always write $CO_2$ and $m^2$, but less readable, and >> irksome when you've got used to an easier way. An inline formula can >> be protected by surrounding it with verbatim markup, =$...$=, but then >> it's only good for jsMath, not for LaTeX export. >> >> Yours, >> Christian >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > - Carsten > > > > -- Christian Moe E-mail: mail@christianmoe.com Website: http://christianmoe.com Carsten Dominik wrote: > Hi Christian, > > how should, in this case, a literal LaTeX environment like > > \begin{equation} > a=b > \end{equation} > > be handled? > > - Carsten > > On Jun 17, 2010, at 9:23 AM, Christian Moe wrote: > >> Hi, >> >> To display LaTeX math in Org html export with lovely jsMath, it must be >> exported verbatim with >> >> #+OPTIONS: ^:nil TeX:nil >> >> so one cannot use lazy superscripts/subscripts or Org entities in the >> rest of the text. >> >> Is there a simple way to turn these options on, but protect LaTeX where >> it appears *inside math delimiters* so it's exported verbatim? I.e. >> inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ? >> >> I ask because I'm keeping a note file with much text and only a few >> equations, but with frequent reference to e.g. CO_2 and m^2. It's >> possible to always write $CO_2$ and $m^2$, but less readable, and >> irksome when you've got used to an easier way. An inline formula can >> be protected by surrounding it with verbatim markup, =$...$=, but then >> it's only good for jsMath, not for LaTeX export. >> >> Yours, >> Christian >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > - Carsten > > > > -- Christian Moe E-mail: mail@christianmoe.com Website: http://christianmoe.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Verbatim LaTeX inside delimiters in HTML export with jsMath? 2010-06-18 10:58 ` Christian Moe @ 2010-06-25 10:06 ` Carsten Dominik 2010-07-01 7:18 ` Christian Moe 0 siblings, 1 reply; 10+ messages in thread From: Carsten Dominik @ 2010-06-25 10:06 UTC (permalink / raw) To: mail; +Cc: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 354 bytes --] For John Wiegley: John, please do not yet apply the attached patch... Hi Christian, I am trying to get back to this issue. I am attaching a patch, please apply it to your setup and then try #+OPTIONS: ^:t TeX:t LaTeX:verbatim if that works, can I then ask you to update http://orgmode.org/worg/org-tutorials/org-jsmath.php ? Thanks! - Carsten [-- Attachment #2: jsmath.patch --] [-- Type: application/octet-stream, Size: 5678 bytes --] diff --git a/lisp/org-html.el b/lisp/org-html.el index 4a6ded4..d972c58 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -433,7 +433,8 @@ This may also be a function, building and inserting the postamble.") (concat "ltxpng/" (file-name-sans-extension (file-name-nondirectory org-current-export-file))) - org-current-export-dir nil "Creating LaTeX image %s")) + org-current-export-dir nil "Creating LaTeX image %s" + nil nil (eq (plist-get parameters :LaTeX-fragments) 'verbatim))) (goto-char (point-min)) (let (label l1) (while (re-search-forward "\\\\ref{\\([^{}\n]+\\)}" nil t) diff --git a/lisp/org.el b/lisp/org.el index 7bb4f45..52de945 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15699,7 +15699,8 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]." ("$$" "\\$\\$[^\000]*?\\$\\$" 0 nil)) "Regular expressions for matching embedded LaTeX.") -(defun org-format-latex (prefix &optional dir overlays msg at forbuffer) +(defun org-format-latex (prefix &optional dir overlays msg at + forbuffer protect-only) "Replace LaTeX fragments with links to an image, and produce images. Some of the options can be changed using the variable `org-format-latex-options'." @@ -15729,60 +15730,63 @@ Some of the options can be changed using the variable (not (eq (get-char-property (match-beginning n) 'org-overlay-type) 'org-latex-overlay)))) - (setq txt (match-string n) - beg (match-beginning n) end (match-end n) - cnt (1+ cnt)) - (let (print-length print-level) ; make sure full list is printed - (setq hash (sha1 (prin1-to-string - (list org-format-latex-header - org-format-latex-header-extra - org-export-latex-default-packages-alist - org-export-latex-packages-alist - org-format-latex-options - forbuffer txt))) - linkfile (format "%s_%s.png" prefix hash) - movefile (format "%s_%s.png" absprefix hash))) - (setq link (concat block "[[file:" linkfile "]]" block)) - (if msg (message msg cnt)) - (goto-char beg) - (unless checkdir ; make sure the directory exists - (setq checkdir t) - (or (file-directory-p todir) (make-directory todir))) - - (unless executables-checked - (org-check-external-command - "latex" "needed to convert LaTeX fragments to images") - (org-check-external-command - "dvipng" "needed to convert LaTeX fragments to images") - (setq executables-checked t)) - - (unless (file-exists-p movefile) - (org-create-formula-image - txt movefile opt forbuffer)) - (if overlays - (progn - (mapc (lambda (o) - (if (eq (overlay-get o 'org-overlay-type) - 'org-latex-overlay) - (delete-overlay o))) - (overlays-in beg end)) - (setq ov (make-overlay beg end)) - (overlay-put ov 'org-overlay-type 'org-latex-overlay) - (if (featurep 'xemacs) - (progn - (overlay-put ov 'invisible t) - (overlay-put - ov 'end-glyph - (make-glyph (vector 'png :file movefile)))) - (overlay-put - ov 'display - (list 'image :type 'png :file movefile :ascent 'center))) - (push ov org-latex-fragment-image-overlays) - (goto-char end)) - (delete-region beg end) - (insert (org-add-props link - (list 'org-latex-src - (replace-regexp-in-string "\"" "" txt))))))))))) + (if protect-only + (add-text-properties (match-beginning n) (match-end n) + '(org-protected t)) + (setq txt (match-string n) + beg (match-beginning n) end (match-end n) + cnt (1+ cnt)) + (let (print-length print-level) ; make sure full list is printed + (setq hash (sha1 (prin1-to-string + (list org-format-latex-header + org-format-latex-header-extra + org-export-latex-default-packages-alist + org-export-latex-packages-alist + org-format-latex-options + forbuffer txt))) + linkfile (format "%s_%s.png" prefix hash) + movefile (format "%s_%s.png" absprefix hash))) + (setq link (concat block "[[file:" linkfile "]]" block)) + (if msg (message msg cnt)) + (goto-char beg) + (unless checkdir ; make sure the directory exists + (setq checkdir t) + (or (file-directory-p todir) (make-directory todir))) + + (unless executables-checked + (org-check-external-command + "latex" "needed to convert LaTeX fragments to images") + (org-check-external-command + "dvipng" "needed to convert LaTeX fragments to images") + (setq executables-checked t)) + + (unless (file-exists-p movefile) + (org-create-formula-image + txt movefile opt forbuffer)) + (if overlays + (progn + (mapc (lambda (o) + (if (eq (overlay-get o 'org-overlay-type) + 'org-latex-overlay) + (delete-overlay o))) + (overlays-in beg end)) + (setq ov (make-overlay beg end)) + (overlay-put ov 'org-overlay-type 'org-latex-overlay) + (if (featurep 'xemacs) + (progn + (overlay-put ov 'invisible t) + (overlay-put + ov 'end-glyph + (make-glyph (vector 'png :file movefile)))) + (overlay-put + ov 'display + (list 'image :type 'png :file movefile :ascent 'center))) + (push ov org-latex-fragment-image-overlays) + (goto-char end)) + (delete-region beg end) + (insert (org-add-props link + (list 'org-latex-src + (replace-regexp-in-string "\"" "" txt)))))))))))) ;; This function borrows from Ganesh Swami's latex2png.el (defun org-create-formula-image (string tofile options buffer) [-- Attachment #3: Type: text/plain, Size: 4014 bytes --] On Jun 18, 2010, at 12:58 PM, Christian Moe wrote: > Hi, Carsten, > > Thanks for taking a look. > > Your example should be output exactly the same as it is currently > with the =LaTeX:nil= option, i. e. verbatim: > > <p> > \begin{equation} > a=b > \end{equation} > </p> > > - and this minimal example could be interpreted by jsMath without > any changes in Org-mode export, since it happens to contain no sub/ > superscripts or entities. > > What I'd like is for > > \begin{equation} > \e=mc^2 > \end{equation} > > to be output equally verbatim as > > <p> > \begin{equation} > e=mc^2 > \end{equation} > </p> > > *even when =^:t= is on*, so I could freely write e.g. m^2 in the > text and get it superscripted, but not get > > <p> > \begin{equation} > e=mc<sup>2</sup> > \end{equation} > </p> > > In other words, to have my cake and eat it, too. I hope it's clearer > now. > > Yours, > Christian > > > Carsten Dominik wrote: > > Hi Christian, > > > > how should, in this case, a literal LaTeX environment like > > > > \begin{equation} > > a=b > > \end{equation} > > > > be handled? > > > > - Carsten > > > > On Jun 17, 2010, at 9:23 AM, Christian Moe wrote: > > > >> Hi, > >> > >> To display LaTeX math in Org html export with lovely jsMath, it > must be > >> exported verbatim with > >> > >> #+OPTIONS: ^:nil TeX:nil > >> > >> so one cannot use lazy superscripts/subscripts or Org entities in > the > >> rest of the text. > >> > >> Is there a simple way to turn these options on, but protect LaTeX > where > >> it appears *inside math delimiters* so it's exported verbatim? I.e. > >> inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ? > >> > >> I ask because I'm keeping a note file with much text and only a few > >> equations, but with frequent reference to e.g. CO_2 and m^2. It's > >> possible to always write $CO_2$ and $m^2$, but less readable, and > >> irksome when you've got used to an easier way. An inline formula > can > >> be protected by surrounding it with verbatim markup, =$...$=, but > then > >> it's only good for jsMath, not for LaTeX export. > >> > >> Yours, > >> Christian > >> > >> _______________________________________________ > >> Emacs-orgmode mailing list > >> Please use `Reply All' to send replies to the list. > >> Emacs-orgmode@gnu.org > >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > > - Carsten > > > > > > > > > > > -- > > Christian Moe > E-mail: mail@christianmoe.com > Website: http://christianmoe.com > > > > Carsten Dominik wrote: >> Hi Christian, >> how should, in this case, a literal LaTeX environment like >> \begin{equation} >> a=b >> \end{equation} >> be handled? >> - Carsten >> On Jun 17, 2010, at 9:23 AM, Christian Moe wrote: >>> Hi, >>> >>> To display LaTeX math in Org html export with lovely jsMath, it >>> must be >>> exported verbatim with >>> >>> #+OPTIONS: ^:nil TeX:nil >>> >>> so one cannot use lazy superscripts/subscripts or Org entities in >>> the rest of the text. >>> >>> Is there a simple way to turn these options on, but protect LaTeX >>> where >>> it appears *inside math delimiters* so it's exported verbatim? I.e. >>> inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ? >>> >>> I ask because I'm keeping a note file with much text and only a >>> few equations, but with frequent reference to e.g. CO_2 and m^2. >>> It's possible to always write $CO_2$ and $m^2$, but less readable, >>> and irksome when you've got used to an easier way. An inline >>> formula can be protected by surrounding it with verbatim markup, = >>> $...$=, but then it's only good for jsMath, not for LaTeX export. >>> >>> Yours, >>> Christian >>> >>> _______________________________________________ >>> Emacs-orgmode mailing list >>> Please use `Reply All' to send replies to the list. >>> Emacs-orgmode@gnu.org >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> - Carsten > > > -- > > Christian Moe > E-mail: mail@christianmoe.com > Website: http://christianmoe.com > - Carsten [-- Attachment #4: Type: text/plain, Size: 201 bytes --] _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: Verbatim LaTeX inside delimiters in HTML export with jsMath? 2010-06-25 10:06 ` Carsten Dominik @ 2010-07-01 7:18 ` Christian Moe 2010-07-01 8:32 ` Carsten Dominik 0 siblings, 1 reply; 10+ messages in thread From: Christian Moe @ 2010-07-01 7:18 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode Hi, Carsten, Sorry it took me so long to get back to you. The patch does exactly what I hoped for: Allows one to set an option to get LaTeX math passed verbatim into HTML for jsMath to process, while keeping the use of the ^:t TeX:t options. I've tested it on various documents. I noticed the following behavior: A comment line starting with "#" immediately before a \begin{equation} environment is passed verbatim as well. I don't think it counts as a bug, since there should probably be a blank line before \begin anyway. I can now scrap the workaround I thought up last weekend, which involved a preprocessing hook to put = signs or #+BEGIN_EXAMPLE blocks around anything found by org-latex-regexps, and a postprocessing hook to get rid of <PRE> tags in the HTML output. It worked, if inelegantly, but I think it makes better sense to have the LaTeX:verbatim option built in. Thanks! I'll see about updating the Worg page -- but I'm a Git novice and will be on a 56K modem for a bit, so it won't happen immediately. Yours, Christian Carsten Dominik wrote: > For John Wiegley: John, please do not yet apply the attached patch... > > Hi Christian, > > I am trying to get back to this issue. > > I am attaching a patch, please apply it to your setup and then try > > #+OPTIONS: ^:t TeX:t LaTeX:verbatim > > if that works, can I then ask you to update > http://orgmode.org/worg/org-tutorials/org-jsmath.php ? > > Thanks! > > - Carsten > > > > On Jun 18, 2010, at 12:58 PM, Christian Moe wrote: > >> Hi, Carsten, >> >> Thanks for taking a look. >> >> Your example should be output exactly the same as it is currently with >> the =LaTeX:nil= option, i. e. verbatim: >> >> <p> >> \begin{equation} >> a=b >> \end{equation} >> </p> >> >> - and this minimal example could be interpreted by jsMath without any >> changes in Org-mode export, since it happens to contain no >> sub/superscripts or entities. >> >> What I'd like is for >> >> \begin{equation} >> \e=mc^2 >> \end{equation} >> >> to be output equally verbatim as >> >> <p> >> \begin{equation} >> e=mc^2 >> \end{equation} >> </p> >> >> *even when =^:t= is on*, so I could freely write e.g. m^2 in the text >> and get it superscripted, but not get >> >> <p> >> \begin{equation} >> e=mc<sup>2</sup> >> \end{equation} >> </p> >> >> In other words, to have my cake and eat it, too. I hope it's clearer now. >> >> Yours, >> Christian >> >> >> Carsten Dominik wrote: >> > Hi Christian, >> > >> > how should, in this case, a literal LaTeX environment like >> > >> > \begin{equation} >> > a=b >> > \end{equation} >> > >> > be handled? >> > >> > - Carsten >> > >> > On Jun 17, 2010, at 9:23 AM, Christian Moe wrote: >> > >> >> Hi, >> >> >> >> To display LaTeX math in Org html export with lovely jsMath, it >> must be >> >> exported verbatim with >> >> >> >> #+OPTIONS: ^:nil TeX:nil >> >> >> >> so one cannot use lazy superscripts/subscripts or Org entities in the >> >> rest of the text. >> >> >> >> Is there a simple way to turn these options on, but protect LaTeX >> where >> >> it appears *inside math delimiters* so it's exported verbatim? I.e. >> >> inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ? >> >> >> >> I ask because I'm keeping a note file with much text and only a few >> >> equations, but with frequent reference to e.g. CO_2 and m^2. It's >> >> possible to always write $CO_2$ and $m^2$, but less readable, and >> >> irksome when you've got used to an easier way. An inline formula can >> >> be protected by surrounding it with verbatim markup, =$...$=, but then >> >> it's only good for jsMath, not for LaTeX export. >> >> >> >> Yours, >> >> Christian >> >> >> >> _______________________________________________ >> >> Emacs-orgmode mailing list >> >> Please use `Reply All' to send replies to the list. >> >> Emacs-orgmode@gnu.org >> >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> > >> > - Carsten >> > >> > >> > >> > >> >> >> -- >> >> Christian Moe >> E-mail: mail@christianmoe.com >> Website: http://christianmoe.com >> >> >> >> Carsten Dominik wrote: >>> Hi Christian, >>> how should, in this case, a literal LaTeX environment like >>> \begin{equation} >>> a=b >>> \end{equation} >>> be handled? >>> - Carsten >>> On Jun 17, 2010, at 9:23 AM, Christian Moe wrote: >>>> Hi, >>>> >>>> To display LaTeX math in Org html export with lovely jsMath, it must be >>>> exported verbatim with >>>> >>>> #+OPTIONS: ^:nil TeX:nil >>>> >>>> so one cannot use lazy superscripts/subscripts or Org entities in >>>> the rest of the text. >>>> >>>> Is there a simple way to turn these options on, but protect LaTeX where >>>> it appears *inside math delimiters* so it's exported verbatim? I.e. >>>> inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ? >>>> >>>> I ask because I'm keeping a note file with much text and only a few >>>> equations, but with frequent reference to e.g. CO_2 and m^2. It's >>>> possible to always write $CO_2$ and $m^2$, but less readable, and >>>> irksome when you've got used to an easier way. An inline formula can >>>> be protected by surrounding it with verbatim markup, =$...$=, but >>>> then it's only good for jsMath, not for LaTeX export. >>>> >>>> Yours, >>>> Christian >>>> >>>> _______________________________________________ >>>> Emacs-orgmode mailing list >>>> Please use `Reply All' to send replies to the list. >>>> Emacs-orgmode@gnu.org >>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>> - Carsten >> >> > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Verbatim LaTeX inside delimiters in HTML export with jsMath? 2010-07-01 7:18 ` Christian Moe @ 2010-07-01 8:32 ` Carsten Dominik 2010-07-01 22:22 ` Christian Moe 0 siblings, 1 reply; 10+ messages in thread From: Carsten Dominik @ 2010-07-01 8:32 UTC (permalink / raw) To: mail; +Cc: emacs-orgmode On Jul 1, 2010, at 9:18 AM, Christian Moe wrote: > Hi, Carsten, > > Sorry it took me so long to get back to you. > > The patch does exactly what I hoped for: Allows one to set an option > to get LaTeX math passed verbatim into HTML for jsMath to process, > while keeping the use of the ^:t TeX:t options. I've tested it on > various documents. OK, I have applied it. > > I noticed the following behavior: A comment line starting with "#" > immediately before a \begin{equation} environment is passed verbatim > as well. I don't think it counts as a bug, since there should > probably be a blank line before \begin anyway. This is a bug, unrelated to this patch. Thanks for finding it! This is not yet fixed.... > > I can now scrap the workaround I thought up last weekend, which > involved a preprocessing hook to put = signs or #+BEGIN_EXAMPLE > blocks around anything found by org-latex-regexps, and a > postprocessing hook to get rid of <PRE> tags in the HTML output. It > worked, if inelegantly, but I think it makes better sense to have > the LaTeX:verbatim option built in. > > Thanks! Cheers! > > I'll see about updating the Worg page -- but I'm a Git novice and > will be on a 56K modem for a bit, so it won't happen immediately. If you want, just get the source file from http://repo.or.cz/w/Worg.git/blob_plain/HEAD:/org-tutorials/org-jsmath.org edit it, and send me a patch of the changed version. Thanks! - Carsten > > Yours, > Christian > > > > > > > Carsten Dominik wrote: >> For John Wiegley: John, please do not yet apply the attached patch... >> Hi Christian, >> I am trying to get back to this issue. >> I am attaching a patch, please apply it to your setup and then try >> #+OPTIONS: ^:t TeX:t LaTeX:verbatim >> if that works, can I then ask you to update http://orgmode.org/worg/org-tutorials/org-jsmath.php >> ? >> Thanks! >> - Carsten >> On Jun 18, 2010, at 12:58 PM, Christian Moe wrote: >>> Hi, Carsten, >>> >>> Thanks for taking a look. >>> >>> Your example should be output exactly the same as it is currently >>> with the =LaTeX:nil= option, i. e. verbatim: >>> >>> <p> >>> \begin{equation} >>> a=b >>> \end{equation} >>> </p> >>> >>> - and this minimal example could be interpreted by jsMath without >>> any changes in Org-mode export, since it happens to contain no sub/ >>> superscripts or entities. >>> >>> What I'd like is for >>> >>> \begin{equation} >>> \e=mc^2 >>> \end{equation} >>> >>> to be output equally verbatim as >>> >>> <p> >>> \begin{equation} >>> e=mc^2 >>> \end{equation} >>> </p> >>> >>> *even when =^:t= is on*, so I could freely write e.g. m^2 in the >>> text and get it superscripted, but not get >>> >>> <p> >>> \begin{equation} >>> e=mc<sup>2</sup> >>> \end{equation} >>> </p> >>> >>> In other words, to have my cake and eat it, too. I hope it's >>> clearer now. >>> >>> Yours, >>> Christian >>> >>> >>> Carsten Dominik wrote: >>> > Hi Christian, >>> > >>> > how should, in this case, a literal LaTeX environment like >>> > >>> > \begin{equation} >>> > a=b >>> > \end{equation} >>> > >>> > be handled? >>> > >>> > - Carsten >>> > >>> > On Jun 17, 2010, at 9:23 AM, Christian Moe wrote: >>> > >>> >> Hi, >>> >> >>> >> To display LaTeX math in Org html export with lovely jsMath, it >>> must be >>> >> exported verbatim with >>> >> >>> >> #+OPTIONS: ^:nil TeX:nil >>> >> >>> >> so one cannot use lazy superscripts/subscripts or Org entities >>> in the >>> >> rest of the text. >>> >> >>> >> Is there a simple way to turn these options on, but protect >>> LaTeX where >>> >> it appears *inside math delimiters* so it's exported verbatim? >>> I.e. >>> >> inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ? >>> >> >>> >> I ask because I'm keeping a note file with much text and only a >>> few >>> >> equations, but with frequent reference to e.g. CO_2 and m^2. It's >>> >> possible to always write $CO_2$ and $m^2$, but less readable, and >>> >> irksome when you've got used to an easier way. An inline >>> formula can >>> >> be protected by surrounding it with verbatim markup, =$...$=, >>> but then >>> >> it's only good for jsMath, not for LaTeX export. >>> >> >>> >> Yours, >>> >> Christian >>> >> >>> >> _______________________________________________ >>> >> Emacs-orgmode mailing list >>> >> Please use `Reply All' to send replies to the list. >>> >> Emacs-orgmode@gnu.org >>> >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>> > >>> > - Carsten >>> > >>> > >>> > >>> > >>> >>> >>> -- >>> >>> Christian Moe >>> E-mail: mail@christianmoe.com >>> Website: http://christianmoe.com >>> >>> >>> >>> Carsten Dominik wrote: >>>> Hi Christian, >>>> how should, in this case, a literal LaTeX environment like >>>> \begin{equation} >>>> a=b >>>> \end{equation} >>>> be handled? >>>> - Carsten >>>> On Jun 17, 2010, at 9:23 AM, Christian Moe wrote: >>>>> Hi, >>>>> >>>>> To display LaTeX math in Org html export with lovely jsMath, it >>>>> must be >>>>> exported verbatim with >>>>> >>>>> #+OPTIONS: ^:nil TeX:nil >>>>> >>>>> so one cannot use lazy superscripts/subscripts or Org entities >>>>> in the rest of the text. >>>>> >>>>> Is there a simple way to turn these options on, but protect >>>>> LaTeX where >>>>> it appears *inside math delimiters* so it's exported verbatim? >>>>> I.e. >>>>> inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ? >>>>> >>>>> I ask because I'm keeping a note file with much text and only a >>>>> few equations, but with frequent reference to e.g. CO_2 and m^2. >>>>> It's possible to always write $CO_2$ and $m^2$, but less >>>>> readable, and irksome when you've got used to an easier way. An >>>>> inline formula can be protected by surrounding it with verbatim >>>>> markup, =$...$=, but then it's only good for jsMath, not for >>>>> LaTeX export. >>>>> >>>>> Yours, >>>>> Christian >>>>> >>>>> _______________________________________________ >>>>> Emacs-orgmode mailing list >>>>> Please use `Reply All' to send replies to the list. >>>>> Emacs-orgmode@gnu.org >>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>>> - Carsten >>> >>> >> > > > - Carsten ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Verbatim LaTeX inside delimiters in HTML export with jsMath? 2010-07-01 8:32 ` Carsten Dominik @ 2010-07-01 22:22 ` Christian Moe 2010-07-02 2:43 ` Carsten Dominik 0 siblings, 1 reply; 10+ messages in thread From: Christian Moe @ 2010-07-01 22:22 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode Hi, The Worg page on jsMath now documents the new =LaTeX:verbatim= option: http://orgmode.org/worg/org-tutorials/org-jsmath.php#sec-4 I added a new heading for this, as it no longer belongs under "disadvantages". :) Yours, Christian Moe ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Verbatim LaTeX inside delimiters in HTML export with jsMath? 2010-07-01 22:22 ` Christian Moe @ 2010-07-02 2:43 ` Carsten Dominik 0 siblings, 0 replies; 10+ messages in thread From: Carsten Dominik @ 2010-07-02 2:43 UTC (permalink / raw) To: mail; +Cc: emacs-orgmode On Jul 2, 2010, at 12:22 AM, Christian Moe wrote: > Hi, > > The Worg page on jsMath now documents the new =LaTeX:verbatim= option: > > http://orgmode.org/worg/org-tutorials/org-jsmath.php#sec-4 > > I added a new heading for this, as it no longer belongs under > "disadvantages". :) That was ast, thanks! - Carsten ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-07-02 2:43 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-05-05 0:21 Prevent Org timestamps breaking with paragraph fill? Jeff Kowalczyk 2010-05-14 7:18 ` Carsten Dominik 2010-06-17 7:23 ` Verbatim LaTeX inside delimiters in HTML export with jsMath? Christian Moe 2010-06-18 7:25 ` Carsten Dominik 2010-06-18 10:58 ` Christian Moe 2010-06-25 10:06 ` Carsten Dominik 2010-07-01 7:18 ` Christian Moe 2010-07-01 8:32 ` Carsten Dominik 2010-07-01 22:22 ` Christian Moe 2010-07-02 2:43 ` Carsten Dominik
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).