summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fnpct
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-12-23 23:29:19 +0000
committerKarl Berry <karl@freefriends.org>2013-12-23 23:29:19 +0000
commit95f3bfea27839033e3d7abd3fba2bba4dad16181 (patch)
tree909319147fcfedf4adad984aa4823549fd3a1d02 /Master/texmf-dist/tex/latex/fnpct
parent4e4a7b042868c99711ba8b6b1566539e5dd944b2 (diff)
fnpct (23dec13)
git-svn-id: svn://tug.org/texlive/trunk@32474 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fnpct')
-rw-r--r--Master/texmf-dist/tex/latex/fnpct/fnpct.sty156
1 files changed, 57 insertions, 99 deletions
diff --git a/Master/texmf-dist/tex/latex/fnpct/fnpct.sty b/Master/texmf-dist/tex/latex/fnpct/fnpct.sty
index 28e775bec85..60f6c18fb33 100644
--- a/Master/texmf-dist/tex/latex/fnpct/fnpct.sty
+++ b/Master/texmf-dist/tex/latex/fnpct/fnpct.sty
@@ -31,8 +31,8 @@
\RequirePackage { xparse , l3keys2e , scrlfile }
\ProvidesExplPackage
{fnpct}
- {2013/12/22}
- {0.4}
+ {2013/12/23}
+ {0.4a}
{footnote kerning}
% --------------------------------------------------------------------------
@@ -138,7 +138,7 @@
% #3: dimension
\cs_new_protected:Npn \fnpct_set_punctuation_dim:nnn #1#2#3
{
- \prop_put:cnx { l_fnpct_punctuation_marks_#1_prop }
+ \prop_put:cnx { l__fnpct_punctuation_marks_#1_prop }
{ #2 }
{ \dim_eval:n { #3 } }
}
@@ -376,18 +376,8 @@
}
% this is where the magic happens:
-% #1: original command
-% #2: optional argument of original command
-% #3: second optional argument of original command
-% #4: mandatory argument of original command
-% #5: boolean flag for starred version
-\cs_new_protected:Npn \fnpct_handle_note:Nnnnn #1#2#3#4#5
+\cs_new_protected:Npn \fnpct_handle_punctuation:n #1
{
- % if a punctuation mark follows remove it, insert dot, skip back
- % and then insert footnote
- \fnpct_no_break:
- \bool_if:NF \l__fnpct_dont_mess_around_bool
- { \IfBooleanT { #5 } { \bool_set_true:N \l__fnpct_reverse_switch_bool } }
\fnpct_check_punctuation:TF
{
% this is need as some commands like biblatex's \autocite may in turn
@@ -398,12 +388,13 @@
% B: after=1 && reverse=1
% after=0 && reverse=0
\fnpct_punct_if_after:TF
- { \fnpct_no_break: \skip_horizontal:N \l__fnpct_before_footnote_dim }
{
- \tl_use:N \l__fnpct_current_punct_mark_tl
\fnpct_no_break:
- \prop_get:NVNT
- \l__fnpct_punctuation_marks_after_prop
+ \skip_horizontal:N \l__fnpct_before_footnote_dim
+ }
+ {
+ \tl_use:N \l__fnpct_current_punct_mark_tl
+ \prop_get:NVNT \l__fnpct_punctuation_marks_after_prop
\l__fnpct_current_punct_mark_tl
\l__fnpct_tmpa_tl
{
@@ -411,22 +402,24 @@
\skip_horizontal:N \l__fnpct_tmpa_dim
\fnpct_no_break:
\skip_horizontal:N \c_zero_skip
+ \fnpct_no_break:
}
}
- \fnpct_write_note:Nnnn #1 { #2 } { #3 } { #4 }
- \fnpct_write_inner:N #1
+ #1
+ \bool_gset_false:N \g__fnpct_after_punctuation_bool
\fnpct_punct_if_after:T
{
\fnpct_no_break:
- \prop_get:NVNT
- \l__fnpct_punctuation_marks_before_prop
+ \prop_get:NVNT \l__fnpct_punctuation_marks_before_prop
\l__fnpct_current_punct_mark_tl
\l__fnpct_tmpa_tl
{
\dim_set:Nn \l__fnpct_tmpa_dim { \l__fnpct_tmpa_tl }
\skip_horizontal:N \l__fnpct_tmpa_dim
+ \fnpct_no_break:
+ \skip_horizontal:N \c_zero_skip
+ \fnpct_no_break:
}
- \fnpct_no_break:
\tl_use:N \l__fnpct_current_punct_mark_tl
}
\bool_set_false:N \l__fnpct_reverse_switch_bool
@@ -440,14 +433,11 @@
\bool_set_true:N \l__fnpct_multiple_footnotes_bool
% else insert space and then note
\fnpct_no_break:
- \bool_if:NTF \g__fnpct_after_punctuation_bool
- { \bool_gset_false:N \g__fnpct_after_punctuation_bool }
+ \bool_if:NF \g__fnpct_after_punctuation_bool
{ \skip_horizontal:N \l__fnpct_before_footnote_dim }
- \fnpct_write_note:Nnnn #1 { #2 } { #3 } { #4 }
- \fnpct_write_inner:N #1
+ #1
\fnpct_no_break:
\textsuperscript { \l__fnpct_multiple_footnote_separator_tl }
- % \bool_set_false:N \l__fnpct_reverse_switch_bool
}
{
% else insert space and then note
@@ -455,14 +445,35 @@
{ \bool_set_false:N \l__fnpct_multiple_footnotes_bool }
{
\fnpct_no_break:
- \bool_if:NTF \g__fnpct_after_punctuation_bool
- { \bool_gset_false:N \g__fnpct_after_punctuation_bool }
+ \bool_if:NF \g__fnpct_after_punctuation_bool
{ \skip_horizontal:N \l__fnpct_before_footnote_dim }
}
- \fnpct_write_note:Nnnn #1 { #2 } { #3 } { #4 }
- \fnpct_write_inner:N #1
+ #1
\bool_set_false:N \l__fnpct_reverse_switch_bool
}
+ \bool_gset_false:N \g__fnpct_after_punctuation_bool
+ }
+ }
+
+
+% #1: original command
+% #2: optional argument of original command
+% #3: second optional argument of original command
+% #4: mandatory argument of original command
+% #5: boolean flag for starred version
+\cs_new_protected:Npn \fnpct_handle_note:Nnnnn #1#2#3#4#5
+ {
+ % if a punctuation mark follows remove it, insert dot, skip back
+ % and then insert footnote
+ \bool_if:NF \l__fnpct_dont_mess_around_bool
+ {
+ \IfBooleanT { #5 }
+ { \bool_set_true:N \l__fnpct_reverse_switch_bool }
+ }
+ \fnpct_handle_punctuation:n
+ {
+ \fnpct_write_note:Nnnn #1 { #2 } { #3 } { #4 }
+ \fnpct_write_inner:N #1
}
}
\cs_generate_variant:Nn \fnpct_handle_note:Nnnnn { cnnnn }
@@ -478,83 +489,29 @@
\cs_new_protected:Npn \fnpct_mult_note:Nnn #1#2#3
{
\bool_if:NF \l__fnpct_dont_mess_around_bool
- { \IfBooleanT { #2 } { \bool_set_true:N \l__fnpct_reverse_switch_bool } }
+ {
+ \IfBooleanT { #2 }
+ { \bool_set_true:N \l__fnpct_reverse_switch_bool }
+ }
% split input:
\seq_set_split:NVn \l__fnpct_multiple_footnotes_seq
\l__fnpct_multiple_footnotes_delimiter_tl
{ #3 }
- \fnpct_no_break:
- % look for punctuation mark and do magic:
- \fnpct_check_punctuation:TF
- {
- \bool_gset_true:N \g__fnpct_after_punctuation_bool
- \fnpct_punct_if_after:TF
- { \fnpct_no_break: \skip_horizontal:N \l__fnpct_before_footnote_dim }
- {
- \tl_use:N \l__fnpct_current_punct_mark_tl
- \fnpct_no_break:
- \prop_get:NVNT \l__fnpct_punctuation_marks_after_prop
- \l__fnpct_current_punct_mark_tl
- \l__fnpct_tmpa_tl
- {
- \dim_set:Nn \l__fnpct_tmpa_dim { \l__fnpct_tmpa_tl }
- \skip_horizontal:N \l__fnpct_tmpa_dim
- \fnpct_no_break:
- \skip_horizontal:N \c_zero_skip
- }
- }
- \fnpct_write_notes:N #1
- \fnpct_punct_if_after:T
- {
- \prop_get:NVNT \l__fnpct_punctuation_marks_before_prop
- \l__fnpct_current_punct_mark_tl
- \l__fnpct_tmpa_tl
- {
- \dim_set:Nn \l__fnpct_tmpa_dim { \l__fnpct_tmpa_tl }
- \skip_horizontal:N \l__fnpct_tmpa_dim
- }
- \fnpct_no_break:
- \tl_use:N \l__fnpct_current_punct_mark_tl
- }
- \bool_set_false:N \l__fnpct_reverse_switch_bool
- }
- {
- % else insert space and notes:
- \fnpct_check_multiple:TF
- {
- \bool_set_true:N \l__fnpct_multiple_footnotes_bool
- \fnpct_no_break:
- \bool_if:NTF \g__fnpct_after_punctuation_bool
- { \bool_gset_false:N \g__fnpct_after_punctuation_bool }
- { \skip_horizontal:N \l__fnpct_before_footnote_dim }
- \fnpct_write_notes:N #1
- \bool_set_false:N \l__fnpct_reverse_switch_bool
- \textsuperscript { \l__fnpct_multiple_footnote_separator_tl }
- }
- {
- \bool_if:NTF \l__fnpct_multiple_footnotes_bool
- { \bool_set_false:N \l__fnpct_multiple_footnotes_bool }
- {
- \fnpct_no_break:
- \bool_if:NTF \g__fnpct_after_punctuation_bool
- { \bool_gset_false:N \g__fnpct_after_punctuation_bool }
- { \skip_horizontal:N \l__fnpct_before_footnote_dim }
- }
- \fnpct_write_notes:N #1
- \bool_set_false:N \l__fnpct_reverse_switch_bool
- }
- }
+ \fnpct_handle_punctuation:n
+ { \fnpct_write_notes:NN #1 \l__fnpct_multiple_footnotes_seq }
+
}
\cs_generate_variant:Nn \fnpct_mult_note:Nnn { cnn }
\int_new:N \l__fnpct_multiple_notes_int
% #1: original note command
-\cs_new_protected:Npn \fnpct_write_notes:N #1
+% #2: sequence variable holding the note arguments
+\cs_new_protected:Npn \fnpct_write_notes:NN #1#2
{
\int_zero:N \l__fnpct_multiple_notes_int
- \seq_map_inline:Nn \l__fnpct_multiple_footnotes_seq
+ \seq_map_inline:Nn #2
{
- \fnpct_read_note_with_option:w ##1 \q_stop { #1 }
+ \__fnpct_read_note_with_option:w ##1 \q_stop { #1 }
\int_incr:N \l__fnpct_multiple_notes_int
}
}
@@ -567,7 +524,7 @@
% #4: mandatory argument to original note command
% #5: original note command
\bool_new:N \g__fnpct_only_text_bool
-\NewDocumentCommand \fnpct_read_note_with_option:w { soo+u{\q_stop}m }
+\NewDocumentCommand \__fnpct_read_note_with_option:w { soo+u{\q_stop}m }
{
\bool_if:nT
{
@@ -1128,8 +1085,8 @@
2013/04/07 v0.2k - bug fix: suppress possible break point between footnote
mark and punctuation mark if `punct-after=true' has
been set
- - new: \AdaptNoteNoOpt, \AdaptNoteNoOptNoMult
2013/04/16 v0.3 - adapt \footref if it exists
+ - new: \AdaptNoteNoOpt, \AdaptNoteNoOptNoMult
2013/06/14 v0.3a - various internal commands needed to be defined
protected
2013/12/22 v0.4 - when biblatex's \autocite is adapted a fix was needed:
@@ -1138,6 +1095,7 @@
- adapt to French language settings
- clearer distinction between internal commands and
document commands
+2013/12/23 v0.4a - fix bug introcuded in v0.4 due to a typo
% --------------------------------------------------------------------------
% NOTES: