* Help with beamer environments @ 2013-06-20 8:09 Vikas Rawal 2013-06-26 13:53 ` Help with beamer environments + org-special-blocks! Sebastien Vauban 0 siblings, 1 reply; 11+ messages in thread From: Vikas Rawal @ 2013-06-20 8:09 UTC (permalink / raw) To: emacs-orgmode I am trying to use textpos to position images at specific location on a frame. I would like something like this in the beamer export: \begin{textblock}{10}(3,3) \visible <2-> { \includegraphics[width=.9\linewidth]{scatterplot2.png} } \end{textblock} I have defined the following beamer environment. (add-to-list 'org-beamer-environments-extra '("textpos1" "w" "\\begin{textblock}{%h}(3,3) \\visible %a {" "} \\end{textblock}")) The problem is (3,3) is fixed in the above specification. How can I specify it for a given headline? I have tried various ways of generalising this but nothing seems to work. For example, if I use the following: (add-to-list 'org-beamer-environments-extra '("textpos1" "w" "\\begin{textblock}%h \\visible %a {" "} \\end{textblock}")) and write the headline as {10}(3,3), I get \{10\}(3,3) in beamer export rather than {10}(3,3). How does one use the escape %o? I have looked through ox-beamer.el, worg and mailing list archives, but could not find a clear explanation. Will be grateful for a pointer. Vikas ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Help with beamer environments + org-special-blocks! 2013-06-20 8:09 Help with beamer environments Vikas Rawal @ 2013-06-26 13:53 ` Sebastien Vauban 2013-06-26 14:29 ` Nicolas Goaziou 0 siblings, 1 reply; 11+ messages in thread From: Sebastien Vauban @ 2013-06-26 13:53 UTC (permalink / raw) To: emacs-orgmode-mXXj517/zsQ Hi Vikas, Vikas Rawal wrote: > I am trying to use textpos to position images at specific location on > a frame. I now use TikZ to do that. I have the impression it is easier. Though, I have the real impression of writing LaTeX inside an Org buffer... which I dislike. I'd like to write text as text, and still get the ability to convert that to HTML, for review, even if the layout wouldn't be (at all) the same. > I would like something like this in the beamer export: > > \begin{textblock}{10}(3,3) \visible <2-> { > \includegraphics[width=.9\linewidth]{scatterplot2.png} > } \end{textblock} > > I have defined the following beamer environment. > > (add-to-list 'org-beamer-environments-extra > '("textpos1" "w" "\\begin{textblock}{%h}(3,3) \\visible %a {" "} \\end{textblock}")) You normally could use such a block (the old "org-special-blocks", now integrated in Org 8 -- thanks Nicolas): --8<---------------cut here---------------start------------->8--- #+begin_textblock Contents #+end_textblock --8<---------------cut here---------------end--------------->8--- > The problem is (3,3) is fixed in the above specification. How can I > specify it for a given headline? I have tried various ways of > generalising this but nothing seems to work. > > For example, if I use the following: > > (add-to-list 'org-beamer-environments-extra > '("textpos1" "w" "\\begin{textblock}%h \\visible %a {" "} \\end{textblock}")) > > and write the headline as {10}(3,3), I get \{10\}(3,3) in beamer > export rather than {10}(3,3). Though, the problem stays the same with what I think is the right way to do it... See how Org gets converted to LaTeX: --8<---------------cut here---------------start------------->8--- #+begin_myenvironment \begin{myenvironment} Test of a new Test of a new environment. environment. #+end_myenvironment \end{myenvironment} --8<---------------cut here---------------end--------------->8--- That's OK. But the environment had no parameters. --8<---------------cut here---------------start------------->8--- #+begin_myenvironment{3} \#+begin\_myenvironment\{3\} Test of a new Test of a new environment. environment. #+end_myenvironment \#+end\_myenvironment --8<---------------cut here---------------end--------------->8--- That's completely invalid LaTeX. --8<---------------cut here---------------start------------->8--- #+begin_myenvironment {3} \begin{myenvironment} Test of a new Test of a new environment. environment. #+end_myenvironment \end{myenvironment} --8<---------------cut here---------------end--------------->8--- That's valid LaTeX, but the arguments of the environment have been ignored! IIRC, that's how we did before, with the original `org-special-blocks' file. > How does one use the escape %o? I have looked through ox-beamer.el, > worg and mailing list archives, but could not find a clear > explanation. Will be grateful for a pointer. I've no idea. I wonder as well how we do this. Best regards, Seb -- Sebastien Vauban ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Help with beamer environments + org-special-blocks! 2013-06-26 13:53 ` Help with beamer environments + org-special-blocks! Sebastien Vauban @ 2013-06-26 14:29 ` Nicolas Goaziou 2013-06-27 10:03 ` Sebastien Vauban 0 siblings, 1 reply; 11+ messages in thread From: Nicolas Goaziou @ 2013-06-26 14:29 UTC (permalink / raw) To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ Hello, "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org> writes: > Vikas Rawal wrote: >> For example, if I use the following: >> >> (add-to-list 'org-beamer-environments-extra >> '("textpos1" "w" "\\begin{textblock}%h \\visible %a {" "} \\end{textblock}")) >> >> and write the headline as {10}(3,3), I get \{10\}(3,3) in beamer >> export rather than {10}(3,3). I think we should changes some environment placeholders: + Introduce %r which would stand for the raw headline (without any processing) + %H and %U would use the raw headline text instead. The previous definition would become: '("textpos1" "w" "\\begin{textblock}%r \\visible %a {" "} \\end{textblock}") WDYT? > #+begin_myenvironment{3} \#+begin\_myenvironment\{3\} > Test of a new Test of a new > environment. environment. > #+end_myenvironment \#+end\_myenvironment This should work with a recent Org. There is also: #+attr_latex: :options {3} #+begin_myenvironment Test of a new environment #+end_myenvironment Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Help with beamer environments + org-special-blocks! 2013-06-26 14:29 ` Nicolas Goaziou @ 2013-06-27 10:03 ` Sebastien Vauban 2013-06-27 12:09 ` Nicolas Goaziou 0 siblings, 1 reply; 11+ messages in thread From: Sebastien Vauban @ 2013-06-27 10:03 UTC (permalink / raw) To: emacs-orgmode-mXXj517/zsQ Hello Nicolas, Nicolas Goaziou wrote: > "Sebastien Vauban" writes: >> Vikas Rawal wrote: > >>> For example, if I use the following: >>> >>> (add-to-list 'org-beamer-environments-extra >>> '("textpos1" "w" "\\begin{textblock}%h \\visible %a {" "} >>> \\end{textblock}")) >>> >>> and write the headline as {10}(3,3), I get \{10\}(3,3) in beamer >>> export rather than {10}(3,3). > > I think we should changes some environment placeholders: > > + Introduce %r which would stand for the raw headline (without any > processing) > + %H and %U would use the raw headline text instead. > > The previous definition would become: > > '("textpos1" "w" "\\begin{textblock}%r \\visible %a {" "} \\end{textblock}") > > WDYT? I'm not sure to understand. Where would he put his options? Directly on the heading line, with no "text", then? Something like this: --8<---------------cut here---------------start------------->8--- ** {10}(3,3) :textpos1: Contents to position at some (x,y) coordinates... --8<---------------cut here---------------end--------------->8--- >> #+begin_myenvironment{3} \#+begin\_myenvironment\{3\} >> Test of a new Test of a new >> environment. environment. >> #+end_myenvironment \#+end\_myenvironment > > This should work with a recent Org. What do you call a recent Org? I'm blocked on commit 26a9b02, from May 27th, as long as the #+SETUPFILE: bug is not fixed (fontification is broken). So, is that one (4 weeks old) a recent Org? > There is also: > > #+attr_latex: :options {3} > #+begin_myenvironment > Test of a new > environment > #+end_myenvironment Aahh! I wasn't aware (enough) of that way to pass my arguments to my own environments. Thanks a lot, that works like a charm! Best regards, Seb -- Sebastien Vauban ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Help with beamer environments + org-special-blocks! 2013-06-27 10:03 ` Sebastien Vauban @ 2013-06-27 12:09 ` Nicolas Goaziou 2013-06-27 15:31 ` Sebastien Vauban 2013-06-28 9:48 ` Sebastien Vauban 0 siblings, 2 replies; 11+ messages in thread From: Nicolas Goaziou @ 2013-06-27 12:09 UTC (permalink / raw) To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ Hello, "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org> writes: > Nicolas Goaziou wrote: >> The previous definition would become: >> >> '("textpos1" "w" "\\begin{textblock}%r \\visible %a {" "} \\end{textblock}") >> >> WDYT? > > I'm not sure to understand. Where would he put his options? Directly on the > heading line, with no "text", then? > > Something like this: > > ** {10}(3,3) :textpos1: > > Contents to position > at some (x,y) coordinates... Correct. > What do you call a recent Org? I'm blocked on commit 26a9b02, from May 27th, > as long as the #+SETUPFILE: bug is not fixed (fontification is broken). > > So, is that one (4 weeks old) a recent Org? No. I fixed it ten days ago (dffdc49). Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Help with beamer environments + org-special-blocks! 2013-06-27 12:09 ` Nicolas Goaziou @ 2013-06-27 15:31 ` Sebastien Vauban 2013-06-27 16:18 ` Nicolas Goaziou 2013-06-29 12:45 ` Nicolas Goaziou 2013-06-28 9:48 ` Sebastien Vauban 1 sibling, 2 replies; 11+ messages in thread From: Sebastien Vauban @ 2013-06-27 15:31 UTC (permalink / raw) To: emacs-orgmode-mXXj517/zsQ Hello Nicolas, Nicolas Goaziou wrote: > "Sebastien Vauban" writes: >> Nicolas Goaziou wrote: >>> The previous definition would become: >>> >>> '("textpos1" "w" "\\begin{textblock}%r \\visible %a {" "} \\end{textblock}") >>> >>> WDYT? >> >> I'm not sure to understand. Where would he put his options? Directly on the >> heading line, with no "text", then? >> >> Something like this: >> >> ** {10}(3,3) :textpos1: >> >> Contents to position >> at some (x,y) coordinates... > > Correct. I think this is quite elegant... With what you say below, we then have 3 different solutions (at least) for new environments: - the one above, where you add a new environment definition (but, then, it's kind of private for your own files; difficult to share) - the Org special blocks, ancient way, which you've fixed #+begin_myenv{2cm} Contents... #+end_myenv - the Org special blocks, new way, with the OPTIONS #+LaTeX_ATTR: :options {2cm} #+begin_myenv{2cm} Contents... #+end_myenv Now, a big question: outside the fact that some such "standards" (like "texpos1") would have to be added IMHO as default Beamer environments, what about standard LaTeX? I think normal, then, to wanna get that same behavior in the LaTeX backend. How to do that? I'm a bit puzzled by the differences to get some similar results... - In LaTeX, you have the inline tasks which can be used to insert blocks, but not the system where you create blocks by adding an "ignoreheading" heading, right? - In Beamer, we have both? And, for whatever reason (which must escape me), we tend to prefer the "ignoreheading" for closing a block. In my latest slides, I've been quite disturbed by how much "pure LaTeX" I've finally inserted in my slides, for inserting TikZ nodes to render boxes. I had the impression to write LaTeX inside an Org file; and that's not the right approach: - too much LaTeX tag overload, - no HTML equivalent for the contents of my boxes -- while, as presented here above for the "textpos", even in HTML, it'd be quite nice. - no Org syntax usable: inside my boxes (TikZ nodes), I had to use \textbf for bold, not the stars... Now, there are, once again, other extra solutions: MACRO and Org Babel calls. Too much solutions... >> What do you call a recent Org? I'm blocked on commit 26a9b02, from May 27th, >> as long as the #+SETUPFILE: bug is not fixed (fontification is broken). >> >> So, is that one (4 weeks old) a recent Org? > > No. I fixed it ten days ago (dffdc49). OK, thanks! Best regards, Seb -- Sebastien Vauban ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Help with beamer environments + org-special-blocks! 2013-06-27 15:31 ` Sebastien Vauban @ 2013-06-27 16:18 ` Nicolas Goaziou 2013-06-29 12:45 ` Nicolas Goaziou 1 sibling, 0 replies; 11+ messages in thread From: Nicolas Goaziou @ 2013-06-27 16:18 UTC (permalink / raw) To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ Hello, "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org> writes: > With what you say below, we then have 3 different solutions (at least) for new > environments: > > - the one above, where you add a new environment definition (but, then, it's > kind of private for your own files; difficult to share) If you use advanced features of Org, you're more or less bound to share your documents with a config file anyway. [...] > > - the Org special blocks, new way, with the OPTIONS > > #+LaTeX_ATTR: :options {2cm} > #+begin_myenv{2cm} > Contents... > #+end_myenv Correction: #+attr_latex: :options {2cm} #+begin_myenv Contents... #+end_myenv > Now, a big question: outside the fact that some such "standards" (like > "texpos1") would have to be added IMHO as default Beamer environments, what > about standard LaTeX? > > I think normal, then, to wanna get that same behavior in the LaTeX backend. > How to do that? I'm a bit puzzled by the differences to get some similar > results... > > - In LaTeX, you have the inline tasks which can be used to insert blocks, but > not the system where you create blocks by adding an "ignoreheading" heading, > right? > > - In Beamer, we have both? And, for whatever reason (which must escape me), > we tend to prefer the "ignoreheading" for closing a block. I don't understand your question. Equivalent blocks do not exist in standard LaTeX, do they? Also, this has nothing to do with inlinetasks. In Beamer export, headlines can generate blocks. This is handy because they can be easily nested, accept properties through drawers, etc. Special blocks are more limited. Though, you cannot close a headline, so the "ignoreheading" trick was implemented. In LaTeX export, headlines generate headlines. > In my latest slides, I've been quite disturbed by how much "pure LaTeX" I've > finally inserted in my slides, for inserting TikZ nodes to render boxes. I had > the impression to write LaTeX inside an Org file; and that's not the right > approach: > > - too much LaTeX tag overload, > > - no HTML equivalent for the contents of my boxes -- while, as presented here > above for the "textpos", even in HTML, it'd be quite nice. > > - no Org syntax usable: inside my boxes (TikZ nodes), I had to use \textbf for > bold, not the stars... I think you are asking too much for Org syntax. > Now, there are, once again, other extra solutions: MACRO and Org Babel > calls. Indeed. Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Help with beamer environments + org-special-blocks! 2013-06-27 15:31 ` Sebastien Vauban 2013-06-27 16:18 ` Nicolas Goaziou @ 2013-06-29 12:45 ` Nicolas Goaziou 1 sibling, 0 replies; 11+ messages in thread From: Nicolas Goaziou @ 2013-06-29 12:45 UTC (permalink / raw) To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ Hello, "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org> writes: > Nicolas Goaziou wrote: >> "Sebastien Vauban" writes: >>> Something like this: >>> >>> ** {10}(3,3) :textpos1: >>> >>> Contents to position >>> at some (x,y) coordinates... >> >> Correct. > > I think this is quite elegant... Applied. Please report back here if you encounter any problem. Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Help with beamer environments + org-special-blocks! 2013-06-27 12:09 ` Nicolas Goaziou 2013-06-27 15:31 ` Sebastien Vauban @ 2013-06-28 9:48 ` Sebastien Vauban 2013-06-28 23:18 ` Nicolas Goaziou 1 sibling, 1 reply; 11+ messages in thread From: Sebastien Vauban @ 2013-06-28 9:48 UTC (permalink / raw) To: emacs-orgmode-mXXj517/zsQ Hello Nicolas, Nicolas Goaziou wrote: >> What do you call a recent Org? I'm blocked on commit 26a9b02, from May 27th, >> as long as the #+SETUPFILE: bug is not fixed (fontification is broken). >> >> So, is that one (4 weeks old) a recent Org? > > No. I fixed it ten days ago (dffdc49). Though I'm now on Org-mode version 8.0.3 (release_8.0.3-295-g91a4c8), pulled this morning, I don't see it fixed. Here an ECM: --8<---------------cut here---------------start------------->8--- #+TITLE: ECM Arguments for environments #+Time-stamp: <2013-06-28 Fri 11:42> * Tables ** Via Options attribute -- OK #+TBLNAME: table1 #+ATTR_LaTeX: :options {-2.5cm}{0cm} #+begin_mychangemargin | a | very | very | ... | very | wide | table | #+end_mychangemargin ** On the environment opening, with no space -- Invalid LaTeX #+TBLNAME: table2 #+begin_mychangemargin{-2.5cm}{0cm} | a | very | very | ... | very | wide | table | #+end_mychangemargin ** On the environment opening, with a space separator -- Argument ignored #+TBLNAME: table3 #+begin_mychangemargin {-2.5cm}{0cm} | a | very | very | ... | very | wide | table | #+end_mychangemargin --8<---------------cut here---------------end--------------->8--- The resulting LaTeX: --8<---------------cut here---------------start------------->8--- % ... \section{Tables} \label{sec-1} \subsection{Via Options attribute -- OK} \label{sec-1-1} \begin{mychangemargin}{-2.5cm}{0cm} \label{table1} \begin{center} \begin{tabular}{lllllll} a & very & very & \ldots{} & very & wide & table\\ \end{tabular} \end{center} \end{mychangemargin} \subsection{On the environment opening, with no space -- Invalid \LaTeX{}} \label{sec-1-2} \#+begin\_mychangemargin\{-2.5cm\}\{0cm\} \begin{center} \begin{tabular}{lllllll} a & very & very & \ldots{} & very & wide & table\\ \end{tabular} \end{center} \#+end\_mychangemargin \subsection{On the environment opening, with a space separator -- Argument ignored} \label{sec-1-3} \begin{mychangemargin} \label{table3} \begin{center} \begin{tabular}{lllllll} a & very & very & \ldots{} & very & wide & table\\ \end{tabular} \end{center} \end{mychangemargin} % Emacs 24.3.50.1 (Org mode 8.0.3) \end{document} --8<---------------cut here---------------end--------------->8--- Best regards, Seb -- Sebastien Vauban ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Help with beamer environments + org-special-blocks! 2013-06-28 9:48 ` Sebastien Vauban @ 2013-06-28 23:18 ` Nicolas Goaziou 2013-06-29 8:05 ` Sebastien Vauban 0 siblings, 1 reply; 11+ messages in thread From: Nicolas Goaziou @ 2013-06-28 23:18 UTC (permalink / raw) To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ Hello, "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org> writes: >> No. I fixed it ten days ago (dffdc49). > > Though I'm now on Org-mode version 8.0.3 (release_8.0.3-295-g91a4c8), pulled > this morning, I don't see it fixed. I realize that the patch won't fix it. This patch was introduced to allow something like: #+begin_figure* ... #+end_figure* again. But it still expects the same string after the "begin_" and the "end_". In this case strings are different because of the arguments to the environment. Therefore, the correct way to set this is using the #+attr_latex line, as in your first case. I hope it is less confusing now. Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Help with beamer environments + org-special-blocks! 2013-06-28 23:18 ` Nicolas Goaziou @ 2013-06-29 8:05 ` Sebastien Vauban 0 siblings, 0 replies; 11+ messages in thread From: Sebastien Vauban @ 2013-06-29 8:05 UTC (permalink / raw) To: emacs-orgmode-mXXj517/zsQ Hello Nicolas, Nicolas Goaziou wrote: > "Sebastien Vauban" writes: > >>> No. I fixed it ten days ago (dffdc49). >> >> Though I'm now on Org-mode version 8.0.3 (release_8.0.3-295-g91a4c8), pulled >> this morning, I don't see it fixed. > > I realize that the patch won't fix it. This patch was introduced to > allow something like: > > #+begin_figure* > ... > #+end_figure* > > again. But it still expects the same string after the "begin_" and the > "end_". In this case strings are different because of the arguments to > the environment. > > Therefore, the correct way to set this is using the #+attr_latex line, > as in your first case. > > I hope it is less confusing now. It is. And one solution is enough... ;-) Moreover, I guess putting the arguments on a LaTeX line makes it more portable: what would happen with those arguments for HTML, for example? Here, a simple "mychangemargin" DIV won't hurt. Best regards, Seb -- Sebastien Vauban ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-06-29 12:45 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-06-20 8:09 Help with beamer environments Vikas Rawal 2013-06-26 13:53 ` Help with beamer environments + org-special-blocks! Sebastien Vauban 2013-06-26 14:29 ` Nicolas Goaziou 2013-06-27 10:03 ` Sebastien Vauban 2013-06-27 12:09 ` Nicolas Goaziou 2013-06-27 15:31 ` Sebastien Vauban 2013-06-27 16:18 ` Nicolas Goaziou 2013-06-29 12:45 ` Nicolas Goaziou 2013-06-28 9:48 ` Sebastien Vauban 2013-06-28 23:18 ` Nicolas Goaziou 2013-06-29 8:05 ` Sebastien Vauban
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.