From: "Thomas S. Dye" <tsd@tsdye.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: Fwd: example or source blocks with captions
Date: Thu, 28 Apr 2011 06:00:07 -1000 [thread overview]
Message-ID: <A8468E3D-D9DF-41EE-825E-27EE1EE53638@tsdye.com> (raw)
In-Reply-To: B3C8F4AE-886B-47EF-BFD3-7381E3FB984B@tsdye.com
[-- Attachment #1: Type: text/plain, Size: 2417 bytes --]
(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ébastien Vauban <wxhgmqzgwmuf@spammotel.com>
> Subject: Re: [O] example or source blocks with captions
>
> Aloha Seb,
>
> On Apr 27, 2011, at 9:46 PM, Sébastien 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
>>> =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
>>
>>
>
> Here it is,
> http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-10_3
>
> All the best,
> Tom
[-- Attachment #2: Type: text/html, Size: 5786 bytes --]
parent reply other threads:[~2011-04-28 16:00 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <B3C8F4AE-886B-47EF-BFD3-7381E3FB984B@tsdye.com>]
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=A8468E3D-D9DF-41EE-825E-27EE1EE53638@tsdye.com \
--to=tsd@tsdye.com \
--cc=emacs-orgmode@gnu.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).