From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: resize multiple image within a row or paragraph Date: Sat, 20 Sep 2014 14:08:38 +0200 Message-ID: <87d2aqa3zt.fsf@nicolasgoaziou.fr> References: <1411053218.81009.YahooMailNeo@web172803.mail.ir2.yahoo.com> <1411197785.65195.YahooMailNeo@web172806.mail.ir2.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVJST-0002X1-Sk for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 08:08:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XVJSN-00050w-Am for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 08:08:09 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:51786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVJSN-00050V-52 for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 08:08:03 -0400 In-Reply-To: <1411197785.65195.YahooMailNeo@web172806.mail.ir2.yahoo.com> (alban bernard's message of "Sat, 20 Sep 2014 08:23:05 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: alban bernard Cc: "emacs-orgmode@gnu.org" Hello, alban bernard writes: > My wife and I use the marvelous org-mode to design a complete set > of student courses. These courses are first written in org-mode then > exported to html to ease distribution to students (and save some paper). > > We wonder what is the correct way to resize multiple images those links > are within a single paragraph: > > "This is a phrase with [[./image1.png]] and [[./image2.png]] inline images." > > With the following, the only first image is resized (as expected): > > #+ATTR_HTML: :width 50% > This is a phrase with [[./image1.png]] and [[./image2.png]] inline images. > > The tutorial about caption in a row shows what is possible while working > only with > images > http://orgmode.org/worg/org-tutorials/images-and-xhtml-export.html#sec-5-2: > > #+HTML_HEAD: > > #+CAPTION: > #+ATTR_HTML: :width 10% > [[./image1.png]] > #+CAPTION: > #+ATTR_HTML: :width 10% > [[./image2.png]] > > Here, image1 and image2 are displayed and resized in a single row. > But we don't know how to mix text within this block so that all is > displayed as a single paragraph with resized images. This is not possible out of the box. You might use some Babel code to generate the needed HTML but I guess it wouldn't be particularly easy. Nevertheless, there's a solution. `html' back-end can redefine what a paragraph is, instead of following Org's own definition. More explicitly, an HTML paragraph can be defined as a cluster of elements not separated by any blank line and containing at least an Org paragraph. Hence: #+attr_html: :width 10% [[./img1.png]] Paragraph #+attr_html: :width 10% [[./img2.png]] consists of two paragraphs in Org, but would be seen as a single paragraph by HTML, and exported as such. Implementation is simple using pseudo-elements. `latex' back-ends does it already for tables and math snippets. However, I'm no HTML specialist, so there may be drawbacks I cannot foresee. Regards, -- Nicolas Goaziou