Re: [O] BIND org-html-style-include-*
Hi Terry, tftor...@tftorrey.com (T.F. Torrey) writes: > "make up2" reports these failures (and thus does not install): > > 6 unexpected results: >FAILED test-org-babel/inline-src_blk-default-results-replace-line-1 >FAILED test-org-babel/inline-src_blk-results-file >FAILED test-org-babel/inline-src_blk-results-raw >FAILED test-org-babel/inline-src_blk-results-scalar >FAILED test-org-babel/inline-src_blk-results-silent >FAILED test-org-babel/inline-src_blk-results-verbatim This is now fixed, thanks. -- Bastien
Re: [O] BIND org-html-style-include-*
Hello, Bastien writes: > Hi Terry, > > tftor...@tftorrey.com (T.F. Torrey) writes: > >> However, the new HTML exporter includes the MathJax JavaScript every >> time, and I don't see any variable to set to suppress it. > > This is not the case anymore since commit 4d7f4d87. Yes. Thank you for the fix. >> Recent posts by Bastien suggest that maybe it is supposed to be included >> only if LaTeX is used in the buffer, but I'm not sure he was talking >> about this issue. > > I hope I was -- the MathJax config will now be included if your HTML > page contains LaTeX snippets to display. It will not be included > otherwise. > >> With the new exporter on my Org, even the most minimal Org file exported >> to HTML includes MathJax. My Org version is 7.9.3e-1032-g791a8d. The >> most recent pulls fail testing (which people must already know). > > You are behind a few commits, please update. "make up2" reports these failures (and thus does not install): 6 unexpected results: FAILED test-org-babel/inline-src_blk-default-results-replace-line-1 FAILED test-org-babel/inline-src_blk-results-file FAILED test-org-babel/inline-src_blk-results-raw FAILED test-org-babel/inline-src_blk-results-scalar FAILED test-org-babel/inline-src_blk-results-silent FAILED test-org-babel/inline-src_blk-results-verbatim I was reluctant to run "make update" when the tests failed, but I did anyway for the rest of this. >> (By the way, though it may be too late to change them now, the variables >> would be better named "org-html-include-style-default" and >> "org-html-include-scripts-default" and possibly >> "org-html-include-scripts-mathjax". The HTML exporter has many things >> that might be included in the output, and having the variables all >> starting with "org-html-include-" would make them easier for everyone to >> find, understand, and modify.) > > I somewhat agree. But C-h v org-html-include TAB expands and display > all variables here, so maybe not such an issue. It is not too late to > change the names of the variables, but I'd rather stick to these names > because it lowers the effort when switching from 7.9 to 8.0. Yes, typing C-h v org-html-include finds these variables: org-html-style-include-default org-html-style-include-scripts It bothers me that the second one is misnamed. It has nothing to do with style. Even for just these two, starting with org-html-include (that is, org-html-include-style and org-html-include-script --- they should probably both be singular or plural) would be an improvement, and who knows what future development brings? These variables are already changing (from org-export-html-style-*) for 8.0. Now is a good time to DTRT. >> (Similarly, as someone else wrote, #+HTML_STYLE would be much better >> named #+HTML_HEAD, given that style is just one of the many things this >> directive might put into the head element of the html.) > > For this one I agree completely. I will make this change. All the people who just changed their files from #+STYLE to #+HTML_STYLE will curse us, or you anyway, but it would make me happy (the change, not them cursing you). Thank you for your time and attention. Best regards, Terry -- T.F. Torrey
Re: [O] BIND org-html-style-include-*
Bastien writes: > For this one I agree completely. I will make this change. I share the patch here to let people discuss this change a bit. It will break again the configuration of those who take the time to test the current HEAD (sic), so I'd rather make sure everyone is fine with it. Thanks, diff --git a/lisp/ox-html.el b/lisp/ox-html.el index e1b50f4..963a376 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -118,7 +118,7 @@ (:html-postamble nil "html-postamble" org-html-postamble) (:html-preamble nil "html-preamble" org-html-preamble) (:html-style nil nil org-html-style) - (:html-style-extra "HTML_STYLE" nil org-html-style-extra newline) + (:html-head "HTML_HEAD" nil org-html-head newline) (:html-style-include-default nil nil org-html-style-include-default) (:html-style-include-scripts nil nil org-html-style-include-scripts) (:html-table-tag nil nil org-html-table-tag) @@ -242,9 +242,9 @@ for the JavaScript code in this tag. /*]]>*/--> " "The default style specification for exported HTML files. -Please use the variables `org-html-style' and -`org-html-style-extra' to add to this style. If you wish to not -have the default style included, customize the variable +Please use the variables `org-html-style' and `org-html-head' to +add to this style. If you wish to not have the default style +included, customize the variable `org-html-style-include-default'.") @@ -947,22 +947,20 @@ If you'd like to refer to an external style file, use something like As the value of this option simply gets inserted into the HTML header, you can \"misuse\" it to add arbitrary text to the header. -See also the variable `org-html-style-extra'." +See also the variable `org-html-head'." :group 'org-export-html :type 'string) ;;;###autoload (put 'org-html-style 'safe-local-variable 'stringp) -(defcustom org-html-style-extra "" - "Additional style information for HTML export. -The value of this variable is inserted into the HTML buffer right after -the value of `org-html-style'. Use this variable for per-file -settings of style information, and do not forget to surround the style -settings with ... tags." +(defcustom org-html-head "" + "Additional information for the header of the HTML export. +The value of this variable is inserted into the HTML buffer right +after the value of `org-html-style'." :group 'org-export-html :type 'string) ;;;###autoload -(put 'org-html-style-extra 'safe-local-variable 'stringp) +(put 'org-html-head 'safe-local-variable 'stringp) Todos @@ -1262,7 +1260,7 @@ INFO is a plist used as a communication channel." (concat (when (plist-get info :html-style-include-default) org-html-style-default) (org-element-normalize-string (plist-get info :html-style)) -(org-element-normalize-string (plist-get info :html-style-extra)) +(org-element-normalize-string (plist-get info :html-head)) (when (plist-get info :html-style-include-scripts) org-html-scripts (defun org-html--build-mathjax-config (info) -- Bastien
Re: [O] BIND org-html-style-include-*
Hi Terry, tftor...@tftorrey.com (T.F. Torrey) writes: > However, the new HTML exporter includes the MathJax JavaScript every > time, and I don't see any variable to set to suppress it. This is not the case anymore since commit 4d7f4d87. > Recent posts by Bastien suggest that maybe it is supposed to be included > only if LaTeX is used in the buffer, but I'm not sure he was talking > about this issue. I hope I was -- the MathJax config will now be included if your HTML page contains LaTeX snippets to display. It will not be included otherwise. > With the new exporter on my Org, even the most minimal Org file exported > to HTML includes MathJax. My Org version is 7.9.3e-1032-g791a8d. The > most recent pulls fail testing (which people must already know). You are behind a few commits, please update. > (By the way, though it may be too late to change them now, the variables > would be better named "org-html-include-style-default" and > "org-html-include-scripts-default" and possibly > "org-html-include-scripts-mathjax". The HTML exporter has many things > that might be included in the output, and having the variables all > starting with "org-html-include-" would make them easier for everyone to > find, understand, and modify.) I somewhat agree. But C-h v org-html-include TAB expands and display all variables here, so maybe not such an issue. It is not too late to change the names of the variables, but I'd rather stick to these names because it lowers the effort when switching from 7.9 to 8.0. > (Similarly, as someone else wrote, #+HTML_STYLE would be much better > named #+HTML_HEAD, given that style is just one of the many things this > directive might put into the head element of the html.) For this one I agree completely. I will make this change. -- Bastien
Re: [O] BIND org-html-style-include-*
Hi T.F, T.F. Torrey wrote: > (Similarly, as someone else wrote, #+HTML_STYLE would be much better > named #+HTML_HEAD, given that style is just one of the many things this > directive might put into the head element of the html.) I vote +1, at least if we can put anything we would put in the HTML HEAD element -- I mean, if there is no special restriction on the contents we can stuff there. Best regards, Seb -- Sebastien Vauban
Re: [O] BIND org-html-style-include-*
Hello, Nicolas Goaziou writes: > tftor...@tftorrey.com (T.F. Torrey) writes: > >> I still don't see any similar options regarding MathJax. Perhaps >> everyone else uses MathJax, or the functionality simply hasn't been >> implemented yet. If only the HTML export backend maintainer were still >> on the list... > > Would you mind describing what is missing? It shouldn't be hard to > implement it. By default, the HTML export engine includes some CSS for basic presentation, some JavaScript for interacting with code in the HTML, and some JavaScript for the MathJax functionality (among many other things, of course). The CSS can be not included by setting org-html-style-include-default to nil. The non-MathJax JavaScript can be not included by setting org-html-style-include-scripts to nil. However, the new HTML exporter includes the MathJax JavaScript every time, and I don't see any variable to set to suppress it. The old exporter did not export it. IIRC, it was off by default, and there was a setting to turn it on (don't quote me, I never used it). Recent posts by Bastien suggest that maybe it is supposed to be included only if LaTeX is used in the buffer, but I'm not sure he was talking about this issue. With the new exporter on my Org, even the most minimal Org file exported to HTML includes MathJax. My Org version is 7.9.3e-1032-g791a8d. The most recent pulls fail testing (which people must already know). (By the way, though it may be too late to change them now, the variables would be better named "org-html-include-style-default" and "org-html-include-scripts-default" and possibly "org-html-include-scripts-mathjax". The HTML exporter has many things that might be included in the output, and having the variables all starting with "org-html-include-" would make them easier for everyone to find, understand, and modify.) (Similarly, as someone else wrote, #+HTML_STYLE would be much better named #+HTML_HEAD, given that style is just one of the many things this directive might put into the head element of the html.) All the best, Terry -- T.F. Torrey
Re: [O] BIND org-html-style-include-*
Nicolas Goaziou writes: > Just to be sure we're not mis-communicating, a latex environment is the > following: > > \begin{equation*} > 2 + 2 = 4 > \end{equation*} > > This is not to be confused with a latex block, such as: > > #+begin_latex > \[2 + 2 = 4\] > #+end_latex I made the confusion -- I fixed last commit. Thanks! -- Bastien
Re: [O] BIND org-html-style-include-*
Bastien writes: > Nicolas Goaziou writes: > >> (org-element-map (plist-get info :parse-tree) >> '(latex-fragment latex-environment) 'identity info t) > > I used this, but only checking against LaTeX fragments. > HTML pages without LaTeX fragments will not include the > MathJax configuration. I don't understand. Latex environments also require Mathjax: see `org-html-latex-environment'. Just to be sure we're not mis-communicating, a latex environment is the following: \begin{equation*} 2 + 2 = 4 \end{equation*} This is not to be confused with a latex block, such as: #+begin_latex \[2 + 2 = 4\] #+end_latex Regards, -- Nicolas Goaziou
Re: [O] BIND org-html-style-include-*
Hi Nicolas, Nicolas Goaziou writes: > (org-element-map (plist-get info :parse-tree) > '(latex-fragment latex-environment) 'identity info t) I used this, but only checking against LaTeX fragments. HTML pages without LaTeX fragments will not include the MathJax configuration. Thanks! -- Bastien
Re: [O] BIND org-html-style-include-*
Bastien writes: > We need to make `org-html--build-mathjax-config' depends on whether > there is an latex-fragment element in the parse tree. Otherwise, > including the MathJAX config is useless. > > I've been looking at this this morning. > > Is there an org-element function to test whether an element/object > of a certain type is present in the parse tree? On course, it is `org-element-map' (you can have a look at its docstring, there is one such example). So, assuming you have access to communication channel (a.k.a. info argument): (org-element-map (plist-get info :parse-tree) '(latex-fragment latex-environment) 'identity info t) will be non-nil when either an exportable `latex-fragment' object or a `latex-environment' element is found within the parse tree. Regards, -- Nicolas Goaziou
Re: [O] BIND org-html-style-include-*
Hi, Nicolas Goaziou writes: > tftor...@tftorrey.com (T.F. Torrey) writes: > >> I still don't see any similar options regarding MathJax. Perhaps >> everyone else uses MathJax, or the functionality simply hasn't been >> implemented yet. If only the HTML export backend maintainer were still >> on the list... > > Would you mind describing what is missing? It shouldn't be hard to > implement it. We need to make `org-html--build-mathjax-config' depends on whether there is an latex-fragment element in the parse tree. Otherwise, including the MathJAX config is useless. I've been looking at this this morning. Is there an org-element function to test whether an element/object of a certain type is present in the parse tree? Thanks, -- Bastien
Re: [O] BIND org-html-style-include-*
tftor...@tftorrey.com (T.F. Torrey) writes: > I still don't see any similar options regarding MathJax. Perhaps > everyone else uses MathJax, or the functionality simply hasn't been > implemented yet. If only the HTML export backend maintainer were still > on the list... Would you mind describing what is missing? It shouldn't be hard to implement it. Regards, -- Nicolas Goaziou
Re: [O] BIND org-html-style-include-*
Hello, Nicolas Goaziou writes: > tftor...@tftorrey.com (T.F. Torrey) writes: > >> Now, I have these: >> >> #+BIND: org-html-style-include-default nil >> #+BIND: org-html-style-include-scripts nil >> >> But they seem to be silently ignored, though if I setq the values ahead >> of time, the output is suppressed. >> >> Can these still be set using BIND? If so, what am I doing wrong? > > What is the value of `org-export-allow-bind-keywords'? Aha! That's the one I was looking for. Thanks. >> Also, the value of org-html-mathjax-template seems to be output now by >> default, and I don't remember seeing it before. Is this an intended >> change? If so, how can it be suppressed? (If not ... ???) > > I cannot answer you for now, because I don't know enough of the HTML > back-end. I still don't see any similar options regarding MathJax. Perhaps everyone else uses MathJax, or the functionality simply hasn't been implemented yet. If only the HTML export backend maintainer were still on the list... Best regards, Terry -- T.F. Torrey
Re: [O] BIND org-html-style-include-*
Hello, tftor...@tftorrey.com (T.F. Torrey) writes: > In my files, this used to work to suppress the default styles and > javascript: > > #+BIND: org-export-html-style-include-default nil > #+BIND: org-export-html-style-include-scripts nil > > Now, I have these: > > #+BIND: org-html-style-include-default nil > #+BIND: org-html-style-include-scripts nil > > But they seem to be silently ignored, though if I setq the values ahead > of time, the output is suppressed. > > Can these still be set using BIND? If so, what am I doing wrong? What is the value of `org-export-allow-bind-keywords'? > Also, the value of org-html-mathjax-template seems to be output now by > default, and I don't remember seeing it before. Is this an intended > change? If so, how can it be suppressed? (If not ... ???) I cannot answer you for now, because I don't know enough of the HTML back-end. Regards, -- Nicolas Goaziou
[O] BIND org-html-style-include-*
Hello, In my files, this used to work to suppress the default styles and javascript: #+BIND: org-export-html-style-include-default nil #+BIND: org-export-html-style-include-scripts nil Now, I have these: #+BIND: org-html-style-include-default nil #+BIND: org-html-style-include-scripts nil But they seem to be silently ignored, though if I setq the values ahead of time, the output is suppressed. Can these still be set using BIND? If so, what am I doing wrong? Also, the value of org-html-mathjax-template seems to be output now by default, and I don't remember seeing it before. Is this an intended change? If so, how can it be suppressed? (If not ... ???) Emacs: GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 3.6.0) of 2012-12-24 on menkib, modified by Debian Package: Org-mode version 7.9.3e (7.9.3e-970-g728c0e @ /home/tftorrey/.emacs.d/elisp/org/lisp/) Best regards, Terry -- T.F. Torrey