├── .gitignore ├── Makefile ├── README.md ├── compile.pl ├── example.pdf ├── example.tex ├── figures ├── band02.png ├── band08.png ├── cnontrivial.pdf ├── ctrivial.pdf ├── qahe.pdf ├── qshe.pdf ├── skyrmion.pdf └── trivial.pdf ├── gridslides.cls ├── gridslides.pdf └── gridslides.sty /.gitignore: -------------------------------------------------------------------------------- 1 | *.fdb_latexmk 2 | *.dep 3 | *.dpth 4 | *.bcf 5 | *.aux 6 | *.auxlock 7 | *.toc 8 | *.log 9 | *.out 10 | *.bbl 11 | *.blg 12 | *.nav 13 | *.snm 14 | *-blx.bib 15 | *.run.xml 16 | *.tmp 17 | *.tmptex 18 | *.lot 19 | *.lof 20 | *.fls 21 | pgfshell_* 22 | *-figure*.dep 23 | *-figure*.dpth 24 | *-figure*.pdf 25 | *-figure*.md5 26 | *Notes.bib 27 | *~ 28 | .~lock* 29 | .directory 30 | core 31 | .#* 32 | *.idx 33 | *.ilg 34 | *.ind 35 | *.nlo 36 | *.nls 37 | *.glsdefs 38 | auto 39 | output 40 | gridslides 41 | gridslides.zip 42 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Package: gridslides 2 | # Description: LaTeX package to create free form slides with blocks placed on a grid 3 | # File: Makefile 4 | # Author: Daniel Mendler 5 | # Version: 0.1.1 6 | # Date: 2017-11-28 7 | # License: GPL2 or LPPL1.3 at your option 8 | # Homepage: https://github.com/minad/gridslides 9 | 10 | example.pdf: example.tex 11 | ./compile.pl --once example.tex 12 | 13 | clean: 14 | rm -rf auto output example.pdf gridslides.zip gridslides gridslides.pdf 15 | 16 | gridslides.pdf: README.md 17 | pandoc README.md -o gridslides.pdf 18 | 19 | dist: gridslides.pdf example.pdf *.cls *.sty README.md 20 | for i in $$(git ls-files | grep -v .gitignore); do mkdir -p gridslides/$$(dirname $$i); cp $$i gridslides/$$i; done 21 | zip -r gridslides.zip gridslides 22 | rm -rf gridslides 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gridslides: LaTeX package to create free form slides with blocks placed on a grid 2 | 3 | This package allows to create free form slides with blocks placed on a grid. 4 | The blocks can be filled with text, equations, figures etc. 5 | This allows more flexible slides similar compared to LaTeX beamer. 6 | Sequential unconvering of elements is supported. 7 | A compiler script is provided which compiles each slide separately, avoiding long compile times this way. 8 | 9 | ## Example 10 | 11 | See the file `example.tex` and `example.pdf`. Each slide is compiled separately using `compile.pl example.tex`. 12 | 13 | ## Supported commands 14 | 15 | This package provides only a handful of commands, which 16 | allow to create slides and with blocks at fixed positions. 17 | 18 | ### Slides/Pages 19 | 20 | ```latex 21 | \begin{slide}{Slide title} 22 | Slide content 23 | \end{slide} 24 | 25 | \begin{rawslide} 26 | Raw slide without title and style 27 | \end{rawslide} 28 | 29 | \begin{style} 30 | Define style which underlies all slides. 31 | Best used together with \bg{filename}! 32 | \end{style} 33 | 34 | \begin{style} 35 | \bg{figure-filename} 36 | \end{style} 37 | ``` 38 | 39 | ### Slide content blocks 40 | 41 | The slide is divided in a 32x24 grid. 42 | 43 | ```latex 44 | \bg{figure-filename} 45 | \txt(x,y){Text content} 46 | \block(x,y,w){Arbitrary content} 47 | \fig(x,y,w){figure-filename} 48 | \eq(x,y){a^2 + b^2 = c^2} 49 | ``` 50 | 51 | ### Sequential uncovering 52 | 53 | Each slide can be split in multiple steps by defining blocks with `` annotations. 54 | 55 | ```latex 56 | \txt<1->(x,y){On slide step 1 to n} 57 | \block<2>(x,y,w){Only on step 2} 58 | \only<2-3>{ 59 | \block(x,y){Block content} 60 | } 61 | ``` 62 | 63 | ### Metadata 64 | 65 | ```latex 66 | \author{Author} defines \theauthor 67 | \title{Presentation Title} defines \thetitle 68 | \date{Date} defines \thedate 69 | \institute{Institute} defines \theinstitute 70 | \theheadline defined by slide title 71 | \theslide defined by slide number 72 | ``` 73 | 74 | ### Supported options 75 | 76 | See `example.tex` for usage. 77 | 78 | * `blocks`, `grid` - Show grid and blocks for debugging 79 | * `xsteps`, `ysteps` - Number of grid steps 80 | * `gridsize` - Size of the grid 81 | 82 | ## Alternatives 83 | 84 | * beamer 85 | * ffslides 86 | * prosper 87 | * pure tikz or pstricks 88 | 89 | ## License 90 | 91 | Copyright (c) 2017 Daniel Mendler. The package is dual-licensed 92 | under the GNU General Public License, version 2 and 93 | the LaTeX Project Public License 1.3 at your option. 94 | -------------------------------------------------------------------------------- /compile.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # Package: gridslides 3 | # Description: LaTeX package to create free form slides with blocks placed on a grid 4 | # File: compile.pl 5 | # Author: Daniel Mendler 6 | # Version: 0.1.1 7 | # Date: 2017-11-28 8 | # License: GPL2 or LPPL1.3 at your option 9 | # Homepage: https://github.com/minad/gridslides 10 | 11 | use strict; 12 | use Digest::MD5 qw(md5_hex); 13 | use File::Slurp qw(read_file write_file); 14 | 15 | sub load_file { 16 | my ($file) = @_; 17 | my $code = read_file($file); 18 | $code =~ /\A(.*?\\begin\{document\})/s; 19 | return ($1, $'); 20 | } 21 | 22 | sub compile_slide { 23 | my ($format, $slide, $body) = @_; 24 | 25 | my $code = "%&$format\n\\begin{document}\\setcounter{slide}{$slide}\n$body\n\\end{document}\n"; 26 | my $hash = md5_hex($code); 27 | my $pdf = "$hash.pdf"; 28 | unless (-e $pdf) { 29 | my $tex = "$hash.tex"; 30 | write_file($tex, $code); 31 | print "Compiling slide $slide - $tex...\n"; 32 | `pdflatex -interaction=batchmode $tex; biber $hash; pdflatex -interaction=batchmode $tex; pdflatex -interaction=batchmode $tex`; 33 | } 34 | 35 | return $pdf; 36 | } 37 | 38 | my $once = 0; 39 | my $file; 40 | if ($ARGV[0] eq "--once") { 41 | $file = $ARGV[1]; 42 | $once = 1; 43 | } else { 44 | $file = $ARGV[0]; 45 | } 46 | 47 | my $result = $file; 48 | $result =~ s/\.tex\Z//g; 49 | $result .= '.pdf'; 50 | 51 | my $out = 'output'; 52 | mkdir($out); 53 | chdir($out); 54 | $ENV{TEXINPUTS}='..:.:'; 55 | $ENV{BIBINPUTS}='..'; 56 | 57 | my ($header, $body) = load_file "../$file"; 58 | my $format = "header$file"; 59 | write_file("$format.tex", "$header\n\\end{document}"); 60 | `pdftex -interaction=batchmode -ini -jobname="$format" '&pdflatex' mylatexformat.ltx "$format.tex"`; 61 | 62 | do { 63 | my @slides = (); 64 | my $slide = 1; 65 | while ($body =~ /(\\maketitle|\\begin\{.*?slide\}.*?\\end\{.*?slide\})/sg) { 66 | my $pdf = compile_slide "$format", $slide, $1; 67 | push @slides, $pdf if (-e $pdf); 68 | ++$slide; 69 | } 70 | 71 | print "Joining $result...\n"; 72 | `pdfjoin -q -o $result @slides`; 73 | rename $result, "../$result"; 74 | 75 | unless ($once) { 76 | `inotifywait -e modify ../$file`; 77 | (my $unused, $body) = load_file "../$file"; 78 | } 79 | } until ($once); 80 | -------------------------------------------------------------------------------- /example.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minad/gridslides/41ea58cd510879276e50e29add2056fa46767ee9/example.pdf -------------------------------------------------------------------------------- /example.tex: -------------------------------------------------------------------------------- 1 | % Package: gridslides 2 | % Description: LaTeX package to create free form slides with blocks placed on a grid 3 | % File: example.tex 4 | % Author: Daniel Mendler 5 | % Version: 0.1.1 6 | % Date: 2017-11-28 7 | % License: GPL2 or LPPL1.3 at your option 8 | % Homepage: https://github.com/minad/gridslides 9 | \documentclass[ 10 | % blocks, % Show block borders for debugging 11 | % grid, % Show grid for debugging 12 | % gridsize=4mm, % Grid size 13 | % xsteps=32, % Number of steps 14 | % ysteps=24, % Number of steps 15 | ]{gridslides} 16 | 17 | \usepackage{amsmath,amsthm,amssymb} 18 | \usepackage{mathtools} 19 | \usepackage{enumerate} 20 | \usepackage{cmbright} 21 | \usepackage{xspace} 22 | 23 | \graphicspath{{figures/}} 24 | 25 | \newcommand{\hcterm}{\text{H.c.}} 26 | \newcommand{\nodag}{{\phantom{\dag}}} 27 | \newcommand{\hc}{^\dag} 28 | \newcommand{\trans}{^\intercal} 29 | \newcommand{\nohc}{^\nodag} 30 | \newcommand{\OpH}{\ensuremath{\mathcal{H}}\xspace} 31 | \newcommand{\HH}{\ensuremath{\widehat{\OpH}}\xspace} 32 | \renewcommand{\vec}[1]{\ensuremath{\boldsymbol{#1}}\xspace} 33 | 34 | \definecolor{bordercolor}{HTML}{23373b} 35 | \newcommand{\border}{ 36 | \block(0,0,32){\tikz\fill[bordercolor] (0,0) rectangle (128mm,2mm);} 37 | \block(0,22,32){\tikz\fill[bordercolor] (0,0) rectangle (128mm,8mm);} 38 | } 39 | \newcommand{\logo}{\Large\textbf{\color{bordercolor}\TeX}} 40 | 41 | \author{Author} 42 | \title{Presentation Title} 43 | \date{\today} 44 | \institute{Institute~$\cdot$~University} 45 | 46 | \begin{style} 47 | \border 48 | \txt(28,1.5){\logo} 49 | \block(1.5,2,26){\LARGE\theheadline} 50 | \txt(1,22.8){\color{white}\theslide} 51 | \txt(4,22.9){\color{white}\scriptsize\theauthor~$\cdot$~\thetitle} 52 | \end{style} 53 | 54 | \begin{document} 55 | 56 | \begin{rawslide} 57 | \border 58 | \txt(28,1.5){\logo} 59 | \block(2,5,28){\LARGE\thetitle} 60 | \txt(2,9.5){\theauthor~$\cdot$~\thedate} 61 | \txt(2,11.7){\footnotesize\theinstitute} 62 | \end{rawslide} 63 | 64 | \begin{slide}{Overview} 65 | \block(1.5,5,29){ 66 | \begin{enumerate}[1.] 67 | \item Topological phases 68 | \item 1D p-wave superconductor 69 | \end{enumerate} 70 | } 71 | \end{slide} 72 | 73 | \begin{slide}{Topological Phases} 74 | \fig(3,4,12){qahe} 75 | \fig(17,4,12){qshe} 76 | \txt(6,11){Conducting edge channels $\longleftrightarrow$ Non-trivial bandstructure} 77 | 78 | \txt<2->(1.5,12.5){QAHE bulk Hamiltonian $\HH(\vec{k}) = \vec{g}(\vec{k})\cdot\vec{\sigma}$} 79 | \eq<2->(13,14.2){\vec{g}(k_x,k_y) = \left(\sin k_x, \sin k_y, \cos k_x + \cos k_y - M \right)\trans} 80 | 81 | \only<3>{ 82 | \fig(0.5,15,16){skyrmion} 83 | \eq(4,20){M=1} 84 | \block(4,15,5){\tikz \node[fill=white,text=red!90!black,inner sep=0.5mm] 85 | {non-trivial};} 86 | 87 | \fig(15,16,16){trivial} 88 | \eq(18,21){M=3} 89 | \block(20,17.5,2.2){\tikz \node[fill=white,inner sep=0.5mm,text=blue!90!black] 90 | {trivial};} 91 | } 92 | \end{slide} 93 | 94 | \begin{slide}{1D p-wave superconductor} 95 | \txt(1.5,11){Lattice} 96 | \eq(6.5,10){\OpH = \sum_{i=1}^{n-1} \left [ t c_i\hc c_{i+1}\nohc + \Delta c\nohc_i c\nohc_{i+1} + \hcterm \right] - \mu \sum_{i=1}^n c_i\hc c_i\nohc} 97 | 98 | \fig(2,4,12){ctrivial} 99 | \fig(18,5.5,12){cnontrivial} 100 | 101 | \block<2->(26,10.5,4){% 102 | \tikz \node[draw=red,inner sep=1mm] { 103 | \scriptsize Majorana operators 104 | $\begin{aligned} 105 | \gamma_j\nohc &= \frac{c_j\nohc + c_j\hc}{2}\\ 106 | \gamma_j' &= \frac{c_j\nohc - c_j\hc}{2 \imath} 107 | \end{aligned}$ 108 | }; 109 | } 110 | 111 | \only<3>{ 112 | \fig(3,13.5,9){band02} 113 | \txt(5,13.5){t=0.2} 114 | 115 | \fig(16,13.5,9){band08} 116 | \txt(18,13.5){t=0.8} 117 | 118 | \txt(4,20.5){Bulk} 119 | \eq(9,20.3){\HH(k) = (2t \cos k - \mu)\tau_z - 2\Delta\sin k\, \tau_y\qquad\vec{c}_k\hc = \left( c_k\hc,\, c_{-k}\nohc\right)} 120 | } 121 | \end{slide} 122 | 123 | \end{document} 124 | -------------------------------------------------------------------------------- /figures/band02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minad/gridslides/41ea58cd510879276e50e29add2056fa46767ee9/figures/band02.png -------------------------------------------------------------------------------- /figures/band08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minad/gridslides/41ea58cd510879276e50e29add2056fa46767ee9/figures/band08.png -------------------------------------------------------------------------------- /figures/cnontrivial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minad/gridslides/41ea58cd510879276e50e29add2056fa46767ee9/figures/cnontrivial.pdf -------------------------------------------------------------------------------- /figures/ctrivial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minad/gridslides/41ea58cd510879276e50e29add2056fa46767ee9/figures/ctrivial.pdf -------------------------------------------------------------------------------- /figures/qahe.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minad/gridslides/41ea58cd510879276e50e29add2056fa46767ee9/figures/qahe.pdf -------------------------------------------------------------------------------- /figures/qshe.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minad/gridslides/41ea58cd510879276e50e29add2056fa46767ee9/figures/qshe.pdf -------------------------------------------------------------------------------- /figures/skyrmion.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minad/gridslides/41ea58cd510879276e50e29add2056fa46767ee9/figures/skyrmion.pdf -------------------------------------------------------------------------------- /figures/trivial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minad/gridslides/41ea58cd510879276e50e29add2056fa46767ee9/figures/trivial.pdf -------------------------------------------------------------------------------- /gridslides.cls: -------------------------------------------------------------------------------- 1 | % Package: gridslides 2 | % Description: LaTeX package to create free form slides with blocks placed on a grid 3 | % File: gridslides.cls 4 | % Author: Daniel Mendler 5 | % Version: 0.1.1 6 | % Date: 2017-11-28 7 | % License: GPL2 or LPPL1.3 at your option 8 | % Homepage: https://github.com/minad/gridslides 9 | \NeedsTeXFormat{LaTeX2e} 10 | \ProvidesClass{gridslides} 11 | 12 | \RequirePackage{xkeyval} 13 | 14 | \DeclareOptionX{gridsize}{\PassOptionsToPackage{\CurrentOption}{gridslides}} 15 | \DeclareOptionX{xsteps}{\PassOptionsToPackage{\CurrentOption}{gridslides}} 16 | \DeclareOptionX{ysteps}{\PassOptionsToPackage{\CurrentOption}{gridslides}} 17 | \DeclareOptionX{blocks}{\PassOptionsToPackage{\CurrentOption}{gridslides}} 18 | \DeclareOptionX{grid}{\PassOptionsToPackage{\CurrentOption}{gridslides}} 19 | 20 | \ProcessOptionsX\relax 21 | 22 | \LoadClass{article} 23 | \RequirePackage{gridslides} 24 | 25 | % undefine some commands from article 26 | \let\tableofcontents\GS@undefined 27 | \let\addcontentsline\GS@undefined 28 | \let\paragraph\GS@undefined 29 | \let\subparagraph\GS@undefined 30 | \let\chapter\GS@undefined 31 | \let\section\GS@undefined 32 | \let\subsection\GS@undefined 33 | \let\subsubsection\GS@undefined 34 | \let\maketitle\GS@undefined 35 | \let\figure\GS@undefined 36 | \let\table\GS@undefined 37 | \let\pagestyle\GS@undefined 38 | \let\footnote\GS@undefined 39 | \let\bf\GS@undefined 40 | \let\it\GS@undefined 41 | \let\cal\GS@undefined 42 | \let\tt\GS@undefined 43 | \let\listoffigures\GS@undefined 44 | \let\listoftables\GS@undefined 45 | 46 | \endinput 47 | -------------------------------------------------------------------------------- /gridslides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minad/gridslides/41ea58cd510879276e50e29add2056fa46767ee9/gridslides.pdf -------------------------------------------------------------------------------- /gridslides.sty: -------------------------------------------------------------------------------- 1 | % Package: gridslides 2 | % Description: LaTeX package to create free form slides with blocks placed on a grid 3 | % File: gridslides.sty 4 | % Author: Daniel Mendler 5 | % Version: 0.1.1 6 | % Date: 2017-11-28 7 | % License: GPL2 or LPPL1.3 at your option 8 | % Homepage: https://github.com/minad/gridslides 9 | \NeedsTeXFormat{LaTeX2e} 10 | \ProvidesPackage{gridslides} 11 | 12 | \RequirePackage{microtype} 13 | \RequirePackage{xkeyval} 14 | \RequirePackage[utf8]{inputenc} 15 | \RequirePackage{tikz} 16 | \RequirePackage[margin=0mm]{geometry} 17 | \RequirePackage{xstring} 18 | \RequirePackage{environ} 19 | \RequirePackage[pdfusetitle,bookmarksopen]{hyperref} 20 | \usetikzlibrary{calc} 21 | 22 | \newif\ifGS@grid\GS@gridfalse 23 | \DeclareOptionX{grid}{\GS@gridtrue} 24 | 25 | \tikzset{GS@block/.style={}} 26 | \DeclareOptionX{blocks}{\tikzset{GS@block/.style={draw=blue,draw opacity=0.2}}} 27 | 28 | \newlength{\GS@gridsize} 29 | \setlength{\GS@gridsize}{4mm} 30 | 31 | \def\GS@xsteps{32} 32 | \def\GS@ysteps{24} 33 | 34 | \DeclareOptionX{gridsize}{\setlength{\GS@gridsize}{#1}\geometry{paperwidth=\GS@xsteps\GS@gridsize,paperheight=\GS@ysteps\GS@gridsize}} 35 | \DeclareOptionX{xsteps}{\def\GS@xsteps{#1}\geometry{paperwidth=\GS@xsteps\GS@gridsize}} 36 | \DeclareOptionX{ysteps}{\def\GS@ysteps{#1}\geometry{paperheight=\GS@ysteps\GS@gridsize}} 37 | 38 | \geometry{paperwidth=\GS@xsteps\GS@gridsize,paperheight=\GS@ysteps\GS@gridsize} 39 | 40 | \ProcessOptionsX\relax 41 | 42 | % support arrows in overlay 43 | \tikzstyle{every picture}+=[remember picture] 44 | 45 | \pagestyle{empty} 46 | 47 | \def\GS@xoff{0} 48 | \def\GS@yoff{0} 49 | 50 | \long\def\GS@block(#1,#2,#3)#4{% 51 | \let\oldxoff\GS@xoff% 52 | \let\oldyoff\GS@yoff% 53 | \pgfmathsetmacro\xoff{\GS@xoff+#1}% 54 | \pgfmathsetmacro\yoff{\GS@yoff+#2}% 55 | \global\let\GS@xoff\xoff% 56 | \global\let\GS@yoff\yoff% 57 | \begin{tikzpicture}[overlay,yscale=-1,shift=(current page.north west)]% 58 | \node[GS@block,rectangle,anchor=north west,inner sep=0pt,text width=#3*\the\GS@gridsize] at (\xoff*\the\GS@gridsize,\yoff*\the\GS@gridsize)% 59 | {% 60 | \begingroup% 61 | #4% 62 | \endgroup% 63 | };% 64 | \end{tikzpicture}% 65 | \global\let\GS@xoff\oldxoff% 66 | \global\let\GS@yoff\oldyoff% 67 | } 68 | 69 | \def\GS@fig(#1,#2,#3)#4{\GS@block(#1,#2,#3){\includegraphics[width=\textwidth]{#4}}} 70 | 71 | \long\def\GS@eq(#1,#2)#3{% 72 | \GS@block(#1,#2,\GS@xsteps){% 73 | $\begin{aligned}#3\end{aligned}$% 74 | }% 75 | } 76 | 77 | \long\def\GS@txt(#1,#2)#3{\GS@block(#1,#2,\GS@xsteps){\mbox{#3}}} 78 | 79 | \newcounter{GS@totalsteps} 80 | \newcounter{GS@step} 81 | 82 | \newcommand{\GS@setsteps}[1]{% 83 | \ifnum#1>\value{GS@totalsteps}% 84 | \setcounter{GS@totalsteps}{#1}% 85 | \fi% 86 | } 87 | 88 | \long\def\GS@from<#1->#2#3{% 89 | \GS@setsteps{#1}% 90 | \ifnum\value{GS@step}<#1% 91 | #3% 92 | \else% 93 | #2% 94 | \fi% 95 | } 96 | 97 | \long\def\GS@only<#1-#2>#3#4{% 98 | \GS@setsteps{#1}% 99 | \GS@setsteps{#2}% 100 | \ifnum\value{GS@step}<#1% 101 | #4% 102 | \else% 103 | \ifnum\value{GS@step}>#2% 104 | #4% 105 | \else% 106 | #3% 107 | \fi% 108 | \fi% 109 | } 110 | 111 | \long\def\alt<#1>#2#3{% 112 | \IfSubStr{#1}{-}{% 113 | \IfBeginWith{#1}{-}{% 114 | \GS@only<1#1>{#2}{#3}% 115 | }{% 116 | \IfEndWith{#1}{-}{% 117 | \GS@from<#1>{#2}{#3}% 118 | }{% 119 | \GS@only<#1>{#2}{#3}% 120 | }% 121 | }% 122 | }{% 123 | \GS@only<#1-#1>{#2}{#3}% 124 | }% 125 | } 126 | 127 | \long\def\only<#1>#2{\alt<#1>{#2}{}} 128 | 129 | \long\def\GS@blockhelper#1<#2>(#3)#4{\only<#2>{#1(#3){#4}}} 130 | \def\GS@defblock#1{% 131 | \long\expandafter\def\csname#1\endcsname{% 132 | \@ifnextchar<{\GS@blockhelper{\csname GS@#1\endcsname}}{\csname GS@#1\endcsname}% 133 | }% 134 | } 135 | 136 | \GS@defblock{block} 137 | \GS@defblock{fig} 138 | \GS@defblock{eq} 139 | \GS@defblock{txt} 140 | 141 | \long\def\GS@cmdhelper#1#2<#3>#4{\alt<#3>{#1{#4}}{#2{#4}}} 142 | \def\GS@cmd#1#2{% 143 | \expandafter\let\csname GS@#1\expandafter\endcsname\csname#1\endcsname% 144 | \long\expandafter\def\csname#1\endcsname{% 145 | \@ifnextchar<{\GS@cmdhelper{\csname GS@#1\endcsname}{#2}}{\csname GS@#1\endcsname}% 146 | }% 147 | } 148 | 149 | \newcommand{\rgb}[1]{\definecolor{GS@rgb}{HTML}{#1}\color{GS@rgb}} 150 | 151 | \GS@cmd{textbf}{\relax} 152 | \GS@cmd{textit}{\relax} 153 | \GS@cmd{emph}{\relax} 154 | \GS@cmd{underline}{\relax} 155 | \def\GS@ignore#1{} 156 | \GS@cmd{color}{\GS@ignore} 157 | \GS@cmd{rgb}{\GS@ignore} 158 | 159 | \newcounter{slide} 160 | \stepcounter{slide} 161 | 162 | \newcommand{\GS@page}[1]{% 163 | \setcounter{GS@totalsteps}{1}% 164 | \setcounter{GS@step}{0}% 165 | \setlength{\parindent}{0pt}% 166 | \setlength{\parskip}{0pt}% 167 | \loop\ifnum\value{GS@step}<\value{GS@totalsteps}% 168 | \stepcounter{GS@step}% 169 | \clearpage% 170 | \begingroup% 171 | #1% 172 | \endgroup% 173 | \ifGS@grid% 174 | \begin{tikzpicture}[overlay,yscale=-1,shift=(current page.north west)]% 175 | \begin{scope}[x=\the\GS@gridsize,y=\the\GS@gridsize]% 176 | \draw[opacity=0.2,gray,step=1,line width=0.1pt] (0,0) grid (\GS@xsteps,\GS@ysteps);% 177 | \draw[opacity=0.2,red,step=8,line width=0.5pt] (0,0) grid (\GS@xsteps,\GS@ysteps);% 178 | \end{scope}% 179 | \end{tikzpicture}% 180 | \fi% 181 | \repeat% 182 | \stepcounter{slide}% 183 | } 184 | 185 | \newcommand{\bg}[1]{\fig(0,0,\GS@xsteps){#1}} 186 | 187 | \def\GS@style{} 188 | \def\theheadline{} 189 | 190 | \newcommand{\GS@slide}[2]{% 191 | \GS@page{% 192 | \global\def\theheadline{#1}% 193 | \GS@style% 194 | #2% 195 | \ifnum\value{GS@step}=1% 196 | \pdfbookmark[0]{\theheadline}{slide\theslide}% 197 | \fi 198 | \ifnum\value{GS@totalsteps}>1% 199 | \pdfbookmark[1]{Step \theGS@step}{slide\theslide.step\theGS@step}% 200 | \fi 201 | }% 202 | } 203 | 204 | \NewEnviron{slide}[1]{\GS@slide{#1}{\BODY}} 205 | \NewEnviron{style}{\global\let\GS@style\BODY} 206 | \NewEnviron{rawslide}{\GS@page{\BODY}} 207 | 208 | \newcommand{\institute}[1]{\newcommand\@institute{#1}} 209 | \newcommand{\theauthor}{\@author} 210 | \newcommand{\thedate}{\@date} 211 | \newcommand{\thetitle}{\@title} 212 | \newcommand{\theinstitute}{\@institute} 213 | 214 | \endinput 215 | --------------------------------------------------------------------------------