emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Mikhail Titov" <mlt@gmx.us>
To: 'John Hendy' <jw.hendy@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [beamer] What is the easiest way to inject latex code	between block environments?
Date: Wed, 18 Apr 2012 20:19:30 -0500	[thread overview]
Message-ID: <004301cd1dca$79505700$6bf10500$@us> (raw)
In-Reply-To: <C25C19CA-4684-4736-A4BA-60430C0B8778@gmx.us>

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

      reply	other threads:[~2012-04-19  1:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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='004301cd1dca$79505700$6bf10500$@us' \
    --to=mlt@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    --cc=jw.hendy@gmail.com \
    /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).