From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Fwd: example or source blocks with captions Date: Thu, 28 Apr 2011 06:00:07 -1000 Message-ID: References: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/alternative; boundary=Apple-Mail-39--718306497 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFTdk-0006x6-Pz for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 12:00:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFTdW-0004vv-3k for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 12:00:28 -0400 Received: from oproxy5-pub.bluehost.com ([67.222.39.38]:53991) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QFTdV-0004vS-Oa for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 12:00:14 -0400 Received: from cpe-24-94-66-191.hawaii.res.rr.com ([24.94.66.191] helo=[192.168.1.144]) by box472.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1QFTdS-00086H-1u for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 10:00:11 -0600 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: Org Mode --Apple-Mail-39--718306497 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable (forgot to cc the list) Begin forwarded message: > From: "Thomas S. Dye" > Date: April 28, 2011 5:42:32 AM HST > To: S=E9bastien Vauban > Subject: Re: [O] example or source blocks with captions > > Aloha Seb, > > On Apr 27, 2011, at 9:46 PM, S=E9bastien Vauban wrote: > >> Hi Thomas, >> >> "Thomas S. Dye" wrote: >>> A while back I took a stab at an overly ambitious project that I've >>> subsequently dropped. In that project I did manage to establish =20 >>> captions >>> that work with org-special-blocks. What follows is a cut and paste =20= >>> job from >>> the bones of the project that might help you solve the problem of =20= >>> captioning >>> constructs other than figures and tables. It was aimed primarily =20 >>> at LaTeX >>> export, but I seem to recall that it worked for html as well. >>> >>> All the best, >>> Tom >>> >>> This link establishes a caption that works with both LaTeX and =20 >>> html and can >>> be used to mark blocks that Org-mode doesn't recognize by default. =20= >>> Note that >>> you currently have to enter these links by hand and not with the =20 >>> usual >>> =3Dorg-insert-link=3D function, which doesn't allow spaces in the = =3DPATH=3D >>> argument. >>> >>> #+BEGIN_listing >>> # <> >>> #+source: define-caption-link >>> #+begin_src emacs-lisp :exports code >>> (org-add-link-type >>> "caption" nil >>> (lambda (path desc format) >>> (cond >>> ((eq format 'html) >>> (format "%s" desc)) >>> ((eq format 'latex) >>> (format "\\caption[%s]{%s}" path desc))))) >>> #+end_src >>> [[caption:A new caption link type][A new caption link type.]] >>> # <> >>> #+END_listing >>> >>> Block-level markup is accomplished with the help of the >>> [[latex:package][org-special-blocks]] package. It is used in this =20= >>> file to >>> wrap the [[latex:progstruct][listing]] environment defined by the >>> [[latex:package][minted]] package around a source code block to =20 >>> get a >>> floating listing in the LaTeX document. >> >> Interesting read. Could you share the definition of your `latex' =20 >> link type? >> >> Best regards, >> Seb >> >> --=20 >> S=E9bastien Vauban >> >> > > Here it is, > http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-10_3 > > All the best, > Tom --Apple-Mail-39--718306497 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable (forgot to cc the = list)

Begin forwarded message:

From: = "Thomas S. Dye" <tsd@tsdye.com>
Date: = April 28, 2011 5:42:32 AM HST
To: S=E9bastien= Vauban <wxhgmqzgwmuf@spammotel.com&= gt;
Subject: Re: [O] example or source blocks = with captions

Aloha = Seb,

On Apr 27, 2011, at 9:46 PM, S=E9bastien Vauban = wrote:

Hi Thomas,

"Thomas S. Dye" = wrote:
A while back I took a stab at an = overly ambitious project that I've
subsequently dropped. In that project I did manage to = establish captions
that work = with org-special-blocks. What follows is a cut and paste job = from
the bones of the project = that might help you solve the problem of = captioning
constructs other = than figures and tables. It was aimed primarily at = LaTeX
export, but I seem to = recall that it worked for html as well.

All the = best,
Tom

This link = establishes a caption that works with both LaTeX and html and = can
be used to mark blocks = that Org-mode doesn't recognize by default. Note = that
you currently have to = enter these links by hand and not with the = usual
=3Dorg-insert-link=3D = function, which doesn't allow spaces in the = =3DPATH=3D
argument.

#+BEGIN_listing
# = <<caption-link-type>>
#+source: define-caption-link
#+begin_src emacs-lisp :exports = code
=   (org-add-link-type
=    "caption" nil
=    (lambda (path desc = format)
=      (cond
      ((eq format = 'html)
=        (format "<span = class=3D\"caption\">%s</span>" = desc))
=       ((eq format = 'latex)
=        (format "\\caption[%s]{%s}" = path desc)))))
#+end_src
[[caption:A new caption link type][A new caption link = type.]]
# = <<fig:caption-link>>
#+END_listing

Block-level = markup is accomplished with the help of the
[[latex:package][org-special-blocks]] package. It is used = in this file to
wrap the = [[latex:progstruct][listing]] environment defined by = the
[[latex:package][minted]] = package around a source code block to get a
floating listing in the LaTeX = document.

Interesting read. Could you share the = definition of your `latex' link type?

Best regards,
=  Seb

--
S=E9bastien = Vauban



Here it = is,


= --Apple-Mail-39--718306497--