emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: cberry@ucsd.edu
To: emacs-orgmode@gnu.org
Subject: Re: New Exporter html - latex - beamer
Date: Tue, 19 Mar 2013 16:36:12 -0700	[thread overview]
Message-ID: <87620nc68j.fsf@tajo.ucsd.edu> (raw)
In-Reply-To: m2hak7i4ug.fsf@sachwertpartner.de

Robert Eckl <eckl.r@gmx.de> writes:

> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> Robert Eckl <eckl.r@gmx.de> 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	other threads:[~2013-03-19 23:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15 20:55 New Exporter html - latex - beamer Robert Eckl
2013-03-15 21:21 ` Marcin Borkowski
2013-03-17 13:18 ` Eric S Fraga
2013-03-19 19:09   ` Robert Eckl
2013-03-19 23:36     ` cberry [this message]
2013-03-20 14:16       ` Charles Berry
2013-03-25 22:39         ` Robert Eckl
2013-03-20  8:43     ` Eric S Fraga

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=87620nc68j.fsf@tajo.ucsd.edu \
    --to=cberry@ucsd.edu \
    --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).