emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Fwd:  example or source blocks with captions
       [not found] <B3C8F4AE-886B-47EF-BFD3-7381E3FB984B@tsdye.com>
@ 2011-04-28 16:00 ` Thomas S. Dye
  0 siblings, 0 replies; only message in thread
From: Thomas S. Dye @ 2011-04-28 16:00 UTC (permalink / raw)
  To: Org Mode

[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-28 16:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <B3C8F4AE-886B-47EF-BFD3-7381E3FB984B@tsdye.com>
2011-04-28 16:00 ` Fwd: example or source blocks with captions Thomas S. Dye

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).