From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Images in div and p Date: Fri, 2 Oct 2009 08:21:50 +0200 Message-ID: <6722E1ED-4904-4310-9690-F2E71754DE9E@gmail.com> References: <871vlneo7i.fsf@gmx.de> <87my4bcfps.fsf@gmx.de> <87ws3epuvp.fsf@gmx.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtcMo-0002s9-O9 for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 03:15:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtcMk-0002rK-G1 for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 03:15:50 -0400 Received: from [199.232.76.173] (port=53999 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtcMk-0002rH-BY for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 03:15:46 -0400 Received: from mx20.gnu.org ([199.232.41.8]:40509) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtcMj-0005F7-L9 for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 03:15:46 -0400 Received: from ey-out-1920.google.com ([74.125.78.146]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtcMi-0002Db-Tl for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 03:15:45 -0400 Received: by ey-out-1920.google.com with SMTP id 3so576680eyh.34 for ; Fri, 02 Oct 2009 00:15:43 -0700 (PDT) In-Reply-To: <87ws3epuvp.fsf@gmx.de> 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: Sebastian Rose Cc: Emacs-orgmode mailing list Applied, thanks! Maybe your example can be turned into an image-placing tutorial or FAQ? - Carsten On Oct 2, 2009, at 1:16 AM, Sebastian Rose wrote: > > > OK, this is my proposal (don't know, why I didn't send a patch in the > first place...). > > If a caption is provided, wrap the image as before. > > If no caption is provided, just insert the image tag. > > > > diff --git a/lisp/org-html.el b/lisp/org-html.el > index 0e06919..a9adf30 100644 > --- a/lisp/org-html.el > +++ b/lisp/org-html.el > @@ -1505,17 +1505,22 @@ lang=\"%s\" xml:lang=\"%s\"> > (let* ((caption (org-find-text-property-in-string 'org-caption > src)) > (attr (org-find-text-property-in-string 'org-attributes src)) > (label (org-find-text-property-in-string 'org-label src))) > - (format "%s
> -

%s > -
%s" > - (if org-par-open "

\n" "") > - (if label (format "id=\"%s\" " label) "") > + (concat > + (if caption > + (format "%s
> +

" > + (if org-par-open "

\n" "") > + (if label (format "id=\"%s\" " label) ""))) > + (format "" > src > (if (string-match "\\ (concat " " attr ) > - (concat " " attr " alt=\"" src "\"")) > - (if caption (concat "\n

" caption "

") "") > - (if org-par-open "\n

" "")))))) > + (concat " " attr " alt=\"" src "\""))) > + (if caption > + (format "

%s > +
%s" > + (concat "\n

" caption "

") > + (if org-par-open "\n

" "")))))))) > > (defun org-export-html-get-bibliography () > "Find bibliography, cut it out and return it." > > > A little Org-file for testing: > > > > #+OPTIONS: toc:nil > #+MACRO: imageurl ./intranet/img/powered-by-mysql-167x86.png > #+STYLE: > > * Images aligned > > #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="right" > [[{{{imageurl}}}]] > Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam > nonummy > nibh euismod tincidunt ut laoreet dolore magna aliquam erat > volutpat. Ut wisi > enim ad minim veniam, quis nostrud exerci tation ullamcorper > suscipit lobortis > nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure > dolor in > hendrerit in vulputate velit esse molestie consequat, vel illum > dolore eu > feugiat nulla facilisis at vero et accumsan et iusto odio dignissim > qui > blandit praesent luptatum zzril delenit augue duis dolore te > feugait nulla > facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, > sed diam > nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat > volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation > ullamcorper > suscipit lobortis nisl ut aliquip ex ea commodo > #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="left" > [[{{{imageurl}}}]] > Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam > nonummy > nibh euismod tincidunt ut laoreet dolore magna aliquam erat > volutpat. Ut wisi > enim ad minim veniam, quis nostrud exerci tation ullamcorper > suscipit lobortis > nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure > dolor in > hendrerit in vulputate velit esse molestie consequat, vel illum > dolore eu > feugiat nulla facilisis at vero et accumsan et iusto odio dignissim > qui > blandit praesent luptatum zzril delenit augue duis dolore te > feugait nulla > facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, > sed diam > nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat > volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation > ullamcorper > suscipit lobortis nisl ut aliquip ex ea commodo... > > * Images with Captions > > Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam > nonummy > nibh euismod tincidunt ut laoreet dolore magna aliquam erat > volutpat. Ut wisi > enim ad minim veniam, quis nostrud exerci tation ullamcorper > suscipit lobortis > nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure > dolor in > hendrerit in vulputate velit esse molestie consequat, vel illum > dolore eu > feugiat nulla facilisis at vero et accumsan et iusto odio dignissim > qui > #+CAPTION: My favourite image > #+ATTR_HTML: alt="image" hspace="10" vspace="10" > [[{{{imageurl}}}]] > Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam > nonummy > nibh euismod tincidunt ut laoreet dolore magna aliquam erat > volutpat. Ut wisi > enim ad minim veniam, quis nostrud exerci tation ullamcorper > suscipit lobortis > nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure > dolor in > hendrerit in vulputate velit esse molestie consequat, vel illum > dolore eu > feugiat nulla facilisis at vero et accumsan et iusto odio dignissim > qui > blandit praesent luptatum zzril delenit augue duis dolore te > feugait nulla > facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, > sed diam > nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat > volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation > ullamcorper > suscipit lobortis nisl ut aliquip ex ea commodo... > > * Images in a row > > #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" > [[{{{imageurl}}}]] > #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" > [[{{{imageurl}}}]] > #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" > [[{{{imageurl}}}]] > #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" > [[{{{imageurl}}}]] > #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" > [[{{{imageurl}}}]] > #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" > [[{{{imageurl}}}]] > #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" > [[{{{imageurl}}}]] > #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" > [[{{{imageurl}}}]]