summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex')
-rw-r--r--Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex40
1 files changed, 27 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex b/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex
index b02332998dc..9bcb0c89d60 100644
--- a/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex
+++ b/Master/texmf-dist/tex/latex/ducksay/ducksay.code.v2.tex
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% --------------------------------------------------------------
%%
-%% Copyright (C) 2017-2019 Jonathan P. Spratte
+%% Copyright (C) 2017-2020 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
@@ -52,6 +52,7 @@
\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
+\bool_new:N \l_ducksay_msg_eq_body_width_bool
\coffin_new:N \l_ducksay_body_coffin
\coffin_new:N \l_ducksay_bubble_close_coffin
\coffin_new:N \l_ducksay_bubble_open_coffin
@@ -79,6 +80,7 @@
,wd* .dim_set:N = \l_ducksay_msg_width_dim
,wd* .initial:n = -\c_max_dim
,wd* .value_required:n = true
+ ,wd-eq-body .bool_set:N = \l_ducksay_msg_eq_body_width_bool
,none .bool_set:N = \l_ducksay_no_body_bool
,no-bubble .bool_set:N = \l_ducksay_no_bubble_bool
,body-mirrored .bool_set:N = \l_ducksay_mirrored_body_bool
@@ -235,8 +237,30 @@
{
\group_begin:
\keys_set:nn { ducksay } { #1 }
- \tl_if_empty:NT \l_ducksay_animal_tl
- { \keys_set:nn { ducksay } { default_animal } }
+ \ducksay_default_or_random_animal:
+ \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
+ \ducksay_make_body_bigger:
+ \relax
+ \end{tabular}
+ }
+ \bool_if:NT \l_ducksay_msg_eq_body_width_bool
+ {
+ \bool_lazy_and:nnT
+ { \int_compare_p:nNn \l_ducksay_msg_width_int < \c_zero_int }
+ { \dim_compare_p:nNn \l_ducksay_msg_width_dim < \c_zero_dim }
+ {
+ \dim_set:Nn \l_ducksay_msg_width_dim
+ { \coffin_wd:N \l_ducksay_body_coffin }
+ }
+ }
+ }
\bool_if:NTF \l_ducksay_eat_arg_box_bool
{
\ducksay_width_case_none_int_dim:nnn
@@ -417,16 +441,6 @@
}
\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
- \ducksay_make_body_bigger:
- \relax
- \end{tabular}
- }
\bool_if:NT \l_ducksay_mirrored_body_bool
{
\coffin_scale:Nnn \l_ducksay_body_coffin