On Oct 31, 2010, at 5:41 AM, Carsten Dominik wrote:


On Oct 31, 2010, at 9:47 AM, Magnus Nilsson wrote:

Dear all,

Is there a way to include an abstract that suits both LaTeX export and html export?

I am thinking in lines of
#+BEGIN_ABSTRACT:
My abstract goes here
#+END_ABSTRACT:
and have it interpreted differently depending on the export used.

No, not yet, but I believe this would be useful to have. Make a patch
and I will look at it favorably.

Cheers

- Carsten

Aloha Magnus,

Alternatively, you could use the existing link syntax for this kind of markup.   See http://orgmode.org/worg/org-tutorials/org-latex-export.php#sec-12

For example you could define a link type latex-env in your .emacs:
(org-add-link-type
 "latex-env" nil
 (lambda (path desc format)
   (cond
    ((eq format 'html)
     (format "<span style=\"color:grey;\">%s</span>" desc))
    ((eq format 'latex)
     (format "\\begin{%s}%s\\end{%s}" path desc path)))))
with this input [[latex-env:abstract][My abstract goes here.]], LaTeX export yields 

\begin[abstract}
My abstract goes here.
\end{abstract} 

You'd have to fiddle with the html part so that it suits your needs, but that might not be too hard.

HTH,
Tom