@@ -137,6 +137,14 @@ =head1 DESCRIPTION
137
137
unnecessary in a static output format.) Default: 1, except 0 for
138
138
DropDownTF.
139
139
140
+ =item C<S<< inlineSize => number >>>
141
+
142
+ In PDF output, this controls break point between printing the list of
143
+ options as an inline list [A/B/C] or multiline bullet list. If the total
144
+ number of characters (of all items combined) is greater than this setting,
145
+ or an item contains a '[', '/', or ']' character, then the list of options
146
+ is printed as a bullet list, otherwise an inline list is used. Default: 25
147
+
140
148
=back
141
149
142
150
To insert the drop-down into the problem text when using PGML:
@@ -231,6 +239,7 @@ sub new {
231
239
choices => $choices ,
232
240
placeholder => $options {placeholder } // ' ' ,
233
241
showInStatic => $options {showInStatic } // 1,
242
+ inlineSize => $options {inlineSize } // 25,
234
243
values => $options {values } // [],
235
244
noindex => $options {noindex } // 0
236
245
}, $class ;
@@ -437,15 +446,13 @@ sub MENU {
437
446
$menu = qq( <fillin name="$name "/>) ;
438
447
}
439
448
} elsif ($main::displayMode eq " TeX" && $self -> {showInStatic }) {
440
- # if the total number of characters is not more than
441
- # 30 and not containing / or ] then we print out
449
+ # Unless the total number of characters is more than the inlineSize
450
+ # setting (default 25), or contains [, ], or / then we print out
442
451
# the select as a string: [A/B/C]
443
- if (length (join (' ' , @list )) < 25
444
- && !grep (/ (\/ |\[ |\] )/ , @list ))
445
- {
452
+ unless (length (join (' ' , @list )) > $self -> {inlineSize } || grep (/ (\/ |\[ |\] )/ , @list )) {
446
453
$menu = ' [' . join (' /' , map { $self -> quoteTeX($_ ) } @list ) . ' ]' ;
447
454
} else {
448
- # otherwise we print a bulleted list
455
+ # Otherwise we print a bulleted list.
449
456
$menu = ' \par\vtop{\def\bitem{\hbox\bgroup\indent\strut\textbullet\ \ignorespaces}\let\eitem=\egroup' ;
450
457
$menu = " \n " . $menu . " \n " ;
451
458
foreach my $option (@list ) {
0 commit comments