From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: apply attr_html to a whole figure? Date: Thu, 22 Sep 2016 09:09:23 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmy8R-0006nE-6K for emacs-orgmode@gnu.org; Thu, 22 Sep 2016 03:09:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmy8N-0001Dr-0W for emacs-orgmode@gnu.org; Thu, 22 Sep 2016 03:09:30 -0400 Received: from mail2.b1.hitrost.net ([91.185.211.205]:57280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmy8M-0001Cy-PJ for emacs-orgmode@gnu.org; Thu, 22 Sep 2016 03:09:26 -0400 In-reply-to: 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" To: Matt Price Cc: Org Mode I don't think Org syntax provides any way to do this at present, but ignore the rest of this message if anyone knows better. Possible workarounds: 1. Wrap your figure in a #+BEGIN_ADDITIONALCLASS...#+END_ADDITIONALCLASS block, to wrap the div.figure in a div.additionalclass. Not exactly what you wanted, and a pain in the neck if you have many such figures, but gives you enough to work with in CSS. 2. Add javascript to move the extra class attribute from the img to the containing div. 3. Write an export filter. Yours, Christian Matt Price writes: > When exporting images with captions, ox-html currently creates a strucuture like this: > > > <div class="figure"> > <p><img src="./images/hlevel.png" alt="hlevel.png"> > </p> > <p><span class="figure-number">Figure 1:</span> "test"</p> > </div> > > (I've tried setting org-html-html5-fancy" to t, but for whatever reason this doesn't result in the useo f the <figure> tag. I tried with emacs -q with no luck). > > I would like to be able to give an additional class to the enclosing <div class="figure">. Any idea how i might be able to do that? As far as I can see, org-html--wrap-image does not have access to the org link element and so can't query for attributes. > > I really appreciate any ideas! Thanks, > Matt > >