emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [beamer] What is the easiest way to inject latex code between block environments?
@ 2012-04-18  1:08 Mikhail Titov
  2012-04-18  1:19 ` John Hendy
  0 siblings, 1 reply; 5+ messages in thread
From: Mikhail Titov @ 2012-04-18  1:08 UTC (permalink / raw)
  To: emacs-orgmode

Hello!

I would like to explicitly define heights for columns that contain blocks to be able to use \vfill [1] in-between blocks. And here comes the problem. I kind of need to inject

#+latex: \vfill

before new block

** block2

but after \end{block} was emitted, not before. Is there an easy way to approach that?

[1] http://tex.stackexchange.com/questions/15244/why-does-vfill-not-work-inside-a-beamer-column

Mikhail

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [beamer] What is the easiest way to inject latex code between block environments?
  2012-04-18  1:08 [beamer] What is the easiest way to inject latex code between block environments? Mikhail Titov
@ 2012-04-18  1:19 ` John Hendy
  2012-04-18  1:23   ` John Hendy
  0 siblings, 1 reply; 5+ messages in thread
From: John Hendy @ 2012-04-18  1:19 UTC (permalink / raw)
  To: Mikhail Titov; +Cc: emacs-orgmode

On Tue, Apr 17, 2012 at 8:08 PM, Mikhail Titov <mlt@gmx.us> wrote:
> Hello!
>
> I would like to explicitly define heights for columns that contain blocks to be able to use \vfill [1] in-between blocks. And here comes the problem. I kind of need to inject
>
> #+latex: \vfill
>
> before new block
>
> ** block2
>
> but after \end{block} was emitted, not before. Is there an easy way to approach that?

Everything in org-mode gets treated as belonging to the parent
headline. I don't think there's an easy way to do this except by
tweaking the .tex file after export and re-compiling via LaTeX
directly.

I could be wrong, but I believe it's the same principle as why the
answer to these questions is "No":
-- http://orgmode.org/worg/org-faq.html#closing-outline-sections

In other words... everything is always in some headline and what
you're trying to do is escape a headline to enter text in kind of a
"no man's land." Sorry to say, I don't think it's possible.


Best regards,
John

>
> [1] http://tex.stackexchange.com/questions/15244/why-does-vfill-not-work-inside-a-beamer-column
>
> Mikhail
>
>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [beamer] What is the easiest way to inject latex code between block environments?
  2012-04-18  1:19 ` John Hendy
@ 2012-04-18  1:23   ` John Hendy
  2012-04-18  4:46     ` Mikhail Titov
  0 siblings, 1 reply; 5+ messages in thread
From: John Hendy @ 2012-04-18  1:23 UTC (permalink / raw)
  To: Mikhail Titov; +Cc: emacs-orgmode

On Tue, Apr 17, 2012 at 8:19 PM, John Hendy <jw.hendy@gmail.com> wrote:
> On Tue, Apr 17, 2012 at 8:08 PM, Mikhail Titov <mlt@gmx.us> wrote:
>> Hello!
>>
>> I would like to explicitly define heights for columns that contain blocks to be able to use \vfill [1] in-between blocks. And here comes the problem. I kind of need to inject
>>
>> #+latex: \vfill
>>
>> before new block
>>
>> ** block2
>>
>> but after \end{block} was emitted, not before. Is there an easy way to approach that?
>
> Everything in org-mode gets treated as belonging to the parent
> headline. I don't think there's an easy way to do this except by
> tweaking the .tex file after export and re-compiling via LaTeX
> directly.
>
> I could be wrong, but I believe it's the same principle as why the
> answer to these questions is "No":
> -- http://orgmode.org/worg/org-faq.html#closing-outline-sections
>
> In other words... everything is always in some headline and what
> you're trying to do is escape a headline to enter text in kind of a
> "no man's land." Sorry to say, I don't think it's possible.
>

Actually, I was picturing doing this in between /frames/, not blocks.
Since you're in a frame, you can just write the LaTeX syntax directly
inside of your frame headline?

-------------------
* Frame 1
\begin{block}{Block 1}
stuff
\end{block}

\vfill

\begin{block}{Block 2}
more stuff
\end{block}

** Frame 2
------------------

What about that?

John

