summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-09-22 21:21:24 +0000
committerKarl Berry <karl@freefriends.org>2018-09-22 21:21:24 +0000
commit24d9b31daa41fcea40ae8fee63d962967406d175 (patch)
tree0f7f29ff966298df5caa5bc3fe0c8a023045c6f5 /Master/texmf-dist/tex/latex
parent4be14a8ad3ab56b99c27d841112f78675bd3c1ca (diff)
ducksay .tex fix (22sep18)
git-svn-id: svn://tug.org/texlive/trunk@48738 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/ducksay/ducksay.animals.tex309
-rw-r--r--Master/texmf-dist/tex/latex/ducksay/ducksay.code.v1.tex159
-rw-r--r--Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex509
3 files changed, 977 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ducksay/ducksay.animals.tex b/Master/texmf-dist/tex/latex/ducksay/ducksay.animals.tex
new file mode 100644
index 00000000000..ce5cc6cbdb1
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ducksay/ducksay.animals.tex
@@ -0,0 +1,309 @@
+%%
+%% This is file `ducksay.animals.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ducksay.dtx (with options: `animals')
+%%
+%% --------------------------------------------------------------
+%% ducksay -- cowsay for LaTeX
+%% E-mail: jspratte@yahoo.de
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% --------------------------------------------------------------
+%%
+%% Copyright (C) 2017-2018 Jonathan P. Spratte
+%%
+%% This work may be distributed and/or modified under the conditions of the
+%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
+%% (at your option) any later version. The latest version of this license is in
+%% the file:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% Alternatively you can use this work under the terms of the GNU General Public
+%% Licensce (GPL), version 3 or later, except that you might not redistribute it
+%% under the same name if you change its functionality. Choose which of these
+%% licenses fits your needs the best.
+%%
+%% This work is "maintained" (as per LPPL maintenance status) by
+%% Jonathan P. Spratte.
+%%
+%% This work consists of the file ducksay.dtx
+%% and the derived files ducksay.pdf
+%% ducksay.sty
+%% ducksay.code.v1.tex
+%% ducksay.code.v2.tex and
+%% ducksay.animals.tex.
+%%
+\AddAnimal{duck}%>>>
+{ \
+ \ __
+ >(' )
+ )/
+ /(
+ / `----/
+ \ ~=- /
+ ~^~^~^~^~^~^~^}%<<<
+\AddAnimal{small-duck}%>>>
+{ \
+ \
+ >()_
+ (__)__ _}%<<<
+\AddAnimal{duck-family}%>>>
+{ \
+ \ __
+ >(' )
+ )/
+ /(
+ / `----/ -()_ >()_
+ __\__~=-_/__ _(__)__(__)__ _}%<<<
+\AddAnimal{cow}%>>>
+{ \ ^__^
+ \ (oo)\_______
+ (__)\ )\/\
+ ||----w |
+ || ||}%<<<
+\AddAnimal{head-in}%>>>
+{ \
+ \ ^__^ /
+ (oo)\_______/ ________
+ (__)\ )=( ___|_ \____
+ ||----w | \ \ \____ |
+ || || || ||}%<<<
+\AddAnimal{sodomized}%>>>
+{ \ _
+ \ (_)
+ ^__^ / \
+ (oo)\_____/_\ \
+ (__)\ ) /
+ ||----w ((
+ || ||>>}%<<<
+\AddAnimal{tux}%>>>
+{ \
+ \ .--.
+ |o_o |
+ |\_/ |
+ // \ \
+ (| | )
+ /'\_ _/`\
+ \___)=(___/}%<<<
+\AddAnimal{pig}%>>>
++ \ _//| .-~~~-.
+ \ _/oo } }-@
+ ('')_ } |
+ `--'| { }--{ }
+ //_/ /_/+%<<<
+\AddAnimal{frog}%>>>
+{ \
+ \ (.)_(.)
+ _ ( _ ) _
+ / \/`-----'\/ \
+ __\ ( ( ) ) /__
+ ) /\ \._./ /\ (
+ )_/ /|\ /|\ \_(}%<<<
+\AddAnimal{snowman}%>>>
+{ \
+ \_[_]_
+ (")
+ >-( : )-<
+ (__:__)}%<<<
+\AddAnimal{hedgehog}%>>>
+{ \ .\|//||\||.
+ \ |/\/||/|//|/|
+ /. `|/\\|/||/||
+ o__,_|//|/||\||'}%<<<
+\AddAnimal{kangaroo}%>>>
+{ \
+ \ _,' ___
+ <__\__/ \
+ \_ / _\
+ \,\ / \\
+ // \\
+ ,/' `\_,}%<<<
+\AddAnimal{rabbit}%>>>
+{ \ / \`\ __
+ \ | \ `\ /`/ \
+ \ \_/`\ \-"-/` /\ \
+ | | \ |
+ (d b) \_/
+ / \
+ ,".|.'.\_/.'.|.",
+ / /\' _|_ '/\ \
+ | / '-`"`-' \ |
+ | | | |
+ | \ \ / / |
+ \ \ \ / / /
+ `"`\ : /'"`
+ `""`""`}%<<<
+\AddAnimal{bunny}%>>>
+{ \
+ \ /
+ /\ /
+ ( )
+ .( o ).}%<<<
+\AddAnimal{small-rabbit}%>>>
+{ \
+ \ _//
+ (')---.
+ _/-_( )o}%<<<
+\AddAnimal{dragon}%>>>
+{ \ / \ //\
+ \ |\___/| / \// \\
+ \ /0 0 \__ / // | \ \
+ / / \/_/ // | \ \
+ @_^_@'/ \/_ // | \ \
+ //_^_/ \/_ // | \ \
+ ( //) | \/// | \ \
+ ( / /) _|_ / ) // | \ _\
+ ( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-.
+ (( / / )) ,-{ _ `-.|.-~-. .~ `.
+ (( // / )) '/\ / ~-. _ .-~ .-~^-. \
+ (( /// )) `. { } / \ \
+ (( / )) .----~-.\ \-' .~ \ `. \^-.
+ ///.----..> \ _ -~ `. ^-` ^-_
+ ///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
+ /.-~}%<<<
+\AddAnimal{dog}%>>>
+{ \ __
+ \ .-'\/\
+ "\ '------.
+ ___/ ( .'_____
+ '-----'"""'------"""""'}%<<<
+\AddAnimal{squirrel}%>>>
+{ \ ,;:;;,
+ \ , ;;;;;
+ .=', ;:;;:,
+ /_', "=. ';:;:;
+ @=:__, \,;:;:'
+ _(\.= ;:;;'
+ `"_( _/="`
+ `"'``}%<<<
+\AddAnimal{snail}%>>>
+{ \
+ \ .-""-.
+ oo ; .-. :
+ \\__..-: '.__.')._
+ "-._.._'.__.-'_.."}%<<<
+\AddAnimal{unicorn}%>>>
+{ \
+ \ /((((((\\\\
+ ---====((((((((((\\\\\
+ (( \\\\\\\
+ ( (* _/ \\\\\\\
+ \ / \ \\\\\\_ __,,__
+ | | | </ "------"" ((\\\\
+ o_| / / \ \\\\ \\\\\\\
+ | ._ ( \ \\\\\\\\\\\\\\\\
+ | / / / \\\\\\\ \\
+ .______/\/ / / / \\\
+ / __.____/ _/ ___----( /\
+ / / / ________/:______,---' \ / \_
+ / / \ \ \ \ \_ \
+ ( < \ \ > / \ \
+ \/ \\_ / / > )
+ \_| / / / /
+ _// _//
+ /_| /_|}%<<<
+\AddAnimal{whale}%>>>
+{ \ |-.
+ \ .-""-._ \ \.--|
+ \ / `-..__) ,-'
+ | . /
+ \--.__, .__.,'
+ `-.___'._\_.'}%<<<
+\AddAnimal{yoda}%>>>
+{ \
+ \ ____
+ \ _.' : `._
+ .-.'`. ; .'`.-.
+ __ / : ___\ ; /___ ; \ __
+ ,'_ ""--.:__;".-.";: :".-.":__;.--"" _`,
+ :' `.t""--.. '<@.`;_ ',@>` ..--""j.' `;
+ `:-.._J '-.-'L__ `-- ' L_..-;'
+ "-.__ ; .-" "-. : __.-"
+ L ' /.------.\ ' J
+ "-. "--" .-"
+ __.l"-:_JL_;-";.__
+ .-j/'.; ;"""" / .'\"-.
+ .' /:`. : : /.".''; `.
+ .-" / ;`.". : ."." : "-.
+ .+"-. : : ".".". ."." ;-._ \
+ ; \ `.; ; . "."-"." : : "+. ;
+ : ; ; ; . ."." ; : ; : \:
+ ; : ; : / / / , ;: ; :
+: \ ; : ; ; / : , : ; / ::
+; ; : ; : ; ; ; ; : ;:
+: : ; : ;. ; ' : : ; : ;
+;\ : ; : . , ; ; ; ;
+: `."-; : ; . ; : ; / ;
+ ; -: ; : , , ; : .-" :
+ :\ \ : ; , : \.-" :
+ ;`. \ ; : . , ;.'_..-- / ;
+ : "-. "-: ; , :/." .' :
+ \ \ : : ;/ __ :
+ \ .-`.\ /t-"" ":-+. :
+ `. .-" `l __/ /`. : ; ; \ ;
+ \ .-" .-"-.-" .' .'j \ / ;/
+ \ / .-" /. .'.' ;_:' ;
+ :-""-.`./-.' / `.___.'
+ \ `t ._ /
+ "-.t-._:'}%<<<
+\AddAnimal{yoda-head}%>>>
+{ \
+ \ ____
+ \ _.' : `._
+ .-.'`. ; .'`.-.
+ __ / : ___\ ; /___ ; \ __
+ ,'_ ""--.:__;".-.";: :".-.":__;.--"" _`,
+ :' `.t""--.. '<@.`;_ ',@>` ..--""j.' `;
+ `:-.._J '-.-'L__ `-- ' L_..-;'
+ "-.__ ; .-" "-. : __.-"
+ L ' /.------.\ ' J
+ "-. "--" .-"
+ __.l"-:_JL_;-";.__
+ .-j/'.; ;"""" / .'\"-.
+ .' /:`. : : /.".''; `.
+ .-" / ;`.". : ."." : "-.
+ .+"-. : : ".".". ."." ;-._ \}%<<<
+\AddAnimal{small-yoda}%>>>
+{ \
+ \
+ __.-._
+ '-._"7'
+ /'.-c
+ | /T
+ _)_/LI}%<<<
+\AddAnimal{r2d2}%>>>
+{ \
+ \ ,-----.
+ ,'_/_|_\_`.
+ /<<::8[O]::>\
+ _|-----------|_
+ | | ====-=- | |
+ | | -=-==== | |
+ \ | ::::|()|| /
+ | | ....|()|| |
+ | |_________| |
+ | |\_______/| |
+ / \ / \ / \
+ `---' `---' `---'}%<<<
+\AddAnimal{vader}%>>>
+{ \ _.-'~~~~~~`-._
+ \ / || \
+ / || \
+ | || |
+ | _______||_______ |
+ |/ ----- \/ ----- \|
+ / ( ) ( ) \
+ / \ ----- () ----- / \
+ / \ /||\ / \
+ / \ /||||\ / \
+ / \ /||||||\ / \
+/_ \O========O/ _\
+ `--...__|`-._ _.-'|__...--'
+ | `' |}%<<<
+%%
+%%
+%% End of file `ducksay.animals.tex'.
diff --git a/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v1.tex b/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v1.tex
new file mode 100644
index 00000000000..b34e6d42784
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v1.tex
@@ -0,0 +1,159 @@
+%%
+%% This is file `ducksay.code.v1.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ducksay.dtx (with options: `code.v1')
+%%
+%% --------------------------------------------------------------
+%% ducksay -- cowsay for LaTeX
+%% E-mail: jspratte@yahoo.de
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% --------------------------------------------------------------
+%%
+%% Copyright (C) 2017-2018 Jonathan P. Spratte
+%%
+%% This work may be distributed and/or modified under the conditions of the
+%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
+%% (at your option) any later version. The latest version of this license is in
+%% the file:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% Alternatively you can use this work under the terms of the GNU General Public
+%% Licensce (GPL), version 3 or later, except that you might not redistribute it
+%% under the same name if you change its functionality. Choose which of these
+%% licenses fits your needs the best.
+%%
+%% This work is "maintained" (as per LPPL maintenance status) by
+%% Jonathan P. Spratte.
+%%
+%% This work consists of the file ducksay.dtx
+%% and the derived files ducksay.pdf
+%% ducksay.sty
+%% ducksay.code.v1.tex
+%% ducksay.code.v2.tex and
+%% ducksay.animals.tex.
+%%
+\cs_new:Npn \ducksay_longest_line:n #1
+ {
+ \int_incr:N \l_ducksay_msg_height_int
+ \exp_args:NNx \tl_set:Nn \l_ducksay_tmpa_tl { #1 }
+ \regex_replace_all:nnN { \s } { \c { space } } \l_ducksay_tmpa_tl
+ \int_set:Nn \l_ducksay_msg_width_int
+ {
+ \int_max:nn
+ { \l_ducksay_msg_width_int } { \tl_count:N \l_ducksay_tmpa_tl }
+ }
+ }
+\cs_new:Npn \ducksay_open_bubble:
+ {
+ \begin{tabular}{@{}l@{}}
+ \null\\
+ \int_compare:nNnTF { \l_ducksay_msg_height_int } = { 1 } { ( }
+ {
+ /
+ \int_step_inline:nnn
+ { 3 } { \l_ducksay_msg_height_int } { \\\kern-0.2em| }
+ \\\detokenize{\ }
+ }
+ \\[-1ex]\null
+ \end{tabular}
+ \begin{tabular}{@{}l@{}}
+ _\\
+ \int_step_inline:nnn { 2 } { \l_ducksay_msg_height_int } { \\ } \\[-1ex]
+ \mbox { - }
+ \end{tabular}
+ }
+\cs_new:Npn \ducksay_close_bubble:
+ {
+ \begin{tabular}{@{}l@{}}
+ _\\
+ \int_step_inline:nnn { 2 } { \l_ducksay_msg_height_int } { \\ } \\[-1ex]
+ { - }
+ \end{tabular}
+ \begin{tabular}{@{}r@{}}
+ \null\\
+ \int_compare:nNnTF { \l_ducksay_msg_height_int } = { 1 }
+ { ) }
+ {
+ \detokenize {\ }
+ \int_step_inline:nnn
+ { 3 } { \l_ducksay_msg_height_int } { \\|\kern-0.2em }
+ \\/
+ }
+ \\[-1ex]\null
+ \end{tabular}
+ }
+\cs_new:Npn \ducksay_print_msg:nn #1 #2
+ {
+ \begin{tabular}{@{} #2 @{}}
+ \int_step_inline:nn { \l_ducksay_msg_width_int } { _ } \\
+ #1\\[-1ex]
+ \int_step_inline:nn { \l_ducksay_msg_width_int } { { - } }
+ \end{tabular}
+ }
+\cs_generate_variant:Nn \ducksay_print_msg:nn { nV }
+\cs_new:Npn \ducksay_print:nn #1 #2
+ {
+ \int_compare:nNnTF { \l_ducksay_msg_width_int } < { 0 }
+ {
+ \int_zero:N \l_ducksay_msg_height_int
+ \seq_set_split:Nnn \l_ducksay_msg_lines_seq { \\ } { #1 }
+ \seq_map_function:NN \l_ducksay_msg_lines_seq \ducksay_longest_line:n
+ }
+ {
+ \int_compare:nNnT { \l_ducksay_msg_height_int } < { 0 }
+ {
+ \regex_count:nnN { \c { \\ } } { #1 } \l_ducksay_msg_height_int
+ \int_incr:N \l_ducksay_msg_height_int
+ }
+ }
+ \group_begin:
+ \frenchspacing
+ \verbatim@font
+ \@noligs
+ \begin{tabular}[\l_ducksay_align_tl]{@{}#2@{}}
+ \l_ducksay_bubble_tl
+ \begin{tabular}{@{}l@{}}
+ \ducksay_open_bubble:
+ \ducksay_print_msg:nV { #1 } \l_ducksay_msg_align_tl
+ \ducksay_close_bubble:
+ \end{tabular}\\
+ \l_ducksay_body_tl
+ \begin{tabular}{@{}l@{}}
+ \l_ducksay_animal_tl
+ \end{tabular}
+ \end{tabular}
+ \group_end:
+ }
+\cs_generate_variant:Nn \ducksay_print:nn { nV }
+\cs_new:Npn \ducksay_prepare_say_and_think:n #1
+ {
+ \int_set:Nn \l_ducksay_msg_width_int { -\c_max_int }
+ \int_set:Nn \l_ducksay_msg_height_int { -\c_max_int }
+ \keys_set:nn { ducksay } { #1 }
+ \tl_if_empty:NT \l_ducksay_animal_tl
+ { \keys_set:nn { ducksay } { default_animal } }
+ }
+\NewDocumentCommand \ducksay { O{} m }
+ {
+ \group_begin:
+ \tl_set:Nn \l_ducksay_say_or_think_tl { say }
+ \ducksay_prepare_say_and_think:n { #1 }
+ \ducksay_print:nV { #2 } \l_ducksay_rel_align_tl
+ \group_end:
+ }
+\NewDocumentCommand \duckthink { O{} m }
+ {
+ \group_begin:
+ \tl_set:Nn \l_ducksay_say_or_think_tl { think }
+ \ducksay_prepare_say_and_think:n { #1 }
+ \ducksay_print:nV { #2 } \l_ducksay_rel_align_tl
+ \group_end:
+ }
+%%
+%%
+%% End of file `ducksay.code.v1.tex'.
diff --git a/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex b/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex
new file mode 100644
index 00000000000..df1e7f870b2
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex
@@ -0,0 +1,509 @@
+%%
+%% This is file `ducksay.code.v2.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ducksay.dtx (with options: `code.v2')
+%%
+%% --------------------------------------------------------------
+%% ducksay -- cowsay for LaTeX
+%% E-mail: jspratte@yahoo.de
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% --------------------------------------------------------------
+%%
+%% Copyright (C) 2017-2018 Jonathan P. Spratte
+%%
+%% This work may be distributed and/or modified under the conditions of the
+%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
+%% (at your option) any later version. The latest version of this license is in
+%% the file:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% Alternatively you can use this work under the terms of the GNU General Public
+%% Licensce (GPL), version 3 or later, except that you might not redistribute it
+%% under the same name if you change its functionality. Choose which of these
+%% licenses fits your needs the best.
+%%
+%% This work is "maintained" (as per LPPL maintenance status) by
+%% Jonathan P. Spratte.
+%%
+%% This work consists of the file ducksay.dtx
+%% and the derived files ducksay.pdf
+%% ducksay.sty
+%% ducksay.code.v1.tex
+%% ducksay.code.v2.tex and
+%% ducksay.animals.tex.
+%%
+\RequirePackage{array}
+\msg_new:nnn { ducksay } { justify~unavailable }
+ {
+ Justified~content~is~not~available~for~tabular~argument~mode~without~fixed~
+ width.~`l`~column~is~used~instead.
+ }
+\msg_new:nnn { ducksay } { unknown~message~alignment }
+ {
+ The~specified~message~alignment~`\exp_not:n { #1 }`~is~unknown.~
+ `l`~is~used~as~fallback.
+ }
+\tl_new:N \l_ducksay_msg_align_vbox_tl
+\box_new:N \l_ducksay_msg_box
+\bool_new:N \l_ducksay_eat_arg_box_bool
+\bool_new:N \l_ducksay_eat_arg_tab_verb_bool
+\bool_new:N \l_ducksay_mirrored_body_bool
+\coffin_new:N \l_ducksay_body_coffin
+\coffin_new:N \l_ducksay_bubble_close_coffin
+\coffin_new:N \l_ducksay_bubble_open_coffin
+\coffin_new:N \l_ducksay_bubble_top_coffin
+\coffin_new:N \l_ducksay_msg_coffin
+\dim_new:N \l_ducksay_hpad_dim
+\dim_new:N \l_ducksay_bubble_bottom_kern_dim
+\dim_new:N \l_ducksay_bubble_top_kern_dim
+\dim_new:N \l_ducksay_msg_width_dim
+\keys_define:nn { ducksay }
+ {
+ ,arg .choice:
+ ,arg / box .code:n = \bool_set_true:N \l_ducksay_eat_arg_box_bool
+ ,arg / tab .code:n =
+ {
+ \bool_set_false:N \l_ducksay_eat_arg_box_bool
+ \bool_set_false:N \l_ducksay_eat_arg_tab_verb_bool
+ }
+ ,arg / tab* .code:n =
+ {
+ \bool_set_false:N \l_ducksay_eat_arg_box_bool
+ \bool_set_true:N \l_ducksay_eat_arg_tab_verb_bool
+ }
+ ,arg .initial:n = tab
+ ,wd* .dim_set:N = \l_ducksay_msg_width_dim
+ ,wd* .initial:n = -\c_max_dim
+ ,wd* .value_required:n = true
+ ,none .bool_set:N = \l_ducksay_no_body_bool
+ ,body-mirrored .bool_set:N = \l_ducksay_mirrored_body_bool
+ ,ignore-body .bool_set:N = \l_ducksay_ignored_body_bool
+ ,body-x .dim_set:N = \l_ducksay_body_x_offset_dim
+ ,body-x .value_required:n = true
+ ,body-y .dim_set:N = \l_ducksay_body_y_offset_dim
+ ,body-y .value_required:n = true
+ ,body-to-msg .tl_set:N = \l_ducksay_body_to_msg_align_body_tl
+ ,msg-to-body .tl_set:N = \l_ducksay_body_to_msg_align_msg_tl
+ ,body-align .choice:
+ ,body-align / l .meta:n = { body-to-msg = l , msg-to-body = l }
+ ,body-align / c .meta:n = { body-to-msg = hc , msg-to-body = hc }
+ ,body-align / r .meta:n = { body-to-msg = r , msg-to-body = r }
+ ,body-align .initial:n = l
+ ,msg-align .choice:
+ ,msg-align / l .code:n = { \tl_set:Nn \l_ducksay_msg_align_tl { l } }
+ ,msg-align / c .code:n = { \tl_set:Nn \l_ducksay_msg_align_tl { c } }
+ ,msg-align / r .code:n = { \tl_set:Nn \l_ducksay_msg_align_tl { r } }
+ ,msg-align / j .code:n = { \tl_set:Nn \l_ducksay_msg_align_tl { j } }
+ ,msg-align-l .tl_set:N = \l_ducksay_msg_align_l_tl
+ ,msg-align-l .initial:n = \raggedright
+ ,msg-align-c .tl_set:N = \l_ducksay_msg_align_c_tl
+ ,msg-align-c .initial:n = \centering
+ ,msg-align-r .tl_set:N = \l_ducksay_msg_align_r_tl
+ ,msg-align-r .initial:n = \raggedleft
+ ,msg-align-j .tl_set:N = \l_ducksay_msg_align_j_tl
+ ,msg-align-j .initial:n = {}
+ ,out-h .tl_set:N = \l_ducksay_output_h_pole_tl
+ ,out-h .initial:n = l
+ ,out-v .tl_set:N = \l_ducksay_output_v_pole_tl
+ ,out-v .initial:n = vc
+ ,out-x .dim_set:N = \l_ducksay_output_x_offset_dim
+ ,out-x .value_required:n = true
+ ,out-y .dim_set:N = \l_ducksay_output_y_offset_dim
+ ,out-y .value_required:n = true
+ ,t .meta:n = { out-v = t }
+ ,c .meta:n = { out-v = vc }
+ ,b .meta:n = { out-v = b }
+ ,body* .tl_set:N = \l_ducksay_body_fount_tl
+ ,msg* .tl_set:N = \l_ducksay_msg_fount_tl
+ ,bubble* .tl_set:N = \l_ducksay_bubble_fount_tl
+ ,body* .initial:n = \verbatim@font
+ ,msg* .initial:n = \verbatim@font
+ ,bubble* .initial:n = \verbatim@font
+ ,body .code:n = \tl_put_right:Nn \l_ducksay_body_fount_tl { #1 }
+ ,msg .code:n = \tl_put_right:Nn \l_ducksay_msg_fount_tl { #1 }
+ ,bubble .code:n = \tl_put_right:Nn \l_ducksay_bubble_fount_tl { #1 }
+ ,MSG .meta:n = { msg = #1 , bubble = #1 }
+ ,MSG* .meta:n = { msg* = #1 , bubble* = #1 }
+ ,hpad .int_set:N = \l_ducksay_hpad_int
+ ,hpad .initial:n = 2
+ ,hpad .value_required:n = true
+ ,vpad .int_set:N = \l_ducksay_vpad_int
+ ,vpad .value_required:n = true
+ ,col .tl_set:N = \l_ducksay_msg_tabular_column_tl
+ ,bubble-top-kern .tl_set:N = \l_ducksay_bubble_top_kern_tl
+ ,bubble-top-kern .initial:n = { -.5ex }
+ ,bubble-top-kern .value_required:n = true
+ ,bubble-bot-kern .tl_set:N = \l_ducksay_bubble_bottom_kern_tl
+ ,bubble-bot-kern .initial:n = { .2ex }
+ ,bubble-bot-kern .value_required:n = true
+ ,bubble-side-kern .tl_set:N = \l_ducksay_bubble_side_kern_tl
+ ,bubble-side-kern .initial:n = { 0.2em }
+ ,bubble-side-kern .value_required:n = true
+ ,bubble-delim-top .tl_set:N = \l_ducksay_bubble_delim_top_tl
+ ,bubble-delim-left-1 .tl_set:N = \l_ducksay_bubble_delim_left_a_tl
+ ,bubble-delim-left-2 .tl_set:N = \l_ducksay_bubble_delim_left_b_tl
+ ,bubble-delim-left-3 .tl_set:N = \l_ducksay_bubble_delim_left_c_tl
+ ,bubble-delim-left-4 .tl_set:N = \l_ducksay_bubble_delim_left_d_tl
+ ,bubble-delim-right-1 .tl_set:N = \l_ducksay_bubble_delim_right_a_tl
+ ,bubble-delim-right-2 .tl_set:N = \l_ducksay_bubble_delim_right_b_tl
+ ,bubble-delim-right-3 .tl_set:N = \l_ducksay_bubble_delim_right_c_tl
+ ,bubble-delim-right-4 .tl_set:N = \l_ducksay_bubble_delim_right_d_tl
+ ,bubble-delim-top .initial:n = { { - } }
+ ,bubble-delim-left-1 .initial:n = (
+ ,bubble-delim-left-2 .initial:n = /
+ ,bubble-delim-left-3 .initial:n = |
+ ,bubble-delim-left-4 .initial:n = \c_backslash_str
+ ,bubble-delim-right-1 .initial:n = )
+ ,bubble-delim-right-2 .initial:n = \c_backslash_str
+ ,bubble-delim-right-3 .initial:n = |
+ ,bubble-delim-right-4 .initial:n = /
+ }
+\cs_new:Npn \ducksay_evaluate_message_alignment_fixed_width_tabular:
+ {
+ \tl_if_empty:NT \l_ducksay_msg_tabular_column_tl
+ {
+ \tl_set:Nx \l_ducksay_msg_tabular_column_tl
+ {
+ >
+ {
+ \str_case:Vn \l_ducksay_msg_align_tl
+ {
+ { l } { \exp_not:N \l_ducksay_msg_align_l_tl }
+ { c } { \exp_not:N \l_ducksay_msg_align_c_tl }
+ { r } { \exp_not:N \l_ducksay_msg_align_r_tl }
+ { j } { \exp_not:N \l_ducksay_msg_align_j_tl }
+ }
+ \exp_not:N \arraybackslash
+ }
+ p { \exp_not:N \l_ducksay_msg_width_dim }
+ }
+ }
+ }
+\cs_new:Npn \ducksay_evaluate_message_alignment_fixed_width_vbox:
+ {
+ \tl_set:Nx \l_ducksay_msg_align_vbox_tl
+ {
+ \str_case:Vn \l_ducksay_msg_align_tl
+ {
+ { l } { \exp_not:N \l_ducksay_msg_align_l_tl }
+ { c } { \exp_not:N \l_ducksay_msg_align_c_tl }
+ { r } { \exp_not:N \l_ducksay_msg_align_r_tl }
+ { j } { \exp_not:N \l_ducksay_msg_align_j_tl }
+ }
+ }
+ }
+\cs_new:Npn \ducksay_calculate_msg_width_from_int:
+ {
+ \hbox_set:Nn \l_ducksay_tmpa_box { \l_ducksay_msg_fount_tl M }
+ \dim_set:Nn \l_ducksay_msg_width_dim
+ { \l_ducksay_msg_width_int \box_wd:N \l_ducksay_tmpa_box }
+ }
+\cs_new:Npn \ducksay_msg_tabular_begin:
+ {
+ \ducksay_msg_tabular_begin_inner:V \l_ducksay_msg_tabular_column_tl
+ }
+\cs_new:Npn \ducksay_msg_tabular_begin_inner:n #1
+ {
+ \begin { tabular } { @{} #1 @{} }
+ }
+\cs_generate_variant:Nn \ducksay_msg_tabular_begin_inner:n { V }
+\cs_new:Npn \ducksay_msg_tabular_end:
+ {
+ \end { tabular }
+ }
+\cs_new:Npn \ducksay_digest_options:n #1
+ {
+ \keys_set:nn { ducksay } { #1 }
+ \tl_if_empty:NT \l_ducksay_animal_tl
+ { \keys_set:nn { ducksay } { default_animal } }
+ \bool_if:NTF \l_ducksay_eat_arg_box_bool
+ {
+ \dim_compare:nNnTF { \l_ducksay_msg_width_dim } < { \c_zero_dim }
+ {
+ \int_compare:nNnTF { \l_ducksay_msg_width_int } < { \c_zero_int }
+ {
+ \cs_set_eq:NN
+ \ducksay_eat_argument:w \ducksay_eat_argument_hbox:w
+ }
+ {
+ \cs_set_eq:NN
+ \ducksay_eat_argument:w \ducksay_eat_argument_vbox:w
+ \ducksay_calculate_msg_width_from_int:
+ }
+ }
+ {
+ \cs_set_eq:NN \ducksay_eat_argument:w \ducksay_eat_argument_vbox:w
+ }
+ }
+ {
+ \dim_compare:nNnTF { \l_ducksay_msg_width_dim } < { \c_zero_dim }
+ {
+ \int_compare:nNnTF { \l_ducksay_msg_width_int } < { \c_zero_int }
+ {
+ \tl_if_empty:NT \l_ducksay_msg_tabular_column_tl
+ {
+ \str_case:Vn \l_ducksay_msg_align_tl
+ {
+ { l }
+ { \tl_set:Nn \l_ducksay_msg_tabular_column_tl { l } }
+ { c }
+ { \tl_set:Nn \l_ducksay_msg_tabular_column_tl { c } }
+ { r }
+ { \tl_set:Nn \l_ducksay_msg_tabular_column_tl { r } }
+ { j } {
+ \msg_error:nn { ducksay } { justify~unavailable }
+ \tl_set:Nn \l_ducksay_msg_tabular_column_tl { l }
+ }
+ }
+ }
+ }
+ {
+ \ducksay_calculate_msg_width_from_int:
+ \ducksay_evaluate_message_alignment_fixed_width_tabular:
+ }
+ }
+ {
+ \ducksay_evaluate_message_alignment_fixed_width_tabular:
+ }
+ \cs_set_eq:NN \ducksay_eat_argument:w \ducksay_eat_argument_tabular:w
+ }
+ }
+\cs_new:Npn \ducksay_set_bubble_top_kern:
+ {
+ \group_begin:
+ \l_ducksay_bubble_fount_tl
+ \exp_args:NNNx
+ \group_end:
+ \dim_set:Nn \l_ducksay_bubble_top_kern_dim
+ { \dim_eval:n { \l_ducksay_bubble_top_kern_tl } }
+ }
+\cs_new:Npn \ducksay_set_bubble_bottom_kern:
+ {
+ \group_begin:
+ \l_ducksay_bubble_fount_tl
+ \exp_args:NNNx
+ \group_end:
+ \dim_set:Nn \l_ducksay_bubble_bottom_kern_dim
+ { \dim_eval:n { \l_ducksay_bubble_bottom_kern_tl } }
+ }
+\cs_new_protected:Npn \ducksay_shipout:
+ {
+ \hbox_set:Nn \l_ducksay_tmpa_box
+ { \l_ducksay_bubble_fount_tl \l_ducksay_bubble_delim_top_tl }
+ \int_set:Nn \l_ducksay_msg_width_int
+ {
+ \fp_eval:n
+ {
+ ceil
+ ( \box_wd:N \l_ducksay_msg_box / \box_wd:N \l_ducksay_tmpa_box )
+ }
+ }
+ \group_begin:
+ \l_ducksay_bubble_fount_tl
+ \exp_args:NNNx
+ \group_end:
+ \int_set:Nn \l_ducksay_msg_height_int
+ {
+ \int_max:nn
+ {
+ \fp_eval:n
+ {
+ ceil
+ (
+ (
+ \box_ht:N \l_ducksay_msg_box
+ + \box_dp:N \l_ducksay_msg_box
+ )
+ / ( \arraystretch * \baselineskip )
+ )
+ }
+ + \l_ducksay_vpad_int
+ }
+ { \l_ducksay_msg_height_int }
+ }
+ \hcoffin_set:Nn \l_ducksay_bubble_open_coffin
+ {
+ \l_ducksay_bubble_fount_tl
+ \begin{tabular}{@{}l@{}}
+ \int_compare:nNnTF { \l_ducksay_msg_height_int } = { \c_one_int }
+ {
+ \l_ducksay_bubble_delim_left_a_tl
+ }
+ {
+ \l_ducksay_bubble_delim_left_b_tl\\
+ \int_step_inline:nnn
+ { 3 } { \l_ducksay_msg_height_int }
+ {
+ \kern-\l_ducksay_bubble_side_kern_tl
+ \l_ducksay_bubble_delim_left_c_tl
+ \\
+ }
+ \l_ducksay_bubble_delim_left_d_tl
+ }
+ \end{tabular}
+ }
+ \hcoffin_set:Nn \l_ducksay_bubble_close_coffin
+ {
+ \l_ducksay_bubble_fount_tl
+ \begin{tabular}{@{}r@{}}
+ \int_compare:nNnTF { \l_ducksay_msg_height_int } = { \c_one_int }
+ {
+ \l_ducksay_bubble_delim_right_a_tl
+ }
+ {
+ \l_ducksay_bubble_delim_right_b_tl \\
+ \int_step_inline:nnn
+ { 3 } { \l_ducksay_msg_height_int }
+ {
+ \l_ducksay_bubble_delim_right_c_tl
+ \kern-\l_ducksay_bubble_side_kern_tl
+ \\
+ }
+ \l_ducksay_bubble_delim_right_d_tl
+ }
+ \end{tabular}
+ }
+ \hcoffin_set:Nn \l_ducksay_bubble_top_coffin
+ {
+ \l_ducksay_bubble_fount_tl
+ \int_step_inline:nn { \l_ducksay_msg_width_int + \l_ducksay_hpad_int }
+ { \l_ducksay_bubble_delim_top_tl }
+ }
+ \hcoffin_set:Nn \l_ducksay_msg_coffin { \box_use:N \l_ducksay_msg_box }
+ \bool_if:NF \l_ducksay_no_body_bool
+ {
+ \hcoffin_set:Nn \l_ducksay_body_coffin
+ {
+ \frenchspacing
+ \l_ducksay_body_fount_tl
+ \begin{tabular} { @{} l @{} }
+ \l_ducksay_animal_tl
+ \end{tabular}
+ }
+ \bool_if:NT \l_ducksay_mirrored_body_bool
+ {
+ \coffin_scale:Nnn \l_ducksay_body_coffin
+ { -\c_one_int } { \c_one_int }
+ \str_case:Vn \l_ducksay_body_to_msg_align_body_tl
+ {
+ { l } { \tl_set:Nn \l_ducksay_body_to_msg_align_body_tl { r } }
+ { r } { \tl_set:Nn \l_ducksay_body_to_msg_align_body_tl { l } }
+ }
+ }
+ }
+ \dim_set:Nn \l_ducksay_hpad_dim
+ {
+ (
+ \coffin_wd:N \l_ducksay_bubble_top_coffin
+ - \coffin_wd:N \l_ducksay_msg_coffin
+ ) / 2
+ }
+ \coffin_join:NnnNnnnn
+ \l_ducksay_msg_coffin { l } { vc }
+ \l_ducksay_bubble_open_coffin { r } { vc }
+ { - \l_ducksay_hpad_dim } { \c_zero_dim }
+ \coffin_join:NnnNnnnn
+ \l_ducksay_msg_coffin { r } { vc }
+ \l_ducksay_bubble_close_coffin { l } { vc }
+ { \l_ducksay_hpad_dim } { \c_zero_dim }
+ \ducksay_set_bubble_top_kern:
+ \ducksay_set_bubble_bottom_kern:
+ \coffin_join:NnnNnnnn
+ \l_ducksay_msg_coffin { hc } { t }
+ \l_ducksay_bubble_top_coffin { hc } { b }
+ { \c_zero_dim } { \l_ducksay_bubble_top_kern_dim }
+ \coffin_join:NnnNnnnn
+ \l_ducksay_msg_coffin { hc } { b }
+ \l_ducksay_bubble_top_coffin { hc } { t }
+ { \c_zero_dim } { \l_ducksay_bubble_bottom_kern_dim }
+ \bool_if:NF \l_ducksay_no_body_bool
+ {
+ \bool_if:NTF \l_ducksay_ignored_body_bool
+ { \coffin_attach:NVnNVnnn }
+ { \coffin_join:NVnNVnnn }
+ \l_ducksay_msg_coffin \l_ducksay_body_to_msg_align_msg_tl { b }
+ \l_ducksay_body_coffin \l_ducksay_body_to_msg_align_body_tl { t }
+ { \l_ducksay_body_x_offset_dim } { \l_ducksay_body_y_offset_dim }
+ }
+ \coffin_typeset:NVVnn \l_ducksay_msg_coffin
+ \l_ducksay_output_h_pole_tl \l_ducksay_output_v_pole_tl
+ { \l_ducksay_output_x_offset_dim } { \l_ducksay_output_y_offset_dim }
+ \group_end:
+ }
+\cs_new:Npn \ducksay_eat_argument_tabular:w
+ {
+ \bool_if:NTF \l_ducksay_eat_arg_tab_verb_bool
+ { \ducksay_eat_argument_tabular_verb:w }
+ { \ducksay_eat_argument_tabular_normal:w }
+ }
+\cs_new:Npn \ducksay_eat_argument_tabular_inner:w #1
+ {
+ \hbox_set:Nn \l_ducksay_msg_box
+ {
+ \l_ducksay_msg_fount_tl
+ \ducksay_msg_tabular_begin:
+ #1
+ \ducksay_msg_tabular_end:
+ }
+ \ducksay_shipout:
+ }
+\NewDocumentCommand \ducksay_eat_argument_tabular_verb:w
+ { >{ \ducksay_process_verb_newline:nnn { ~ } { ~ \par } } +v }
+ { \ducksay_eat_argument_tabular_inner:w { \scantokens { #1 } } }
+\NewDocumentCommand \ducksay_eat_argument_tabular_normal:w { +m }
+ { \ducksay_eat_argument_tabular_inner:w { #1 } }
+\cs_new_protected_nopar:Npn \ducksay_eat_argument_hbox:w
+ {
+ \afterassignment \ducksay_eat_argument_hbox_inner:w
+ \let \l_ducksay_nothing =
+ }
+\cs_new_protected_nopar:Npn \ducksay_eat_argument_hbox_inner:w
+ {
+ \setbox \l_ducksay_msg_box \hbox \c_group_begin_token
+ \group_insert_after:N \ducksay_shipout:
+ \l_ducksay_msg_fount_tl
+ }
+\cs_new_protected_nopar:Npn \ducksay_eat_argument_vbox:w
+ {
+ \ducksay_evaluate_message_alignment_fixed_width_vbox:
+ \afterassignment \ducksay_eat_argument_vbox_inner:w
+ \let \l_ducksay_nothing =
+ }
+\cs_new_protected_nopar:Npn \ducksay_eat_argument_vbox_inner:w
+ {
+ \setbox \l_ducksay_msg_box \vbox \c_group_begin_token
+ \hsize \l_ducksay_msg_width_dim
+ \group_insert_after:N \ducksay_shipout:
+ \l_ducksay_msg_fount_tl
+ \l_ducksay_msg_align_vbox_tl
+ \@afterindentfalse
+ \@afterheading
+ }
+\cs_generate_variant:Nn \coffin_join:NnnNnnnn { NVnNVnnn }
+\cs_generate_variant:Nn \coffin_attach:NnnNnnnn { NVnNVnnn }
+\cs_generate_variant:Nn \coffin_typeset:Nnnnn { NVVnn }
+\cs_generate_variant:Nn \tl_if_eq:nnT { VnT }
+\cs_generate_variant:Nn \str_case:nn { Vn }
+\cs_generate_variant:Nn \regex_replace_all:NnN { Nnc }
+\NewDocumentCommand \ducksay { O{} }
+ {
+ \group_begin:
+ \tl_set:Nn \l_ducksay_say_or_think_tl { say }
+ \ducksay_digest_options:n { #1 }
+ \ducksay_eat_argument:w
+ }
+\NewDocumentCommand \duckthink { O{} }
+ {
+ \group_begin:
+ \tl_set:Nn \l_ducksay_say_or_think_tl { think }
+ \ducksay_digest_options:n { #1 }
+ \ducksay_eat_argument:w
+ }
+%%
+%%
+%% End of file `ducksay.code.v2.tex'.