summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley-demo.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley-demo.tex')
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley-demo.tex208
1 files changed, 208 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley-demo.tex b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley-demo.tex
new file mode 100644
index 00000000000..a2ede159b96
--- /dev/null
+++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley-demo.tex
@@ -0,0 +1,208 @@
+\documentclass{article}
+
+\setlength{\parindent}{12 pt}
+
+\usepackage{xgalley}
+
+% Customised templates, etc.: would be in the class for a real document
+\ExplSyntaxOn
+\DeclareTemplateInterface { parshape } { cutout } { 0 }
+ {
+ on-left-side : boolean = true ,
+ no-page-break : boolean = false ,
+ normal-lines : integer = 1 ,
+ parshape-list : commalist
+ }
+\DeclareTemplateCode { parshape } { cutout } { 0 }
+ {
+ on-left-side = \l_galley_parshape_on_left_bool ,
+ no-page-break = \l_galley_parshape_no_break_bool ,
+ normal-lines = \l_galley_parshape_lines_int ,
+ parshape-list = \l_galley_parshape_clist
+ }
+ {
+ \AssignTemplateKeys
+ \bool_if:NT \l_galley_parshape_no_break_bool
+ { \bool_gset_true:N \g_galley_nobreak_next_bool }
+ \clist_clear:N \l_tmpa_clist
+ \clist_map_inline:Nn \l_galley_parshape_clist
+ { \clist_put_right:Nn \l_tmpa_clist { 0 pt } }
+ \bool_if:NTF \l_galley_parshape_on_left_bool
+ {
+ \galley_parshape_single_par:nVVN
+ \l_galley_parshape_lines_int
+ \l_galley_parshape_clist
+ \l_tmpa_clist
+ \c_true_bool
+ }
+ {
+ \galley_parshape_single_par:nVVN
+ \l_galley_parshape_lines_int
+ \l_tmpa_clist
+ \l_galley_parshape_clist
+ \c_true_bool
+ }
+ }
+\DeclareInstance { parshape } { staggered } { cutout }
+ {
+ no-page-break = true ,
+ parshape-list = { 20 pt, 40 pt, 60 pt }
+ }
+
+\DeclareInstance { justification } { adjust } { std }
+ {
+ end-skip = \fill ,
+ left-skip = 0 pt ,
+ right-skip = 0 pt ,
+ start-skip = 0 pt
+ }
+\DeclareInstance { justification } { centerfirst } { single }
+ {
+ end-skip = 0 pt ,
+ indent-width = 0 pt ,
+ left-skip = -\fill ,
+ right-skip = \fill ,
+ start-skip = 0 pt plus 2fill
+ }
+\DeclareInstance { justification } { centerfirst-adjust } { compound }
+ {
+ first-paragraph = centerfirst ,
+ other-paragraphs = adjust
+ }
+\ExplSyntaxOff
+
+\begin{document}
+
+Some starting text. Some starting text. Some starting text. Some starting text.
+Some starting text. Some starting text. Some starting text. Some starting text.
+
+Some starting text. Some starting text. Some starting text. Some starting text.
+Some starting text. Some starting text. Some starting text. Some starting text.
+
+\UseInstance{parshape}{staggered}
+\section{This should\\ be\\a really staggered\\heading (but isn't)}
+
+In fact we should not be surprised since the standard \LaTeX{} heading
+code is essentially using its own parshape and thus overwriting the
+outer parshape declaration.
+
+\UseInstance{parshape}{staggered}
+\UseInstance{justification}{ragged-right}
+
+This is a paragraph for testing various justification\\ settings. We have some
+text and after the word `word' \\ we just had a forced line break. We
+do some more line break testing, e.g., this\\[7pt] one was supposed to
+add $7$\,pt of extra space.
+
+And here a paragraph for comparison with some text some text some text
+also-containing-a-longer-word some text some text some text some text
+some text some text some text.
+
+\section{Linebreaks}
+
+A line break with linebreak\linebreak
+and now \ldots
+
+\section{Justified}
+
+some text%
+\marginpar
+ {%
+ \UseInstance{justification}{ragged-right}%
+ \fussy
+ \fontfamily{pop}\fontsize{7}{9}\selectfont
+ ZZZ Some text in Optima. Some text in Optima. Some text in Optima.
+ Some text in Optima. Some text in Optima.%
+ }
+some text some text some text some text some text some text some text
+some text some text some text some text some text some text
+some text some text some text some text some text some text some text
+some text some text some text some text some text some text
+some text some text some text some text some text some text some text
+some text some text some text some text some text some text.
+
+\section{Ragged-right}
+
+\UseInstance{justification}{ragged-right}
+This is a paragraph for testing various justification settings. We have some
+text and after the word `word' \\ we just had a forced line break. We
+do some more line break testing, e.g., this\\[7pt] one was supposed to
+add $7$\,pt of extra space.
+
+And here a paragraph for comparison with some text some text some text
+also-containing-a-longer-word some text some text some text some text
+some text some text some text.
+
+\section{Ragged-left}
+
+\UseInstance{justification}{ragged-left}
+\UseTemplate{hyphenation}{std}{enable = false}
+\sloppy
+This is a paragraph for testing various justification settings. We have some
+text and after the word `word' \\ we just had a forced line break. We
+do some more line break testing, e.g., this\\[7pt] one was supposed to
+add $7$\,pt of extra space.
+
+And here a paragraph for comparison with some text some text some text
+also-containing-a-longer-word some text some text some text some text
+some text some text some text.
+
+\section{Adjust}
+
+\UseInstance{justification}{adjust}
+\UseTemplate{hyphenation}{std}{enable = true}
+\fussy
+This is a paragraph for testing various justification settings. We have some
+text and after the word `word' \\ we just had a forced line break. We
+do some more line break testing, e.g., this\\[7pt] one was supposed to
+add $7$\,pt of extra space.
+
+And here a paragraph for comparison with some text some text some text
+also-containing-a-longer-word some text some text some text some text
+some text some text some text.
+
+\section{Centered}
+
+\UseInstance{justification}{centered}
+This is a paragraph for testing various justification settings. We have some
+text and after the word `word' \\ we just had a forced line break. We
+do some more line break testing, e.g., this\\[7pt] one was supposed to
+add $7$\,pt of extra space.
+
+And here a paragraph for comparison with some text some text some text
+also-containing-a-longer-word some text some text some text some text
+some text some text some text.
+
+\section{Center first}
+
+\UseInstance{justification}{centerfirst-adjust}
+This is a paragraph for testing various justification settings. We have some
+This is a paragraph for testing various justification settings. We have some
+This is a paragraph for testing various justification settings. We have some
+This is a paragraph for testing various justification settings. We have some
+text and after the word `word' \\ we just had a forced line break. We
+do some more line break testing, e.g., this\\[7pt] one was supposed to
+add $7$\,pt of extra space.
+This is a paragraph for testing various justification settings. We have some
+This is a paragraph for testing various justification settings. We have some
+This is a paragraph for testing various justification settings. We have some
+This is a paragraph for testing various justification settings. We have some
+
+And here a paragraph for comparison with some text some text some text
+also-containing-a-longer-word some text some text some text some text
+some text some text some text.
+
+\section{Centering}
+
+\UseInstance{justification}{centering}
+This is a paragraph for testing various justification settings. We have some
+text and after the word `word' \\ we just had a forced line break. We
+do some more line break testing, e.g., this\\[7pt] one was supposed to
+add $7$\,pt of extra space.
+
+And here a paragraph for comparison with some text some text some text
+also-containing-a-longer-word some text some text some text some text
+some text some text some text.
+
+
+\end{document}