From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: [bug] Problem with Worg (html?) publishing (was Re: orgmode BEAMER scaling image) Date: Fri, 25 Mar 2011 17:07:07 -0400 Message-ID: <11249.1301087227@alphaville.usa.hp.com> References: <19834758-735D-4ADE-AA66-8ACF44F2CE46@gmail.com> <87bp105nva.fsf@ucl.ac.uk> <4D8BB89A.70908@gmail.com> <874o6rwjox.fsf@pinto.chemeng.ucl.ac.uk> <4D8CC930.9050201@gmail.com> <871v1v9f5m.fsf_-_@ucl.ac.uk> Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=54319 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3EDx-0003kX-GD for emacs-orgmode@gnu.org; Fri, 25 Mar 2011 17:07:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q3EDs-0005d1-Su for emacs-orgmode@gnu.org; Fri, 25 Mar 2011 17:07:13 -0400 Received: from g4t0017.houston.hp.com ([15.201.24.20]:49114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q3EDs-0005cT-Jq for emacs-orgmode@gnu.org; Fri, 25 Mar 2011 17:07:08 -0400 In-Reply-To: Message from Eric S Fraga of "Fri, 25 Mar 2011 19:24:53 -0000." <871v1v9f5m.fsf_-_@ucl.ac.uk> 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 To: Gilberto , Emacs Org mode mailing list Cc: nicholas.dokos@hp.com Nick Dokos wrote: > Eric S Fraga wrote: > > > > In the org-beamer tutorial (Worg/org-tutorials/org-beamer/tutorial.org), > > I have the following: > > > > ,---- > > | > > | #+BEGIN_Example > > | ,** Two columns > > | > > | ,*** A block :B_ignoreheading:BMCOL: > > | :PROPERTIES: > > | :BEAMER_env: ignoreheading > > | :BEAMER_col: 0.4 > > | :END: > > | - this slide consists of two columns > > | - the first (left) column has no heading and consists of text > > | - the second (right) column has an image and is enclosed in an > > | @example@ block > > | > > | ,*** A screenshot :BMCOL:B_example: > > | :PROPERTIES: > > | :BEAMER_col: 0.6 > > | :BEAMER_env: example > > | :END: > > | , #+ATTR_LATEX: width=\textwidth > > | [[file://../../images/org-beamer/a-simple-slide.png]] > > | #+END_Example > > `---- > > > > Note the second last line of the example which sets the latex attribute > > for the following image. On export to HTML for publishing on the Worg > > website, this line has magically *disappeared*! The ',' is supposed to > > protect this line but instead it disappears. > > > > I have gone through the whole tutorial and this is the only line that > > has disappeared. My intuition is that the HTML export is ignoring all > > LATEX attribute lines (as it should) but that maybe the regex for is > > rather greedy? However, I have looked at the code but have not seen > > anywhere obvious where this happens -- all the regexs I found seem to be > > pinned at the start of the line with only whitespace allowed before > > the #+. > > > > Your intuition is (almost) correct: in org-export-preprocess-string, the comma > is stripped by org-export-replace-src-segments-and-examples and the > ATTR_LATEX is stripped by org-export-select-backend-specific-text which > very explicitly says: > > ,---- > | ... > | ;; Delete #+attr_Backend: stuff of another backend. Those > | ;; matching the current backend will be taken care of by > | ;; `org-export-attach-captions-and-attributes' > | ... > `---- > > Commenting out the two forms that follow this comment preserve the ATTR_LATEX, but that's obviously not *the* fix: ,---- | ... | ;; Delete #+attr_Backend: stuff of another backend. Those | ;; matching the current backend will be taken care of by | ;; `org-export-attach-captions-and-attributes' | ;; | ;; (goto-char (point-min)) | ;; (while (re-search-forward (concat "^\\([ \t]*\\)#\\+attr_" (cadr fmt) | ;; ":[ \t]*\\(.*\\)") nil t) | ;; (setq ind (org-get-indentation)) | ;; (when (not (eq (car fmt) org-export-current-backend)) | ;; (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max))))) | ;; | ;; Handle #+begin_backend and #+end_backend stuff | ... `---- It's not clear to me how to fix it properly: at the point where org-export-select-backend-specific-text is called, there's been a partial transformation of the input, so the function is looking at the following: ,---- | | #+BEGIN_HTML |
| *** A block                                           :B_ignoreheading:BMCOL:
|     :PROPERTIES:
|     :BEAMER_env: ignoreheading
|     :BEAMER_col: 0.4
|     :END:
|     - this slide consists of two columns
|     - the first (left) column has no heading and consists of text
|     - the second (right) column has an image and is enclosed in an
|       @example@ block
| 
| *** A screenshot                                            :BMCOL:B_example:
|     :PROPERTIES:
|     :BEAMER_col: 0.6
|     :BEAMER_env: example
|     :END:
|     #+ATTR_LATEX: width=\textwidth
|     [[file://../../images/org-beamer/a-simple-slide.png]]
| 
| | #+END_HTML | `---- It could use the fact that it is in a
 section - but the function
is generic wrt backends, so it doesn't worry about details like this.
Maybe a backend-specific function can be called at this point to deal
with it - and that can be smarter about how to transform it properly.

Nick