summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ducksay
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-10-09 03:01:22 +0000
committerNorbert Preining <norbert@preining.info>2022-10-09 03:01:22 +0000
commitfec5c6c870d9c855fe6be355b088ca729184bdff (patch)
tree71a8248165da824302289afde2f8bc38397181d6 /macros/latex/contrib/ducksay
parent54f6d0a2d0879db458c3cdc6b2e666c67a0da7b0 (diff)
CTAN sync 202210090301
Diffstat (limited to 'macros/latex/contrib/ducksay')
-rw-r--r--macros/latex/contrib/ducksay/README.md2
-rw-r--r--macros/latex/contrib/ducksay/ducksay.dtx280
-rw-r--r--macros/latex/contrib/ducksay/ducksay.pdfbin486578 -> 543677 bytes
3 files changed, 170 insertions, 112 deletions
diff --git a/macros/latex/contrib/ducksay/README.md b/macros/latex/contrib/ducksay/README.md
index 1e74c85621..763cea25fb 100644
--- a/macros/latex/contrib/ducksay/README.md
+++ b/macros/latex/contrib/ducksay/README.md
@@ -9,7 +9,7 @@ option) any later version. The latest version of this license is in the file:
This work is "maintained" (as per LPPL maintenance status) by
Jonathan P. Spratte.
-Copyright (C) 2017-2020 by Jonathan P. Spratte
+Copyright (C) 2017-2022 by Jonathan P. Spratte
The package draws ASCII art of animals saying a specified message. The following
macros are available:
diff --git a/macros/latex/contrib/ducksay/ducksay.dtx b/macros/latex/contrib/ducksay/ducksay.dtx
index 0c2704d8da..98700c2b74 100644
--- a/macros/latex/contrib/ducksay/ducksay.dtx
+++ b/macros/latex/contrib/ducksay/ducksay.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% File: ducksay.dtx Copyright (C) 2017-2020 Jonathan P. Spratte
+% File: ducksay.dtx Copyright (C) 2017-2022 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
@@ -27,7 +27,7 @@ Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
--------------------------------------------------------------
-Copyright (C) 2017-2020 Jonathan P. Spratte
+Copyright (C) 2017-2022 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
@@ -202,8 +202,8 @@ and the derived files ducksay.pdf
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{xparse,l3keys2e}
-\def\ducksay@version{2.5a}
-\def\ducksay@date{2020-10-29}
+\def\ducksay@version{2.6}
+\def\ducksay@date{2022-10-08}
\ProvidesExplPackage
{ducksay} {\ducksay@date}
@@ -954,8 +954,11 @@ and the derived files ducksay.pdf
% {%
% \tiny
% \hfill
-% \ducksay[sheep,MSG=\footnotesize,msg-align=c]
-% {I'm woolly,\\I'm fluffy,\\and I'm all new!}
+% \ducksay[platypus,MSG=\footnotesize,msg-align=c]
+% {Quack?}\\
+% \hspace*{1cm}%
+% \ducksay[small-horse,MSG=\footnotesize,msg-align=c,body-mirrored]
+% {Neigh, we're new!}
% }
% The following animals are provided by this package. I did not create them (but
% altered some), they belong to their original creators.
@@ -980,7 +983,9 @@ and the derived files ducksay.pdf
% ,dragon^^A
% ,sodomized^^A
% ,hedgehog^^A
+% ,platypus^^A
% ,kangaroo^^A
+% ,small-horse^^A
% ,dog^^A
% ,sheep^^A
% ,rabbit^^A
@@ -1638,6 +1643,8 @@ and the derived files ducksay.pdf
}
\msg_new:nnn { ducksay } { v1-key-only }
{ The~`\l_keys_key_tl`~key~is~only~available~for~`version=1`. }
+\msg_new:nnn { ducksay } { zero-baselineskip }
+ { Current~ baselineskip~ is~ 0pt. }
% \end{macrocode}
%^^A=<<
%
@@ -2006,138 +2013,175 @@ and the derived files ducksay.pdf
% \begin{macro}[internal]{\ducksay_make_body_bigger:}^^A>>=
% \begin{macrocode}
\cs_new:Npn \ducksay_make_body_bigger:
- {
- \int_step_function:nN \l_ducksay_body_bigger_int
- \ducksay_make_body_bigger_aux:n
- }
+ { \prg_replicate:nn \l_ducksay_body_bigger_int \\ }
% \end{macrocode}
% \end{macro}^^A=<<
%
-% \begin{macro}[internal]{\ducksay_make_body_bigger_aux:n}^^A>>=
+% \begin{macro}[internal]{\ducksay_baselineskip:}^^A>>=
+% This is an overly cautious way to get the current baselineskip. Inside of
+% \env{tabular} the baselineskip is 0pt, so we fall back to
+% \cs[no-index]{normalbaselineskip}, or issue an error and fall back to some
+% arbitrary value not producing an error if that one is also 0pt.
% \begin{macrocode}
-\cs_new:Npn \ducksay_make_body_bigger_aux:n #1
+\cs_new_protected_nopar:Npn \ducksay_baselineskip:
{
- \\
+ \the\dimexpr
+ \ifdim \baselineskip = \c_zero_dim
+ \ifdim \normalbaselineskip = \c_zero_dim
+ \msg_expandable_error:nn { ducksay } { zero-baselineskip } { 12pt }
+ 12pt
+ \else
+ \normalbaselineskip
+ \fi
+ \else
+ \baselineskip
+ \fi
+ \relax
}
% \end{macrocode}
% \end{macro}^^A=<<
%
-% \begin{macro}[internal]{\ducksay_shipout:}^^A>>=
+% \begin{macro}[internal]{\ducksay_measure_msg:}^^A>>=
% \begin{macrocode}
-\cs_new_protected:Npn \ducksay_shipout:
+\cs_new_protected_nopar:Npn \ducksay_measure_msg:
{
- \hcoffin_set:Nn \l_ducksay_msg_coffin { \box_use:N \l_ducksay_msg_box }
- \bool_if:NF \l_ducksay_no_bubble_bool
+ \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
{
- \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_wd:N \l_ducksay_msg_box / \box_wd:N \l_ducksay_tmpa_box
+ (
+ \box_ht:N \l_ducksay_msg_box
+ + \box_dp:N \l_ducksay_msg_box
+ )
+ / ( \arraystretch * \ducksay_baselineskip: )
)
}
+ + \l_ducksay_vpad_int
}
- \group_begin:
+ { \l_ducksay_msg_height_int }
+ }
+ }
+% \end{macrocode}
+% \end{macro}^^A=<<
+%
+% \begin{macro}[internal]{\ducksay_set_bubble_coffins:}^^A>>=
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ducksay_set_bubble_coffins:
+ {
+ \hcoffin_set:Nn \l_ducksay_bubble_open_coffin
+ {
\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 }
+ \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 }
{
- \l_ducksay_bubble_delim_right_a_tl
+ \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_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
+ \l_ducksay_bubble_delim_right_c_tl
+ \kern-\l_ducksay_bubble_side_kern_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 }
- }
- \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 }
+ \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 }
+ }
+ }
+% \end{macrocode}
+% \end{macro}^^A=<<
+%
+% \begin{macro}[internal]{\ducksay_join_bubble_to_msg_coffin:}^^A>>=
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ducksay_join_bubble_to_msg_coffin:
+ {
+ \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 }
+ \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 }
+ }
+% \end{macrocode}
+% \end{macro}^^A=<<
+%
+% \begin{macro}[internal]{\ducksay_shipout:}^^A>>=
+% \begin{macrocode}
+\cs_new_protected:Npn \ducksay_shipout:
+ {
+ \hcoffin_set:Nn \l_ducksay_msg_coffin { \box_use:N \l_ducksay_msg_box }
+ \bool_if:NF \l_ducksay_no_bubble_bool
+ {
+ \ducksay_measure_msg:
+ \ducksay_set_bubble_coffins:
\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 }
+ \ducksay_join_bubble_to_msg_coffin:
}
\bool_if:NF \l_ducksay_no_body_bool
{
@@ -2714,6 +2758,20 @@ and the derived files ducksay.pdf
(, ,) ,)
`-_,---_,-'
|| ||}
+%^^A based on joe schmuck (http://www.ascii-art.de/ascii/pqr/platypus.txt)
+\AddAnimal[tail-symbol=s]{platypus}
+| s _.-^~~^^`~-,,,~~''```~-''``~'``~,
+ s ______,' -o :. _ . ; ,'`, `.
+ ( -\.._,.;;'._,( } _`_-_,, `, `,
+ ``~~~~~~' ((/'(((____/~~'(,(,___> `~'|
+\AddAnimal[tail-symbol=s]{small-horse}
+{ s _,_
+ s /._ \\
+ /_/ |_\\ _ __
+ / \\ \\
+ \ _ __ _ /||
+ | | | | ||
+ | | | |}
%</animals>
% \end{macrocode}^^A=<<
%^^A%^^A https://www.asciiart.eu/mythology/fairies
diff --git a/macros/latex/contrib/ducksay/ducksay.pdf b/macros/latex/contrib/ducksay/ducksay.pdf
index dc846e0bf4..6f54d4a73b 100644
--- a/macros/latex/contrib/ducksay/ducksay.pdf
+++ b/macros/latex/contrib/ducksay/ducksay.pdf
Binary files differ