emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] New Exporter html - latex - beamer


From: cberry
Subject: Re: [O] New Exporter html - latex - beamer
Date: Tue, 19 Mar 2013 16:36:12 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Robert Eckl <address@hidden> writes:

> Eric S Fraga <address@hidden> writes:
>
>> Robert Eckl <address@hidden> writes:
>>
>>> I have to provide weekly newsletters in the format pdf and html. Up to
>>> now i did this with exporting to scrartcl, known as koma-script.
>>> Including images is a bit booring because i handle two formats, for example
>>
>> I am not sure what your latex bits are trying to accomplish so it's
>> difficult to advise on how to achieve what you want.  Maybe wrapfigure,
>> which org export supports (float option, I believe, but I am not sure),
>> is what you need instead of "window"?
>
> The latex bits are doing what they should. |-----------------------------|
> I don't want the image floating, because   |                             |
> the text regularly is small. The image     |                             |
> will be placed how you can see here.       |-----------------------------|
> Here the text goes over the complete line - If I'm using a list i have
> to put it in a parbox. The environment window is provided by package
> "picinpar", seems that it not works within beamer.
>
> Perhaps for this yasnippet as recommended from Marcin would be usefull.
>
> OTOH i would like to use beamer in future, Beamer_Col does a similar
> job, except of surrounding the image with text. Does Beamer provide
> something like this?
>
> But, if i write the text for Beamer-Output, i have to handle html-output
> extra. The LaTeX-package "comment" isn't provided by beamer, I don't
> know neither how to comment out the HTML-Code for LaTeX-Beamer-fragments
> nor how to comment out Beamer-Fragments für HTML-Export.
>
> Seems, Beamer+html is much more complicate than Beamer+scrartcl/article.
>


You might be able to do what you want with filter functions.

Suppose you start with this:

(Note: long lines might have been wrapped.)

,----
| #+ATTR_HTML: alt="my altname" title="my full title" align="right" width="30%" 
padding="0em" padding-top="0em"
|[[http://my.com][my place.jpg:windowenv:]]
| More stuff
| - item 1
|   - item 1.1
|   - item 1.2
| #+LATEX: } \end(window}
`----

and want to get this from latex export:


,----
|
\begin{window}[0,r,\href{http://my.com}{\includegraphics[width=0.28\textwidth]{my
 place}},{}]
| \parbox{0.7\textwidth}{
| More stuff
| \begin{itemize}
| \item item 1
| \begin{itemize}
| \item item 1.1
| \item item 1.2
| \end{itemize}
| \end{itemize}
| } \end(window}
`----

and this from html

,----
| <p>
| <a href="http://my.com"; alt="my altname" title="my full title" align="right" 
width="30%" padding="0em" padding-top="0em">my place.jpg</a>
| More stuff
| </p>
| <ul class="org-ul">
| <li>item 1
| <ul class="org-ul">
| <li>item 1.1
| </li>
| <li>item 1.2
| </li>
| </ul>
| </li>
| </ul>
`----

You can do that with this filter:

,----
| #+BEGIN_SRC emacs-lisp
|   (defun filter-links-windowized (link backend info)
|     "Rid :windowenv: from LINK desc and format per BACKEND. Ignore INFO."
|     (let ((clean-string (replace-regexp-in-string ":windowenv:" "" link)))
|       (if (eq backend 'latex)
|           (let ((wprefix "\\begin{window}[0,r,")
|                 (wpostfix"}},{}]\n\\parbox{0.7\\textwidth}{")
|                 (repstrng 
|           "\\1{\\\\includegraphics[width=0.28\\\\textwidth]\\2}"))
|             (concat wprefix
|                     (file-name-sans-extension
|                      (replace-regexp-in-string 
|                       "\\([^}]*}\\)\\({.*}\\)" 
|                       repstrng
|                       clean-string))
|                     wpostfix))
|         clean-string)))
| #+end_src
`----


which you install with this line:

,----
| #+begin_src emacs-lisp :eval never
|   (add-to-list 'org-export-filter-link-functions
'filter-links-windowized)
| #+END_SRC
`----

Then run the new exporter.


What you want yas to provide is something like

,----
| #+ATTR_HTML: alt="" title="" align= ...
| 
| #+LATEX: } \end(window}
`----

if you like to use C-c C-l to enter the link - just remember to add the
:windowenv: after the link description.

or 

,----
| #+ATTR_HTML: alt="my altname" title="my full title" align= ...
| [[ ][  :windowenv:]]
|
| #+LATEX: } \end(window}
`----

if you don't use C-c C-l.


HTH,

Chuck






reply via email to

[Prev in Thread] Current Thread [Next in Thread]