From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uriel Avalos Subject: Re: Change DOCTYPE declaration? Date: Thu, 18 Nov 2010 10:51:40 -0500 Message-ID: <351.54683650962$1290095713@news.gmane.org> References: <20101117130409.773797d2amscopub-mail@yahoo.com@dove.localdomain> <20101117183427.GG2450@soloJazz.com> <20101117152308.63473cd6amscopub-mail@yahoo.com@dove.localdomain> <20101117214505.GH2450@soloJazz.com> <20101118103550.33442d0eamscopub-mail@yahoo.com@dove.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=42290 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJ6mS-0003qb-VU for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 10:52:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJ6mR-00078H-Nt for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 10:52:12 -0500 Received: from smtp109.prem.mail.sp1.yahoo.com ([98.136.44.54]:33025) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PJ6mR-00078B-Fi for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 10:52:11 -0500 In-Reply-To: <20101118103550.33442d0eamscopub-mail@yahoo.com@dove.localdomain> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Cc: emacs-orgmode@gnu.org On Thu, 18 Nov 2010 10:35:50 -0500 Uriel Avalos wrote: > On Wed, 17 Nov 2010 19:45:06 -0200 > Juan Pechiar wrote: > > > Yo can set variables on a per-file basis. > > > > Check EXPORT OPTIONS on the manual. You can set variables there (but > > not add hooks), so maybe something like this works: > > > > #+begin_src emacs-lisp > > > > ;; in your .emacs file: > > > > (add-hook 'org-export-html-final-hook > > (lambda () > > (if ( (boundp 'uriel-change-doctype) ) > > > > (let ((kill-whole-line t)) > > (goto-char (point-min)) > > (next-line) > > (kill-line 2) > > (insert "\n") > > ) > > ) > > ) > > > > ) > > > > #+end_src > > > > So the hook body will only execute if uriel-change-doctype is bound to > > some value. > > > > Then, on your document, include > > > > #+BIND uriel-change-doctype t > > > > Not tested, good luck! > > > > .j. > > > > > > On Wed, Nov 17, 2010 at 03:23:08PM -0500, Uriel Avalos wrote: > > > Thanks for the reply. After some monkeying around, I found I could do this: > > > > > > (add-hook 'org-export-html-final-hook > > > (lambda () > > > (let ((kill-whole-line t)) > > > (goto-char (point-min)) > > > (next-line) > > > (kill-line 2) > > > (insert "\n") > > > ) > > > ) > > > ) > > > > > > To undo it, I can call this: > > > > > > (setq org-export-html-final-hook nil) > > > > > > However, one question, the above sets the doctype GLOBALLY. Is there > > > a way to do set this automagically per file? (I.e., some kind of > > > file-specific export option) > > > > > > Juan Pechiar wrote: > > > > > > > The DOCTYPE declaration is hardcoded inside org-html.el > > > > > > > > You may change it by defining a hook and modifying the generated HTML. > > > > Have a look at the following message, where they get rid of the > > > > declaration: > > > > > > > > http://lists.gnu.org/archive/html/emacs-orgmode/2010-06/msg00063.html > > > > > > > > you may add some 'insert' there with your own declaration. > > > > > > > > On Wed, Nov 17, 2010 at 01:04:09PM -0500, Uriel Avalos wrote: > > > > > How do I change the doctype declaration? > > Great. It's working like a charm. If uriel-change-doctype is not defined, it leaves the doctype alone. Otherwise, it changes it. (Note that there's a small typo in the code, an extra parentheses before var but it otherwise works very well.) Thanks! > > The only problem is that #+BIND is not working. I tried setting org-export-allow-BIND to t and it still does not work. Ideas? > > _______________________________________________ > 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 Nevermind, I forgot the : in #+BIND. DOH! It's working fine now. For the reference, here's what works: In .emacs: (add-hook 'org-export-html-final-hook (lambda () (if (boundp 'uriel-mathml-doctype) (let ((kill-whole-line t)) (goto-char (point-min)) (next-line) (kill-line 2) (insert "\n") ) ) ) ) Then in the file: #+BIND: uriel-mathml-doctype t