summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/acro/README6
-rw-r--r--Master/texmf-dist/doc/latex/acro/acro_en.pdfbin541464 -> 547227 bytes
-rw-r--r--Master/texmf-dist/doc/latex/acro/acro_en.tex108
-rw-r--r--Master/texmf-dist/tex/latex/acro/acro.sty438
4 files changed, 387 insertions, 165 deletions
diff --git a/Master/texmf-dist/doc/latex/acro/README b/Master/texmf-dist/doc/latex/acro/README
index 2dc30b17092..ad3168fceb1 100644
--- a/Master/texmf-dist/doc/latex/acro/README
+++ b/Master/texmf-dist/doc/latex/acro/README
@@ -1,9 +1,9 @@
--------------------------------------------------------------------------
-the ACRO package v2.0b
+the ACRO package v2.1
Typeset Acronyms
-2015/08/29
+2015/09/05
--------------------------------------------------------------------------
Clemens Niederberger
Web: http://www.mychemistry.eu/forums/forum/acro/
@@ -24,7 +24,7 @@ This work has the LPPL maintenance status `maintained'.
The Current Maintainer of this work is Clemens Niederberger.
--------------------------------------------------------------------------
The acro package consists of the files
- - acro.sty, acro0.def, acro1.def, acro_en.tex, acro_en.pdf, README
+ - acro.sty, acro_en.tex, acro_en.pdf, README
--------------------------------------------------------------------------
If you have any ideas, questions, suggestions or bugs to report, please
feel free to contact me.
diff --git a/Master/texmf-dist/doc/latex/acro/acro_en.pdf b/Master/texmf-dist/doc/latex/acro/acro_en.pdf
index ceb64feccad..ee81c0b7230 100644
--- a/Master/texmf-dist/doc/latex/acro/acro_en.pdf
+++ b/Master/texmf-dist/doc/latex/acro/acro_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/acro/acro_en.tex b/Master/texmf-dist/doc/latex/acro/acro_en.tex
index 387af88c967..e0f90fe47a0 100644
--- a/Master/texmf-dist/doc/latex/acro/acro_en.tex
+++ b/Master/texmf-dist/doc/latex/acro/acro_en.tex
@@ -398,6 +398,12 @@ documentation.
\keyval{accsupp}{text}
sets the \code{ActualText} key as presented by the \pkg{accsupp} package
for the acronym.
+ %% tooltip
+ \keyval{tooltip}{text}
+ \sinceversion{2.1}sets the tooltip description for an acronym. For
+ actually getting tooltips you also need an appropriate setting of the
+ \option{tooltip-cmd} option or to set the package option
+ \option{tooltip}.
%% index-sort
\keyval{index-sort}{text}
\sinceversion{1.1}If you use the package option \option{index} every
@@ -410,7 +416,7 @@ documentation.
\sinceversion{1.1}This key allows to overwrite the automatic index entry
with an arbitrary one. See section~\ref{ssec:index} for details.
%% index-cmd
- \keyval{index-cmd}{text}
+ \keyval{index-cmd}{control sequence}
\sinceversion{1.1}This key let's you set an individual index creating
command for this acronym. It should be a command that takes one mandatory
argument. See section~\ref{ssec:index} for details.
@@ -794,18 +800,20 @@ used:
\sinceversion{0.6a}Mark all acronyms as used.
\end{commands}
-\subsection{\cs*{ac} and Friends in \acs*{pdf} Bookmarks}
-\noindent\sinceversion{0.5}\acro's commands usually are not expandable which
-means they'd leave unallowed tokens in \acs{pdf} bookmarks. \pkg{hyperref}
-offers \cs*{texorpdfstring} to circumvent that issue manually but that isn't
-really a nice solution. What's the point of having macros to get output for
-you if you have to specify it manually after all?
-
-That is why \acro\ offers a preliminary solution for this. In a bookmark
-every \cs{ac} like command falls back to a simple text string typesetting what
-\cs{acs} would do (or \cs{acsp} for plural forms). These text strings both
-can accessed manually and can be modified to an output reserved for \acs{pdf}
-bookmarks.
+\subsection{\cs*{ac} and Friends in \acs*{pdf} Bookmarks, Accessibility
+ Support, Tooltips}
+\subsubsection{\acs*{pdf} Bookmarks}
+\acro's commands usually are not expandable which means they'd leave unallowed
+tokens in \acs{pdf} bookmarks. \pkg{hyperref} offers \cs*{texorpdfstring} to
+circumvent that issue manually but that isn't really a nice solution. What's
+the point of having macros to get output for you if you have to specify it
+manually after all?
+
+That is why \acro\ offers\sinceversion{0.5} a preliminary solution for this.
+In a bookmark every \cs{ac} like command falls back to a simple text string
+typesetting what \cs{acs} would do (or \cs{acsp} for plural forms). These
+text strings both can accessed manually and can be modified to an output
+reserved for \acs{pdf} bookmarks.
\begin{commands}
\command{acpdfstring}[\marg{id}]
@@ -817,13 +825,8 @@ bookmarks.
\keylit{pdfstring}{\Marg{\meta{pdfstring}/\meta{plural ending}}}
Key for \cs{DeclareAcronym} to declare a custom text string for \acs{pdf}
bookmarks. The plural ending can be set optionally.
- \keyval{accsupp}{text}
- \sinceversion{1.0}Key for \cs{DeclareAcronym} to set the \code{ActualText}
- property of \cs*{BeginAccSupp} (see \pkg{accsupp}'s documentation for
- details) to be used for an acronym. It only has an effect when the
- package option \option{accsupp} is used, too.
\end{options}
-
+
For example the \acs{pdf} acronym used in the title for this section is defined
as follows:
\begin{sourcecode}
@@ -835,14 +838,56 @@ as follows:
accsupp = PDF
}
\end{sourcecode}
-
-This also demonstrates the \option{accsupp} key. For this to work you need to
-use the \emph{package option} \option{accsupp}, too, which will load the
-package \pkg{accsupp}. Then the key \option{accsupp} will set the
-\code{ActualText} property of \cs*{BeginAccSupp}. Please refer to
-\pkg{accsupp}'s documentation for details. To see its effect copy \ac{pdf}
-and paste it into a text file. You should get uppercase letters instead of
-lowercase ones.
+
+\subsubsection{Accessibility Support}
+
+The last example also demonstrates the \option{accsupp} key. The idea is to
+have something different visible in the \acs{pdf} file compared to what you
+get when you select and copy the corresponding string. In the example visible
+string is a lowercase \code{pdf} in small caps while the string copied is an
+uppercase \code{PDF}.
+
+For this to work you need to use the \emph{package option} \option{accsupp},
+too, which will load the package \pkg{accsupp} if it isn't loaded by the user
+already. Then the key \option{accsupp} will set the \code{ActualText}
+property of \cs*{BeginAccSupp}. Please refer to \pkg{accsupp}'s documentation
+for details. To see its effect copy \ac{pdf} and paste it into a text file.
+You should get uppercase letters instead of lowercase ones.
+
+\begin{options}
+ \keyval{accsupp}{text}
+ \sinceversion{1.0}Key for \cs{DeclareAcronym} to set the \code{ActualText}
+ property of \cs*{BeginAccSupp} (see \pkg{accsupp}'s documentation for
+ details) to be used for an acronym. It only has an effect when the
+ package option \option{accsupp} is used, too.
+\end{options}
+
+\subsubsection{Tooltips}
+
+The idea of a tooltip is to have some text shown when you hover with the
+mouse over the short form of an acronym. This is only available in some
+\acs{pdf} viewers, though. On possibility for such tooltips is loading the
+\pkg{pdfcomment} package~\cite{pkg:pdfcomment} and using its \cs*{pdftooltip}
+macro.
+
+\begin{options}
+ \keybool{tooltip}\Default{false}
+ This\sinceversion{2.1} options loads the \pkg{pdfcomment} package and sets
+ the command for creating tooltips to \cs*{pdftooltip}.
+ \keyval{tooltip-cmd}{control sequence}\Default{\cs*{@firstoftwo}}
+ This\sinceversion{2.1} allows users using another macro for tooltips --
+ maybe one provided by another package or some own macro. It needs to be a
+ macro with two mandatory arguments, the first being the string typeset in
+ the \acs{pdf}, the second being the tooltip description text.
+\end{options}
+
+For using this with acronyms they have a property \option{tooltip} which can
+be used inside \cs{DeclareAcronym} for specifying the description text of the
+tooltip. If the \option{tooltip} package option is used but the property is
+not set for an acronym then the \option{long} property is used instead.
+
+If an acronym is used inside of another acronym then the tooltips of the
+``inner'' acronyms are disabled.
\subsection{Adding Acronyms to the Index}\label{ssec:index}
\noindent\sinceversion{1.1}\acro\ has the package option \option{index}. If it is
@@ -1025,6 +1070,15 @@ There are a few options which change the general behaviour of \acro.
\sinceversion{1.0}Activates the access support as provided by the
\pkg{accsupp} package.
%%
+ \keybool{tooltip}\Default{false}
+ \sinceversion{2.1}Activates tooltip support for \acro\ using the
+ \pkg{pdfcomment} package.
+ %%
+ \keyval{tooltip-cmd}{control sequence}\Default{\cs*{@firstoftwo}}
+ \sinceversion{2.1}A macro taking two mandatory arguments, the first being
+ the short form of the acronym and the second being some tooltip
+ description.
+ %%
\keyval{uc-cmd}{control sequence}\Default{\cs{acfirstupper}}
The command that is used to capitalize the first word in the \cs{Ac} and
the like commands. You can change it to another one like for example
diff --git a/Master/texmf-dist/tex/latex/acro/acro.sty b/Master/texmf-dist/tex/latex/acro/acro.sty
index 67a429a5a4b..d9b996a194a 100644
--- a/Master/texmf-dist/tex/latex/acro/acro.sty
+++ b/Master/texmf-dist/tex/latex/acro/acro.sty
@@ -23,16 +23,16 @@
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
% The acro package consists of the files
-% - acro.sty, acro0.def, acro1.def, acro_en.tex, acro_en.pdf, README
+% - acro.sty, acro_en.tex, acro_en.pdf, README
% --------------------------------------------------------------------------
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-\RequirePackage{expl3,l3sort,xparse,l3keys2e,xtemplate}
+\RequirePackage{expl3,l3sort,xparse,l3keys2e,xtemplate,etoolbox}
\ProvidesExplPackage
{acro}
- {2015/08/29}
- {2.0b}
+ {2015/09/05}
+ {2.1}
{Typeset Acronyms}
% --------------------------------------------------------------------------
@@ -88,8 +88,6 @@
}
% message macros:
-\bool_new:N \l__acro_silence_bool
-
\cs_new:Npn \__acro_remove_backslash:N #1
{ \exp_after:wN \use_none:n \token_to_str:N #1 }
@@ -165,6 +163,7 @@
% --------------------------------------------------------------------------
% boolean variables:
+\bool_new:N \l__acro_silence_bool
\bool_new:N \l__acro_mark_as_used_bool
\bool_new:N \g__acro_mark_first_as_used_bool
\bool_new:N \l__acro_use_single_bool
@@ -189,6 +188,8 @@
\bool_set_true:N \l__acro_citation_first_bool
\bool_new:N \l__acro_group_citation_bool
\bool_new:N \l__acro_acc_supp_bool
+\bool_new:N \l__acro_tooltip_bool
+\bool_new:N \l__acro_inside_tooltip_bool
\bool_new:N \l__acro_following_page_bool
\bool_new:N \l__acro_following_pages_bool
\bool_new:N \l__acro_record_pages_bool
@@ -286,6 +287,9 @@
{ \dim_set:Nn \l__acro_table_width_dim { .7\columnwidth } }
\dim_new:N \l__acro_page_space_dim
+\dim_new:N \l__acro_short_width_dim
+\dim_set:Nn \l__acro_short_width_dim {3em}
+
% --------------------------------------------------------------------------
% small commands for use at various places
\cs_new:Npn \acro_no_break: { \tex_penalty:D \c_ten_thousand }
@@ -313,6 +317,9 @@
messages .value_required:n = true ,
accsupp .bool_set:N = \l__acro_acc_supp_bool ,
accsupp-options .tl_set:N = \l__acro_acc_supp_options_tl ,
+ tooltip .bool_set:N = \l__acro_tooltip_bool ,
+ tooltip-cmd .code:n = \cs_set:Npn \__acro_tooltip_cmd:nn {#1} ,
+ tooltip-cmd .value_required:n = true ,
macros .bool_set:N = \l__acro_create_macros_bool ,
xspace .bool_set:N = \l__acro_xspace_bool ,
strict .bool_set:N = \l__acro_strict_bool ,
@@ -336,6 +343,8 @@
foreign-format .value_required:n = true ,
list-short-format .tl_set:N = \l__acro_list_short_format_tl ,
list-short-format .value_required:n = true ,
+ list-short-width .dim_set:N = \l__acro_short_width_dim ,
+ list-short-width .value_required:n = true ,
list-long-format .tl_set:N = \l__acro_list_long_format_tl ,
list-long-format .value_required:n = true ,
list-foreign-format .tl_set:N = \l__acro_foreign_list_format_tl ,
@@ -376,6 +385,10 @@
next-page .value_required:n = true ,
next-pages .tl_set:N = \l__acro_next_pages_tl ,
next-pages .value_required:n = true ,
+ % TODO: get rid of list-type (set it implicitly?)
+ % proposed syntax: list-style = table : longtable
+ % with list-style = longtable
+ % being an alias if it is unique
list-style .tl_set:N = \l__acro_list_instance_tl ,
list-style .value_required:n = true ,
list-type .tl_set:N = \l__acro_list_type_tl ,
@@ -457,7 +470,7 @@
\cs_new_eq:NN \acro_hyper_target:nn \use_ii:nn
\cs_new_eq:NN \acro_hyper_link:nn \use_ii:nn
-\cs_new_protected:Npn \__acro_activate_hyperref_support:
+\cs_new_protected:Npn \acro_activate_hyperref_support:
{
\bool_if:nT { \l__acro_hyperref_loaded_bool && \l__acro_use_hyperref_bool }
{
@@ -517,10 +530,10 @@
% #1: id
% #2: short
% #3: long
-\DeclareObjectType { acro-first } { 3 }
+\DeclareObjectType {acro-first} {3}
% template for inline appearance:
-\DeclareTemplateInterface { acro-first } { inline } { 3 }
+\DeclareTemplateInterface {acro-first} {inline} {3}
{
brackets : boolean = true ,
brackets-type : tokenlist = () ,
@@ -529,7 +542,7 @@
between : tokenlist ,
foreign-sep : tokenlist = { , ~ }
}
-\DeclareTemplateCode { acro-first } { inline } { 3 }
+\DeclareTemplateCode {acro-first} {inline} {3}
{
brackets = \l__acro_first_use_brackets_bool ,
brackets-type = \l__acro_first_brackets_tl ,
@@ -580,9 +593,7 @@
\prop_map_inline:Nn \l__acro_trailing_tokens_prop
{ \acro_deactivate_trailing_action:n {##1} }
}
- \acro_get_ending_form:nn {#1} {short}
- \acro_acc_supp:nn {#1} { \acro_write_short:nn {#1} {#2} }
- \acro_endings:nn {#1} {short}
+ \acro_write_compact:nn {#1} {short}
\group_end:
\bool_if:nT
{ \l__acro_group_citation_bool && !\l__acro_first_reversed_bool }
@@ -670,22 +681,22 @@
}
% the different styles:
-\DeclareInstance { acro-first }
+\DeclareInstance {acro-first}
{ default }
{ inline }
{ }
-\DeclareInstance { acro-first }
+\DeclareInstance {acro-first}
{ square }
{ inline }
{ brackets-type = [] }
-\DeclareInstance { acro-first }
+\DeclareInstance {acro-first}
{ plain }
{ inline }
{
brackets = false ,
between = --
}
-\DeclareInstance { acro-first }
+\DeclareInstance {acro-first}
{ plain-reversed }
{ inline }
{
@@ -693,35 +704,35 @@
between = -- ,
reversed = true
}
-\DeclareInstance { acro-first }
+\DeclareInstance {acro-first}
{ footnote }
{ note }
{ }
-\DeclareInstance { acro-first }
+\DeclareInstance {acro-first}
{ sidenote }
{ note }
{ note-command = \sidenote {#1} }
-\DeclareInstance { acro-first }
+\DeclareInstance {acro-first}
{ empty }
{ note }
{ use-note = false }
-\DeclareInstance { acro-first }
+\DeclareInstance {acro-first}
{ short }
{ inline }
{
only-short = true ,
brackets = false
}
-\DeclareInstance { acro-first }
+\DeclareInstance {acro-first}
{ reversed }
{ inline }
{ reversed = true }
% --------------------------------------------------------------------------
% formatting the extras information:
-\DeclareObjectType { acro-extra } { 1 }
+\DeclareObjectType {acro-extra} {1}
-\DeclareTemplateInterface { acro-extra } { default } { 1 }
+\DeclareTemplateInterface {acro-extra} {default} {1}
{
punct : boolean = false ,
punct-symbol : tokenlist = {,} ,
@@ -729,7 +740,7 @@
brackets-type : tokenlist = ()
}
-\DeclareTemplateCode { acro-extra } { default } { 1 }
+\DeclareTemplateCode {acro-extra} {default} {1}
{
punct = \l__acro_extra_punct_bool ,
punct-symbol = \l__acro_extra_punct_tl ,
@@ -748,20 +759,20 @@
}
% the different styles:
-\DeclareInstance { acro-extra } { default } { default }
+\DeclareInstance {acro-extra} {default} {default}
{ brackets = false , punct = true , punct-symbol = . }
-\DeclareInstance { acro-extra } { plain } { default }
- { brackets = false , punct = false }
-\DeclareInstance { acro-extra } { paren } { default }
+\DeclareInstance {acro-extra} {plain} {default}
+ { brackets = false , punct = true , punct-symbol = }
+\DeclareInstance {acro-extra} {paren} {default}
{ punct = true , punct-symbol = }
-\DeclareInstance { acro-extra } { bracket } { default }
+\DeclareInstance {acro-extra} {bracket} {default}
{ punct = true , punct-symbol = , brackets-type=[] }
-\DeclareInstance { acro-extra } { comma } { default }
+\DeclareInstance {acro-extra} {comma} {default}
{ punct = true, brackets = false }
% --------------------------------------------------------------------------
% outputting the page numbers:
-\RequirePackage { zref-abspage }
+\RequirePackage {zref-abspage}
\cs_new_protected:Npn \acro_create_page_records:n #1
{
@@ -927,9 +938,9 @@
\cs_generate_variant:Nn \acro_determine_page_ranges:NNn { NNV }
% --------------------------------------------------------------------------
-\DeclareObjectType { acro-page-number } { 1 }
+\DeclareObjectType {acro-page-number} {1}
-\DeclareTemplateInterface { acro-page-number } { default } { 1 }
+\DeclareTemplateInterface {acro-page-number} {default} {1}
{
display : boolean = true ,
punct : boolean = false ,
@@ -939,7 +950,7 @@
space : length = .3ex
}
-\DeclareTemplateCode { acro-page-number } { default } { 1 }
+\DeclareTemplateCode {acro-page-number} {default} {1}
{
display = \l__acro_page_display_bool ,
punct = \l__acro_page_punct_bool ,
@@ -964,14 +975,15 @@
}
% the different styles:
-\DeclareInstance { acro-page-number } { default } { default }
+\DeclareInstance {acro-page-number} {default} {default}
{ punct = true , punct-symbol = . }
-\DeclareInstance { acro-page-number } { plain } { default }
+\DeclareInstance {acro-page-number} {plain} {default}
{ punct = false }
-\DeclareInstance { acro-page-number } { comma } { default } { punct = true }
-\DeclareInstance { acro-page-number } { paren } { default }
+\DeclareInstance {acro-page-number} {comma} {default}
+ { punct = true }
+\DeclareInstance {acro-page-number} {paren} {default}
{ brackets=true , punct-symbol = ~ }
-\DeclareInstance { acro-page-number } { none } { default }
+\DeclareInstance {acro-page-number} {none} {default}
{ display = false }
% --------------------------------------------------------------------------
@@ -991,36 +1003,36 @@
}
% the different styles:
-\DeclareInstance {acro-title} {chapter*} {sectioning}
+\DeclareInstance {acro-title} {chapter*} {sectioning}
{ name-format = \chapter* {#1} }
-\DeclareInstance {acro-title} {part*} {sectioning}
+\DeclareInstance {acro-title} {part*} {sectioning}
{ name-format = \part* {#1} }
-\DeclareInstance {acro-title} {section*} {sectioning}
+\DeclareInstance {acro-title} {section*} {sectioning}
{ name-format = \section* {#1} }
-\DeclareInstance {acro-title} {subsection*} {sectioning}
+\DeclareInstance {acro-title} {subsection*} {sectioning}
{ name-format = \subsection* {#1} }
\DeclareInstance {acro-title} {subsubsection*} {sectioning}
{ name-format = \subsubsection* {#1} }
-\DeclareInstance {acro-title} {chapter} {sectioning}
+\DeclareInstance {acro-title} {chapter} {sectioning}
{ name-format = \chapter {#1} }
-\DeclareInstance {acro-title} {part} {sectioning}
+\DeclareInstance {acro-title} {part} {sectioning}
{ name-format = \part {#1} }
-\DeclareInstance {acro-title} {section} {sectioning}
+\DeclareInstance {acro-title} {section} {sectioning}
{ name-format = \section {#1} }
-\DeclareInstance {acro-title} {subsection} {sectioning}
+\DeclareInstance {acro-title} {subsection} {sectioning}
{ name-format = \subsection {#1} }
-\DeclareInstance {acro-title} {subsubsection} {sectioning}
+\DeclareInstance {acro-title} {subsubsection} {sectioning}
{ name-format = \subsubsection {#1} }
-\DeclareInstance {acro-title} {addchap} {sectioning}
+\DeclareInstance {acro-title} {addchap} {sectioning}
{ name-format = \addchap {#1} }
-\DeclareInstance {acro-title} {addsec} {sectioning}
+\DeclareInstance {acro-title} {addsec} {sectioning}
{ name-format = \addsec {#1} }
-\DeclareInstance {acro-title} {none} {sectioning}
+\DeclareInstance {acro-title} {none} {sectioning}
{ name-format = \use_none:n {#1} }
% --------------------------------------------------------------------------
% outputting the whole list
-\DeclareObjectType { acro-list } { 3 }
+\DeclareObjectType {acro-list} {3}
% #1: id
% #2: excluded classes
@@ -1091,35 +1103,41 @@
{
\tl_if_blank:nTF {#1}
{
- \acro_print_list_short:nn {##1} {##2}
- \bool_if:NT \l__acro_capitalize_list_bool
- { \bool_set_true:N \l__acro_first_upper_bool }
- \acro_print_list_long:n {##1}
- \bool_set_false:N \l__acro_first_upper_bool
- \bool_if:NT \l__acro_foreign_bool
- { \acro_get_foreign:n {##1} }
- \acro_print_list_extra:n {##1}
- \acro_print_list_page:n {##1}
+ \acro_print_list_entry:nnn
+ { \acro_print_list_short:nn {##1} {##2} }
+ {
+ \bool_if:NT \l__acro_capitalize_list_bool
+ { \bool_set_true:N \l__acro_first_upper_bool }
+ \acro_print_list_long:n {##1}
+ \bool_set_false:N \l__acro_first_upper_bool
+ \bool_if:NT \l__acro_foreign_bool
+ { \acro_get_foreign:n {##1} }
+ \acro_print_list_extra:n {##1}
+ }
+ { \acro_print_list_page:n {##1} }
}
{
\clist_map_inline:nn {#1}
{
\prop_get:NnNT \l__acro_class_prop {##1} \l__acro_tmpa_tl
{
- \tl_set:Nn \l__acro_tmpb_tl { ####1 }
+ \tl_set:Nn \l__acro_tmpb_tl {####1}
\tl_trim_spaces:N \l__acro_tmpa_tl
\tl_trim_spaces:N \l__acro_tmpb_tl
\tl_if_eq:NNT \l__acro_tmpa_tl \l__acro_tmpb_tl
{
- \acro_print_list_short:nn {##1} { ##2 }
- \bool_if:NT \l__acro_capitalize_list_bool
- { \bool_set_true:N \l__acro_first_upper_bool }
- \acro_print_list_long:n {##1}
- \bool_set_false:N \l__acro_first_upper_bool
- \bool_if:NT \l__acro_foreign_bool
- { \acro_get_foreign:n {##1} }
- \acro_print_list_extra:n {##1}
- \acro_print_list_page:n {##1}
+ \acro_print_list_entry:nnn
+ { \acro_print_list_short:nn {##1} {##2} }
+ {
+ \bool_if:NT \l__acro_capitalize_list_bool
+ { \bool_set_true:N \l__acro_first_upper_bool }
+ \acro_print_list_long:n {##1}
+ \bool_set_false:N \l__acro_first_upper_bool
+ \bool_if:NT \l__acro_foreign_bool
+ { \acro_get_foreign:n {##1} }
+ \acro_print_list_extra:n {##1}
+ }
+ { \acro_print_list_page:n {##1} }
}
}
}
@@ -1138,8 +1156,9 @@
{
\AssignTemplateKeys
\bool_set_true:N \l__acro_in_list_bool
- \__acro_activate_hyperref_support:
- \cs_set:Npn \acro_print_list_short:nn ##1##2
+ \acro_activate_hyperref_support:
+ \cs_set_eq:NN \acro_print_list_entry:nnn \use:nnn
+ \cs_set_protected:Npn \acro_print_list_short:nn ##1##2
{
\item
[
@@ -1152,7 +1171,7 @@
}
]
}
- \cs_set:Npn \acro_print_list_long:n ##1
+ \cs_set_protected:Npn \acro_print_list_long:n ##1
{
\acro_write_long:Vf \l__acro_list_long_format_tl
{
@@ -1166,20 +1185,105 @@
{
\prop_get:NnNT \l__acro_extra_prop {##1} \l__acro_tmpa_tl
{
- \UseInstance { acro-extra } { \l__acro_extra_instance_tl }
+ \UseInstance {acro-extra} { \l__acro_extra_instance_tl }
{ \l__acro_tmpa_tl }
}
}
- \cs_set:Npn \acro_print_list_page:n ##1
+ \cs_set_protected:Npn \acro_print_list_page:n ##1
{
\bool_if:nT { \cs_if_exist_p:c { acro@##1@once } }
- { \UseInstance { acro-page-number } { \l__acro_page_instance_tl } {##1} }
+ { \UseInstance {acro-page-number} { \l__acro_page_instance_tl } {##1} }
}
\begin {#1}
\acro_list_allow_items:nn {#2} {#3}
\end {#1}
}
+\DeclareTemplateInterface {acro-list} {list-of} {3}
+ {
+ foreign-sep : tokenlist = { ~ } ,
+ style : tokenlist = {toc}
+ }
+
+\DeclareTemplateCode {acro-list} {list-of} {3}
+ {
+ foreign-sep = \l__acro_foreign_sep_tl ,
+ style = \l__acro_list_of_style
+ }
+ {
+ \AssignTemplateKeys
+ \bool_set_true:N \l__acro_in_list_bool
+ \tl_if_eq:VnT \l__acro_page_instance_tl {none}
+ { \tl_set:Nn \l__acro_page_instance_tl {plain} }
+ \tl_set:Nn \l__acro_page_name_tl {}
+ \tl_set:Nn \l__acro_pages_name_tl {}
+ \acro_activate_hyperref_support:
+ \srt_case:NnF \l__acro_list_of_style
+ {
+ {toc}
+ { % similar to the table of contents
+ \cs_set_protected:Npn \acro_print_list_entry:nnn ##1##2##3
+ {
+ \cs_if_exist:NTF \chapter
+ {
+ \contentsline{chapter}{##1}{}{}
+ \contentsline{section}{##2}{##3}{}
+ }
+ {
+ \contentsline{section}{##2}{##3}{}
+ \contentsline{subsection}{##2}{##3}{}
+ }
+ }
+ }
+ {lof}
+ { % similar to the list of figures
+ \cs_set_protected:Npn \l@acro
+ { \@dottedtocline {1} {1.5em} {\l__acro_short_width_dim} }
+ \cs_set_protected:Npn \acro_print_list_entry:nnn ##1##2##3
+ {
+ \contentsline{acro}{\numberline{##1}{##2}}{##3}{}
+ }
+ }
+ }
+ { \ERROR }
+ \cs_set_protected:Npn \acro_print_list_short:nn ##1##2
+ {
+ \acro_hyper_target:nn
+ {##1}
+ {
+ \acro_acc_supp:nn
+ {##1}
+ { \acro_write_short:nn {##1} { \l__acro_list_short_format_tl {##2} } }
+ }
+ }
+ \cs_set_protected:Npn \acro_print_list_long:n ##1
+ {
+ \acro_write_long:Vf \l__acro_list_long_format_tl
+ {
+ \prop_if_in:NnTF \l__acro_list_prop {##1}
+ { \prop_item:Nn \l__acro_list_prop {##1} }
+ { \prop_item:Nn \l__acro_long_prop {##1} }
+ }
+ \acro_cite_if:Nn \l__acro_citation_all_bool {##1}
+ }
+ \cs_set_protected:Npn \acro_print_list_extra:n ##1
+ {
+ \prop_get:NnNT \l__acro_extra_prop {##1} \l__acro_tmpa_tl
+ {
+ \UseInstance {acro-extra} { \l__acro_extra_instance_tl }
+ { \l__acro_tmpa_tl }
+ }
+ }
+ \cs_set_protected:Npn \acro_print_list_page:n ##1
+ {
+ \bool_if:nT { \cs_if_exist_p:c {acro@##1@once} }
+ { \UseInstance {acro-page-number} { \l__acro_page_instance_tl } {##1} }
+ }
+ % \begin {#1}
+ \acro_list_allow_items:nn {#2} {#3}
+ % \end {#1}
+ }
+
% table template:
\DeclareTemplateInterface {acro-list} {table} {3}
{
@@ -1188,7 +1292,7 @@
foreign-sep : tokenlist = { ~ }
}
-\DeclareTemplateCode { acro-list } { table } { 3 }
+\DeclareTemplateCode {acro-list} {table} {3}
{
table = \l__acro_list_table_tl ,
table-spec = \l__acro_list_table_spec_tl ,
@@ -1196,8 +1300,9 @@
}
{
\AssignTemplateKeys
- \__acro_activate_hyperref_support:
- \cs_set:Npn \acro_print_list_short:nn ##1##2
+ \acro_activate_hyperref_support:
+ \cs_set_eq:NN \acro_print_list_entry:nnn \use:nnn
+ \cs_set_protected:Npn \acro_print_list_short:nn ##1##2
{
\acro_hyper_target:nn
{##1}
@@ -1208,7 +1313,7 @@
}
&
}
- \cs_set:Npn \acro_print_list_long:n ##1
+ \cs_set_protected:Npn \acro_print_list_long:n ##1
{
\acro_write_long:Vf \l__acro_list_long_format_tl
{
@@ -1222,42 +1327,42 @@
{
\prop_get:NnNT \l__acro_extra_prop {##1} \l__acro_tmpa_tl
{
- \UseInstance { acro-extra } { \l__acro_extra_instance_tl }
+ \UseInstance {acro-extra} { \l__acro_extra_instance_tl }
{ \l__acro_tmpa_tl }
}
}
- \cs_set:Npn \acro_print_list_page:n ##1
+ \cs_set_protected:Npn \acro_print_list_page:n ##1
{
\bool_if:nT { \cs_if_exist_p:c { acro@##1@once } }
- { \UseInstance { acro-page-number } { \l__acro_page_instance_tl } {##1} }
+ { \UseInstance {acro-page-number} { \l__acro_page_instance_tl } {##1} }
\tabularnewline
}
- % \exp_args:Noo \begin { \l__acro_list_table_tl } { \l__acro_list_table_spec_tl }
- % \acro_list_allow_items:nn {#2} {#3}
- % \exp_args:No \end { \l__acro_list_table_tl }
- \use:x {
- \exp_not:N \begin { \exp_not:V \l__acro_list_table_tl } { \exp_not:V \l__acro_list_table_spec_tl }
- \exp_not:n { \acro_list_allow_items:nn {#2} {#3} }
- \exp_not:N \end { \exp_not:V \l__acro_list_table_tl }
- }
+ \use:x
+ {
+ \exp_not:N \begin { \exp_not:V \l__acro_list_table_tl }
+ { \exp_not:V \l__acro_list_table_spec_tl }
+ \exp_not:n { \acro_list_allow_items:nn {#2} {#3} }
+ \exp_not:N \end { \exp_not:V \l__acro_list_table_tl }
+ }
}
% extra-table template:
-\DeclareTemplateInterface { acro-list } { extra-table } { 3 }
+\DeclareTemplateInterface {acro-list} {extra-table} {3}
{
table : tokenlist = longtable ,
table-spec : tokenlist = lp{\l__acro_table_width_dim}ll
}
-\DeclareTemplateCode { acro-list } { extra-table } { 3 }
+\DeclareTemplateCode {acro-list} {extra-table} {3}
{
table = \l__acro_list_table_tl ,
table-spec = \l__acro_list_table_spec_tl
}
{
\AssignTemplateKeys
- \__acro_activate_hyperref_support:
- \cs_set:Npn \acro_print_list_short:nn ##1##2
+ \acro_activate_hyperref_support:
+ \cs_set_eq:NN \acro_print_list_entry:nnn \use:nnn
+ \cs_set_protected:Npn \acro_print_list_short:nn ##1##2
{
\acro_hyper_target:nn
{##1}
@@ -1268,7 +1373,7 @@
}
&
}
- \cs_set:Npn \acro_print_list_long:n ##1
+ \cs_set_protected:Npn \acro_print_list_long:n ##1
{
\acro_write_long:Vf \l__acro_list_long_format_tl
{
@@ -1283,15 +1388,15 @@
{
\prop_get:NnNT \l__acro_extra_prop {##1} \l__acro_tmpa_tl
{
- \UseInstance { acro-extra } { \l__acro_extra_instance_tl }
+ \UseInstance {acro-extra} { \l__acro_extra_instance_tl }
{ \l__acro_tmpa_tl }
}
&
}
- \cs_set:Npn \acro_print_list_page:n ##1
+ \cs_set_protected:Npn \acro_print_list_page:n ##1
{
\bool_if:nT { \cs_if_exist_p:c { acro@##1@once } }
- { \UseInstance { acro-page-number } { \l__acro_page_instance_tl } {##1} }
+ { \UseInstance {acro-page-number} { \l__acro_page_instance_tl } {##1} }
\tabularnewline
}
\exp_args:Noo
@@ -1302,21 +1407,22 @@
}
% extra-table-rev template:
-\DeclareTemplateInterface { acro-list } { extra-table-rev } { 3 }
+\DeclareTemplateInterface {acro-list} {extra-table-rev} {3}
{
table : tokenlist = longtable ,
table-spec : tokenlist = llp{\l__acro_table_width_dim}l
}
-\DeclareTemplateCode { acro-list } { extra-table-rev } { 3 }
+\DeclareTemplateCode {acro-list} {extra-table-rev} {3}
{
table = \l__acro_list_table_tl ,
table-spec = \l__acro_list_table_spec_tl
}
{
\AssignTemplateKeys
- \__acro_activate_hyperref_support:
- \cs_set:Npn \acro_print_list_short:nn ##1##2
+ \acro_activate_hyperref_support:
+ \cs_set_eq:NN \acro_print_list_entry:nnn \use:nnn
+ \cs_set_protected:Npn \acro_print_list_short:nn ##1##2
{
\acro_hyper_target:nn
{##1}
@@ -1340,15 +1446,15 @@
{
\prop_get:NnNT \l__acro_extra_prop {##1} \l__acro_tmpa_tl
{
- \UseInstance { acro-extra } { \l__acro_extra_instance_tl }
+ \UseInstance {acro-extra} { \l__acro_extra_instance_tl }
{ \l__acro_tmpa_tl }
}
&
}
- \cs_set:Npn \acro_print_list_page:n ##1
+ \cs_set_protected:Npn \acro_print_list_page:n ##1
{
\bool_if:nT { \cs_if_exist_p:c { acro@##1@once } }
- { \UseInstance { acro-page-number } { \l__acro_page_instance_tl } {##1} }
+ { \UseInstance {acro-page-number} { \l__acro_page_instance_tl } {##1} }
\tabularnewline
}
\exp_args:Noo \begin { \l__acro_list_table_tl } { \l__acro_list_table_spec_tl }
@@ -1360,22 +1466,28 @@
\DeclareInstance {acro-list} {list}
{ list }
{ }
-\DeclareInstance { acro-list } { tabular }
+\DeclareInstance {acro-list} {toc}
+ { list-of }
+ { }
+\DeclareInstance {acro-list} {lof}
+ { list-of }
+ { style = lof }
+\DeclareInstance {acro-list} {tabular}
{ table }
{ table = tabular }
-\DeclareInstance { acro-list } { longtable }
+\DeclareInstance {acro-list} {longtable}
{ table }
{ table = longtable }
-\DeclareInstance { acro-list } { extra-longtable }
+\DeclareInstance {acro-list} {extra-longtable}
{ extra-table }
{ table = longtable }
-\DeclareInstance { acro-list } { extra-tabular }
+\DeclareInstance {acro-list} {extra-tabular}
{ extra-table }
{ table = tabular }
-\DeclareInstance { acro-list } { extra-longtable-rev }
+\DeclareInstance {acro-list} {extra-longtable-rev}
{ extra-table-rev }
{ table = longtable }
-\DeclareInstance { acro-list } { extra-tabular-rev }
+\DeclareInstance {acro-list} {extra-tabular-rev}
{ extra-table-rev }
{ table = tabular }
@@ -1455,7 +1567,7 @@
\cs_new_protected:Npn \acro_get:n #1
{
\bool_if:NF \l__acro_in_list_bool { \leavevmode }
- \__acro_activate_hyperref_support:
+ \acro_activate_hyperref_support:
% short:
\prop_get:NnNF \l__acro_short_prop {#1} \l__acro_tmpa_tl {}
\__acro_make_link:NnV \l__acro_short_tl {#1} \l__acro_tmpa_tl
@@ -1881,13 +1993,20 @@
% --------------------------------------------------------------------------
% #1: id
% #2: short|alt
-\cs_new_protected:Npn \acro_write_compact:nn #1#2
+\cs_set_protected:Npn \acro_write_compact:nn #1#2
{
\acro_get_ending_form:nn {#1} {#2}
\acro_acc_supp:nn
{#1}
- { \use:c {acro_write_#2:nv} {#1} {l__acro_#2_tl} }
- \acro_endings:nn {#1} {#2}
+ {
+ \acro_write_tooltip:nnV
+ {#1}
+ {
+ \use:c {acro_write_#2:nv} {#1} {l__acro_#2_tl}
+ \acro_endings:nn {#1} {#2}
+ }
+ \l__acro_long_tl
+ }
}
% #1: ID
@@ -1989,10 +2108,14 @@
\acro_is_used:n {#1}
\acro_if_is_single:nT {#1}
{ \cs_set_eq:NN \acro_hyper_link:nn \use_ii:nn }
- \UseInstance {acro-first} { \l__acro_first_instance_tl }
- {#1}
- { \l__acro_short_tl }
- { \l__acro_long_tl }
+ \use:x
+ {
+ \UseInstance {acro-first}
+ { \exp_not:V \l__acro_first_instance_tl }
+ { \exp_not:n {#1} }
+ { \exp_not:V \l__acro_short_tl }
+ { \exp_not:V \l__acro_long_tl }
+ }
}
% output like the first time with own long version:
@@ -2133,20 +2256,53 @@
}
\cs_generate_variant:Nn \acro_do_acc_supp:nnn { VV }
-% macro to redefine to adapt definition of \acro_acc_supp:nn, for cases like
-% http://tex.stackexchange.com/a/161521/
-\cs_new_protected:Npn \acro_set_accsupp:
- { \cs_set_eq:NN \acro_acc_supp:nn \acro_get_acc_supp:nn }
-
-\AtBeginDocument
+\AtEndPreamble
{
\bool_if:NT \l__acro_acc_supp_bool
{
\RequirePackage {accsupp}
- \acro_set_accsupp:
+ \cs_set_eq:NN \acro_acc_supp:nn \acro_get_acc_supp:nn
+ }
+ \bool_if:NT \l__acro_tooltip_bool
+ {
+ \RequirePackage {pdfcomment}
+ \cs_if_eq:NNT \__acro_tooltip_cmd:nn \use_i:nn
+ { \cs_set:Npn \__acro_tooltip_cmd:nn { \pdftooltip } }
+ }
+ }
+
+% --------------------------------------------------------------------------
+% tooltips for acronyms
+
+% #1: id
+% #2: printed text
+% #3: tool tip text
+\cs_new_protected:Npn \acro_write_tooltip:nnn #1#2#3
+ {
+ \prop_get:NnNTF \l__acro_tooltip_prop {#1} \l__acro_tmpa_tl
+ { \__acro_check_tooltip:nV {#2} \l__acro_tmpa_tl }
+ { \__acro_check_tooltip:nn {#2} {#3} }
+ }
+\cs_generate_variant:Nn \acro_write_tooltip:nnn { nnV }
+
+% #1: printed text
+% #2: tool tip text
+\cs_new_protected:Npn \__acro_check_tooltip:nn #1#2
+ {
+ \bool_if:NTF \l__acro_inside_tooltip_bool
+ {#1}
+ {
+ \bool_set_true:N \l__acro_inside_tooltip_bool
+ \__acro_tooltip_cmd:nn {#1} {#2}
}
}
+\cs_generate_variant:Nn \__acro_check_tooltip:nn { nV }
+% use whatever command you like for creating tooltips here:
+% #1: printed text
+% #2: tool tip text
+\cs_new_eq:NN \__acro_tooltip_cmd:nn \use_i:nn
+
% --------------------------------------------------------------------------
% indefinite articles:
@@ -2218,11 +2374,15 @@
}
\seq_sort:Nn \l__acro_tmpa_seq
{
- \tl_to_lowercase:n {
- \int_compare:nTF { \acro_strcmp:nn {##1} { ##2 } = -1 }
- { \sort_ordered: }
- { \sort_reversed: }
- }
+ \int_compare:nTF
+ {
+ \acro_strcmp:nn
+ { \str_fold_case:n {##1} }
+ { \str_fold_case:n {##2} }
+ = \c_minus_one
+ }
+ { \sort_ordered: }
+ { \sort_reversed: }
}
\seq_map_inline:Nn \l__acro_tmpa_seq
{
@@ -3051,6 +3211,9 @@
% acc supp:
\acro_declare_key:nn {acc_supp} {accsupp}
+% tooltip:
+\acro_declare_simple_key:n {tooltip}
+
% citation:
\prop_new:N \l__acro_citation_prop
\prop_new:N \l__acro_citation_pre_prop
@@ -3163,7 +3326,7 @@
\cs_new_protected:Npn \acro_use_list_instance:nn #1#2
{
- \UseInstance { acro-list } { \l__acro_list_instance_tl }
+ \UseInstance {acro-list} { \l__acro_list_instance_tl }
{ \l__acro_list_type_tl } {#1} {#2}
}
\cs_generate_variant:Nn \acro_use_list_instance:nn { VV }
@@ -3388,6 +3551,11 @@
2015/08/29 v2.0b - fix https://bitbucket.org/cgnieder/acro/issue/44
- fix https://bitbucket.org/cgnieder/acro/issue/45
- implement https://bitbucket.org/cgnieder/acro/issue/42
+2015/09/05 v2.1 - add list object type `list-of' that prints the list like a
+ toc or lof, new option `list-short-width',
+ - correct bug in the `plain' extra style
+ - implemented `tooltip' property
+ - remove \tl_to_lowercase:n
% --------------------------------------------------------------------------
update => http://tex.stackexchange.com/questions/236362