<[autotemplate]
usepackage={beamerthemeWarsaw}
usepackage=[utf8]{inputenc}
usepackage=[german]{babel}
usepackage=[T1]{fontenc}
title={What's new in 0.7}
subtitle={nowiki, code, autotemplate}
author={Kai Dietrich}
[autotemplate]>

== Overview  ==
==== What's new in 0.7 ====
There are 4 major changes in wiki2beamer 0.7
# @$\backslash$end\{frame\}@ is no longer detected automatically
#* @$\backslash$end\{frame\}@ detection causes semantic misinterpretations in various situations
#* @[frame]>@ is the preferred notation anyway, use it
# the new @<[nowiki] [nowiki]>@ environment allows you the escape from wiki2beamer completly
# the new @<[code] [code]>@ environment allows you to write !animated! code listings
# @autotemplate@ support

== Nowiki-Escaping ==
==== @nowiki@-Environment ====
Sometimes you really don't want wiki2beamer to get in your way.
That's where @nowiki@ steps in:
Use it like an environment to disable all wiki2beamer action in between:
<[nowiki]
{\tt
  $<$[nowiki]  \\
  me@you.com you@me.com \\
  {}[nowiki]$>$
}
[nowiki]>

result without nowiki (notice the changed font):

me@you.com you@me.com

result with nowiki:

<[nowiki]
me@you.com you@me.com
[nowiki]>

== Animated Listings ==
=== Introduction ===
==== ====
\centering

Animated Listings:\\
@<[code] [code]>@

==== The Problem ====
It's a common problem to put source code listings on beamer slides and talk about them to the
audience. To support your talk you will often need to pup-up or partially hide some code.
Doing this in plain \LaTeX{} can be a pain in the ass and a time-consuming task if you don't know
exactly how to do it from the beginning. Also beamer has some problems with verbatim environments
inside slides, so if you've ever tried, you will have given up most certainly.

\vspace{1em}

wiki2beamer solves all these problems by putting together the @listings@-package with some clever
code generation. See what's coming\ldots

=== Syntax ===
==== The Basic Syntax ====
<[code][style=basic,language=java]
==== Title ==== //usual frame title
<\[code\]\[key=value,key=value\] //opens a code block
                       //the key=value list is passed
                       //directly to lstlistings
class Fooo {} //some code
\\[ //\[ and \] have special meanings, to use them
\\] //in the listing, escape them with a \
\[code\]> //closes the code block
[code]>

==== Syntax For Animations ====
<[code][style=basic,language=java]
<\[code\]
some code that appears from start to end |
\[<2>some code that only appears on slide 2\] |
\[<2-4>some code that appears on slides 2, 3 and 4\] |
\[<2,3>some code that appears on slides 2 and 3\] |
\[<1-2,4>some code that appears on slides 1, 2 and 4\] |
\[\[<2>some code      \]\[<4>some other code\]\] |
     //on slide 1 and 3 the empty space
     //will be filled with whitespaces
\[code\]>
[code]>

==== Animation Syntax Example in Action ====
This is the output:
<[code][style=basic]
some code that appears from start to end |
[<2>some code that only appears on slide 2] |
[<2-4>some code that appears on slides 2, 3 and 4] |
[<2,3>some code that appears on slides 2 and 3] |
[<1-2,4>some code that appears on slides 1, 2 and 4] |
[[<2>some code      ][<4>some other code]] |
[code]>

==== Behind the scenes ====
What wiki2beamer does is:
* generate a sequence of listings from the [code] block
* give names to the listings
* put them at the position before the first frame
* put references to the listings in an @overprint-onslide@ on the frame

If you want to find out how this looks, take a look at the @.tex@ output of this presentation.

=== Hello World Example ===
==== Overview ====
So here's how you create animated listings:
# @$\backslash$usepackage\{listings\}@
# write a style definition for @listings@
# write your code, reference to the style
# animate it

==== Defining a style for @listings@ ====
<[code][style=basic,language=TeX,title=\tiny template.tex]
\lstdefinestyle{basic}{%
        captionpos=t,%
	basicstyle=\footnotesize\ttfamily,%
	numberstyle=\tiny,%
	numbers=left,%
	frame=single,%
	showspaces=false,%
	showstringspaces=false,%
	showtabs=false,%
	%
	keywordstyle=\color{blue},%
	identifierstyle=,%
	commentstyle=\color{gray},%
	stringstyle=\color{magenta}%
}
[code]>

==== Writing the code ====
<[code][style=basic,language=TeX]
<\[code\]\[style=basic,language=java,title=HelloWorld.java\]
class HelloWorld {
    public static void main(String args\\[\\]) {
        System.out.println("Hello World!");	
    }
}
\[code\]>
[code]>

==== Animating the code ====
<[code][style=basic,language=TeX]
<\[code\]\[style=basic,language=java,title=HelloWorld.java\]
class HelloWorld {
    \[<2-3>public static void main(String args\\[\\]) {\]
    \[<3>    System.out.println("Hello World!");\]
    \[<2,3>}\]
}
\[code\]>
[code]>

==== The result ====
<[code][style=basic,language=java,title=HelloWorld.java]
class HelloWorld {
    [<2-3>public static void main(String args\[\]) {]
    [<3>    System.out.println("Hello World!");]
    [<2,3>}]
}
[code]>

=== Delaying Animations ===

==== Showing Animated Code later ====
Q: The animation always starts on overlay 1. What can I do to start it later?\\

A: Use @$\backslash$uncover<\ldots>\{\}@

\uncover<2->{
<[code][style=basic,language=java]
\uncover<2->{
[<2-3><\[code\]\[style=basic,language=java\]][<3>
class HelloWorld {
    public static void main(String args\[\]) {
        System.out.println("Hello World!");
    }
}]
[<2-3>\[code\]>]
}
[code]>
}

== Autotemplates ==
=== Introduction ===

==== ====
\centering

Autotemplate-Support

@<[autotemplate] [autotemplate]>@

==== The Problem ====
For \LaTeX beginners it's quite an obstacle to create the template needed to
compile wiki2beamers output. Wouldn't it be nice if wiki2beamer could produce
a complete all-in-one @.tex@ file without the need for a seperate template?

\vspace{1em}

wiki2beamer 0.7 can do exactly that. Let's see how it works\ldots

==== The Solution ====
Put a @<[autotemplate] [autotemplate]>@ section at the beginnung of the
wiki2beamer-file. Wiki2beamer will then put a minimal environment around your
content with all the usepackages and functionality it needs. It will also
provide you with a listings style called "basic".

<[code][style=basic,language=TeX,title=\tiny body.txt]
<\[autotemplate\]
\[autotemplate\]>

==== first slide ====
[code]>

Done.

No really, thats it.

Unless ofcourse you want to have usefull content on your first slide.
=== Syntax ===
==== key=value Commands ====
tuning the default template:
<[code][style=basic,language=TeX,title=\tiny body.txt]
<\[autotemplate\]
%some personal information for the titleframe
title={My Random Talk}
subtitle={about some random stuff}
author={James T. Kork}
usepackage={beamerthemeWarsaw}
\[autotemplate\]>
[code]>

The format of the @autotemplate@ environment is a simple @key=value@ format.
Any unknown key is interpreted as a command, the value is then appended.\\
@date=\{$\backslash$today\}@ becomes @$\backslash$date\{$\backslash$today\}@.

=== Semantics ===
==== defaults ====
wiki2beamer has some some defaults that you can either accept or overwrite.
The default template looks something like:
<[code][style=basic,language=TeX,title=\tiny defaults.txt]
<\[autotemplate\]
documentclass={beamer}
usepackage={listings}
usepackage={color}
usepackage={wasysym}
date={\today}
lstdefinestyle={basic}{...}
titleframe=True
\[autotemplate\]>
[code]>
The @titleframe@-key is special, it tells wiki2beamer to generate the
title frame on it's own.

==== key-handling ====
Keys are handled differently:
# keys that can only have one value (last one use)
#* @documentclass@
#* @titleframe@
# keys that can have multiple values
#* all unknown keys
#* @usepackage@

@usepackage@ is special in a way that only the last
occurence of the package counts (you can give multiple option-sets ala
@usepackage=[utf8]\{inputenc\}@\\
@usepackage=[latin1]\{inputenc\}@\\
Latin1 will be the option passed to inputenc in the \LaTeX{} output.

==== ====
\centering\huge

Please spread the word! :-) %

