Debian Codegraph @

texmf-dist/doc/latex/abspos/demo.tex

raw
1 \documentclass{beamer}
2 \usefonttheme{serif}
3 \beamertemplatenavigationsymbolsempty
4
5 \usepackage{xcoffins}
6 \usepackage{abspos}
7 \usepackage{ragged2e}
8 \usepackage{lipsum}
9 \usepackage{tikz}
10 \usepackage{newfile}
11
12 \newoutputstream{io}
13
14 \ExplSyntaxOn
15
16 \cs_generate_variant:Nn \tl_replace_all:Nnn { Nxx }
17
18 \NewDocumentCommand \ExampleFrame { m +v } {
19
20 \tl_set:Nn \l_tmpa_tl {#2}
21 \tl_replace_all:Nxx \l_tmpa_tl { \iow_char:N \^^M } { \iow_char:N \^^J }
22 \regex_replace_once:nnN { ^\v* } { } \l_tmpa_tl
23
24 \openoutputfile{demo#1.tex}{io}
25 \addtostream{io}{\l_tmpa_tl}
26 \closeoutputstream{io}
27
28 \frame{\input{demo#1}}
29
30 }
31
32 \ExplSyntaxOff
33
34 \begin{document}
35
36 \ExampleFrame{1}{
37 % In preamble:
38 % \usepackage{tikz}
39 \absput{\tikz{
40 \draw[line width=8pt, lightgray] circle[radius=3.25];
41 }}
42 \absput[angle=10, scale=5]{Hello!}
43 \absput[pg-b, y=.5cm]{\thepage}
44 }
45
46 \ExampleFrame{2}{
47 % In preamble:
48 % \usepackage{ragged2e}
49 % \usepackage{lipsum}
50 \absput[width=8cm]{
51 \justifying
52 \lipsum[1][1-5] % Example text
53 }
54 }
55
56 \ExampleFrame{3}{
57 \absposset{scale=5}
58 \absput{Scaled!}
59 }
60
61 \begin{frame}
62 \NewCoffin \MyCoffin
63 \SetHorizontalCoffin \MyCoffin {My Coffin}
64 \absputcoffin[scale=2] \MyCoffin
65 \end{frame}
66
67 \end{document}