From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: example or source blocks with captions
Date: Thu, 28 Apr 2011 09:46:29 +0200 [thread overview]
Message-ID: <80hb9iu8bu.fsf@somewhere.org> (raw)
In-Reply-To: 525733B6-041C-462B-A08D-9A841F13ED95@tsdye.com
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
> =org-insert-link= function, which doesn't allow spaces in the =PATH=
> 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=\"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ébastien Vauban
next prev parent reply other threads:[~2011-04-28 7:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 15:57 example or source blocks with captions Neilen Marais
2011-04-27 19:36 ` Sébastien Vauban
2011-04-30 5:00 ` Jambunathan K
2011-04-27 21:21 ` Thomas S. Dye
2011-04-28 7:46 ` Sébastien Vauban [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-04-30 5:00 Jambunathan K
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=80hb9iu8bu.fsf@somewhere.org \
--to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
--cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).