>
> Best regards,
> John
>
>>
>> [1] http://tex.stackexchange.com/questions/15244/why-does-vfill-not-work-inside-a-beamer-column
>>
>> Mikhail
>>
>>
>>
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [beamer] What is the easiest way to inject latex code between block environments?
  2012-04-18  1:23   ` John Hendy
@ 2012-04-18  4:46     ` Mikhail Titov
  2012-04-19  1:19       ` Mikhail Titov
  0 siblings, 1 reply; 5+ messages in thread
From: Mikhail Titov @ 2012-04-18  4:46 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode@gnu.org

On Apr 17, 2012, at 8:23 PM, John Hendy <jw.hendy@gmail.com> wrote:

> On Tue, Apr 17, 2012 at 8:19 PM, John Hendy <jw.hendy@gmail.com> wrote:
>> On Tue, Apr 17, 2012 at 8:08 PM, Mikhail Titov <mlt@gmx.us> wrote:
>>> Hello!
>>> 
>>> I would like to explicitly define heights for columns that contain blocks to be able to use \vfill [1] in-between blocks. And here comes the problem. I kind of need to inject
>>> 
>>> #+latex: \vfill
>>> 
>>> before new block
>>> 
>>> ** block2
>>> 
>>> but after \end{block} was emitted, not before. Is there an easy way to approach that?
>> 
>> Everything in org-mode gets treated as belonging to the parent
>> headline. I don't think there's an easy way to do this except by
>> tweaking the .tex file after export and re-compiling via LaTeX
>> directly.

That is how I'm proceeding now as I don't have time to hack now:(

>> I could be wrong, but I believe it's the same principle as why the
>> answer to these questions is "No":
>> -- http://orgmode.org/worg/org-faq.html#closing-outline-sections

I wonder if a special case can be made via some extra property and some changes to orgmode code (or with hooks?). It should be possible as I need just quite specific command and not "arbitrary" text embedded. 

>> In other words... everything is always in some headline and what
>> you're trying to do is escape a headline to enter text in kind of a
>> "no man's land." Sorry to say, I don't think it's possible.
>> 
> 
> Actually, I was picturing doing this in between /frames/, not blocks.

That is how beamerposter is organized. 

> Since you're in a frame, you can just write the LaTeX syntax directly
> inside of your frame headline?

I was trying to escape to orgmode from plain latex not to return that far back ;)

M

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [beamer] What is the easiest way to inject latex code between block environments?
  2012-04-18  4:46     ` Mikhail Titov
@ 2012-04-19  1:19       ` Mikhail Titov
  0 siblings, 0 replies; 5+ messages in thread
From: Mikhail Titov @ 2012-04-19  1:19 UTC (permalink / raw)
  To: 'John Hendy'; +Cc: emacs-orgmode

> -----Original Message-----
> From: emacs-orgmode-bounces+mlt=gmx.us@gnu.org [mailto:emacs-orgmode-
> bounces+mlt=gmx.us@gnu.org] On Behalf Of Mikhail Titov
> Sent: Tuesday, April 17, 2012 11:46 PM
> To: John Hendy
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] [beamer] What is the easiest way to inject latex code
between
> block environments?
> 
> >>> I would like to explicitly define heights for columns that contain
blocks
> to be able to use \vfill [1] in-between blocks. And here comes the
problem. I
> kind of need to inject

Here is the dirty hack if someone else is also making posters with orgmode &
beamerposter.
Unfortunately I know AWK better than elisp so don't condemn me :-) It does a
perfect job for me. I don't know if can be hooked to pipe through before
writing TeX output.

----8<----------------------------------------------------------------------
------------------->8---------
#!/usr/bin/awk -f
# Post-process orgmode output before final call to pdflatex while using
beamerposter

BEGIN {
    end_block = 0		# 1 if previous line was \end{block}
    columns = 0			# 1 if probably \vbox will be needed, 2 if
it is needed
    RS = "\r\n"			# I'm on Windows
    height = ".98\\textheight"   # FIXME
}

/^\\frametitle{.+}$/ { next}	# frametitle removal from the only frame

/^\\begin{columns}/ { columns = 1 }
/^\\begin{column}/ && columns { columns = 2 }

/^%% .+/ && columns == 2 { print "\\vbox to " height " {%"; columns = 0 } #
we rely on orgmode comments :(

/^\\end{block}$/ { end_block = 1 }

/^\\begin{block}/ && end_block { print "\\vfill"; end_block = 0 }

/^\\end{column}$/ && end_block { print "}%"; columns = 1; end_block = 0 }

{ print }
----8<----------------------------------------------------------------------
------------------->8---------

Mikhail

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-19  1:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-18  1:08 [beamer] What is the easiest way to inject latex code between block environments? Mikhail Titov
2012-04-18  1:19 ` John Hendy
2012-04-18  1:23   ` John Hendy
2012-04-18  4:46     ` Mikhail Titov
2012-04-19  1:19       ` Mikhail Titov

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).