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

2013-03-25 Thread Robert Eckl
Charles Berry  writes:

>   ucsd.edu> writes:
>
>> 
>> Robert Eckl  gmx.de> writes:
>> 
> [snip]
>> 
>
> I said
>
>> You might be able to do what you want with filter functions.
>> 
>
>> 
>> You can do that with this filter:
>> 
>
> But you will want to add something to it to treat links without the 
> :windowenv:
> tag in the normal way
>
>> ,
>> | #+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)))
>
> Replace this line:
>
>> |   (if (eq backend 'latex)
>
> with these:
>
>   (if (and
>(eq backend 'latex)
>(string-match ":windowenv:" link))
>   
>
>
>> |   (let ((wprefix "\\begin{window}[0,r,")
>> | (wpostfix"}},{}]\n\\parbox{0.7\\textwidth}{")
>> | (repstrng 
>> |   "\\1{includegraphics[width=0.28textwidth]\\2}"))
>> | (concat wprefix
>> | (file-name-sans-extension
>> |  (replace-regexp-in-string 
>> |   "\\([^}]*}\\)\\({.*}\\)" 
>> |   repstrng
>> |   clean-string))
>> | wpostfix))
>> | clean-string)))
>> | #+end_src
>> `
>
> then ordinary links like
>
>[[http://good.place.com][See good place]]
>
> will be handled in the usual manner by the latex backend

My response is very late, sorry.

Thank you for your effort and the code. I'll try to use it, sounds good.
Reading from filters on worg didn't give me any idea how to use it, 
but your code and explanations seems a good entry.

Perhaps later i'll try to adapt that functionality to the parallel
beamer/html-export. 

Cu,
Robert



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

2013-03-20 Thread Charles Berry
  ucsd.edu> writes:

> 
> Robert Eckl  gmx.de> writes:
> 
[snip]
> 

I said

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

> 
> You can do that with this filter:
> 

But you will want to add something to it to treat links without the :windowenv:
tag in the normal way

> ,
> | #+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)))

Replace this line:

> |   (if (eq backend 'latex)

with these:

  (if (and
   (eq backend 'latex)
   (string-match ":windowenv:" link))
  


> |   (let ((wprefix "\\begin{window}[0,r,")
> | (wpostfix"}},{}]\n\\parbox{0.7\\textwidth}{")
> | (repstrng 
> |   "\\1{includegraphics[width=0.28textwidth]\\2}"))
> | (concat wprefix
> | (file-name-sans-extension
> |  (replace-regexp-in-string 
> |   "\\([^}]*}\\)\\({.*}\\)" 
> |   repstrng
> |   clean-string))
> | wpostfix))
> | clean-string)))
> | #+end_src
> `

then ordinary links like

   [[http://good.place.com][See good place]]

will be handled in the usual manner by the latex backend

Chuck






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

2013-03-19 Thread cberry
Robert Eckl  writes:

> Eric S Fraga  writes:
>
>> Robert Eckl  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

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

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.28textwidth]\\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






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

2013-03-19 Thread Robert Eckl
Eric S Fraga  writes:

> Robert Eckl  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.

Thanks,

Robert



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

2013-03-17 Thread Eric S Fraga
Robert Eckl  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"?

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_8.0-pre-107-g91a6ca




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

2013-03-15 Thread Marcin Borkowski
Dnia 2013-03-15, o godz. 21:55:42
Robert Eckl  napisał(a):

> Both, the old and the new Exporter are brilliant tools, migration to
> the new exporter didn't make great issues.
> 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
> 
> #+BEGIN_SRC Org
> #+BEGIN_LaTeX 
>   
> \begin{window}[0,r,\href{http://www.link.de}{\includegraphics[width=0.28\textwidth]{path/picture}},{}]
>   \begin{comment}
> #+END_LaTeX
> #+ATTR_HTML: alt="Objekt" title="Objektansicht" align="right"
> width="30%" padding="0em"
> padding-top="0em" 
> [[http://www.link.de/][http://www.link.de/path/images/picture.jpg]]
> #+BEGIN_LaTeX \end{comment}
>   \parbox{0.7\textwidth}{
> #+END_LaTeX
>   Any Text
>- item 1
>- item 2
>- item 3
> #+BEGIN_LaTeX
>   }
>   \end{window}
> #+END_LaTeX
> #+END_SRC
> 
> It works, but it's a bit boring. The parbox only is required with
> lists.
> Now i plan to use Beamer, possible instead of scrarctl. 
> If I use BEAMER_col the titles ignored by beamer will exported in
> html - format.
> 
> Perhaps someone can give me a hint how to deal with this, perhaps 
>  - a comment-environment for HTML how i used for LaTeX or
>  - write the BMCOL-Environment manually in an LaTeX-Block?

This is not even a decent answer, but in a pinch you might define a
yasnippet for this.  (A decent answer would be to use some kind of a
preprocessor, a good answer would be to use a preprocessor in Elisp,
and the best answer would include its code;).)

> TIA,
> 
> Robert

Regards,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



[O] New Exporter html - latex - beamer

2013-03-15 Thread Robert Eckl
Both, the old and the new Exporter are brilliant tools, migration to the
new exporter didn't make great issues.
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

#+BEGIN_SRC Org
#+BEGIN_LaTeX 
  
\begin{window}[0,r,\href{http://www.link.de}{\includegraphics[width=0.28\textwidth]{path/picture}},{}]
  \begin{comment}
#+END_LaTeX
#+ATTR_HTML: alt="Objekt" title="Objektansicht" align="right" width="30%" 
padding="0em" padding-top="0em"
[[http://www.link.de/][http://www.link.de/path/images/picture.jpg]]
#+BEGIN_LaTeX
  \end{comment}
  \parbox{0.7\textwidth}{
#+END_LaTeX
  Any Text
   - item 1
   - item 2
   - item 3
#+BEGIN_LaTeX
  }
  \end{window}
#+END_LaTeX
#+END_SRC

It works, but it's a bit boring. The parbox only is required with
lists.
Now i plan to use Beamer, possible instead of scrarctl. 
If I use BEAMER_col the titles ignored by beamer will exported in html -
format.

Perhaps someone can give me a hint how to deal with this, perhaps 
 - a comment-environment for HTML how i used for LaTeX or
 - write the BMCOL-Environment manually in an LaTeX-Block?

TIA,

Robert