From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: example or source blocks with captions Date: Thu, 28 Apr 2011 09:46:29 +0200 Message-ID: <80hb9iu8bu.fsf@somewhere.org> References: <525733B6-041C-462B-A08D-9A841F13ED95@tsdye.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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 fr= om > the bones of the project that might help you solve the problem of caption= ing > 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 c= an > be used to mark blocks that Org-mode doesn't recognize by default. Note t= hat > 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 > # <> > #+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 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 --=20 S=C3=A9bastien Vauban