Skip to content

Commit

Permalink
v3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cgnieder committed May 3, 2020
1 parent 95b4aee commit a842937
Show file tree
Hide file tree
Showing 25 changed files with 564 additions and 372 deletions.
28 changes: 15 additions & 13 deletions HISTORY
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,23 @@ the ACRO package

--------------------------------------------------------------------------
Clemens Niederberger
Web: https://github.com/cgnieder/acro/
Web: https://github.com/cgnieder/acro
E-Mail: contact@mychemistry.eu
--------------------------------------------------------------------------
Copyright 2011--2020 Clemens Niederberger
Copyright 2012--2020 Clemens Niederberger

This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of LaTeX
version 2005/12/01 or later.
and version 1.3c or later is part of all distributions of LaTeX
version 2008/05/04 or later.

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, acro.definitions.tex, acro.cfg
- acro-manual.tex, acro-manual.pdf, acro-manual.cls
- acro.history, README
--------------------------------------------------------------------------
If you have any ideas, questions, suggestions or bugs to report, please
feel free to contact me.
--------------------------------------------------------------------------
2012 VERSION 0
--------------------------------------------------------------------------
2012/06/22 v0.1 - first public release
Expand Down Expand Up @@ -297,3 +289,13 @@ feel free to contact me.
--------------------------------------------------------------------------
2020/04/29 v3.0 - complete re-write of acro with new features and all open
issues resolved
2020/05/03 v3.1 - unify licence statements
- fix bug in combination with ``usage''
- repair pdfcomment feature (when did that get lost?)
- improve formatting mechanism
- add `patch' module: patches floats, common content lists,
and tables in their measuring phase
- add option `foreign/display'
- \acroifboolean(TF)
- add missing code in some of the list templates
- improve examples code
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
the ACRO package v3.0 2020/04/29
the ACRO package v3.1 2020/05/03

Typeset Acronyms

Expand Down
36 changes: 18 additions & 18 deletions acro.build
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ if [ "$build" == true ] ; then
$pkgname.pages.$moduleext \
$pkgname.locale.$moduleext \
$pkgname.pdfsupport.$moduleext \
$pkgname.patch.$moduleext \
$pkgname.definitions.$moduleext \
$pkgname.upgrade.$moduleext \
> $styname
Expand Down Expand Up @@ -323,25 +324,24 @@ fi

if [ "$createzip" == true ] ; then
if [ -f "${SNAPSHOT_DIR}/$pkgname/$zipname.zip" ] ; then
echo "$zipname.zip already exists"
else
if [ "$verbose" == true ] ; then
echo "creating zip archive $zipname.zip ..."
fi
cd ${ACRO_DEV_DIR}
mkdir $pkgname/
mkdir $pkgname/examples
cp ${CODE_DIR}/$styname $pkgname/
cp ${CODE_DIR}/$pkgname2.sty $pkgname/
cp ${DOC_DIR}/$manualfile.tex $pkgname/
cp ${DOC_DIR}/$manualfile.pdf $pkgname/
cp ${DOC_DIR}/examples/$pkgname.example.*.tex $pkgname/examples/
cp ${DOC_DIR}/examples/$pkgname.example.*.pdf $pkgname/examples/
cp README $pkgname/
zip -r $zipname.zip $pkgname/
rm -r $pkgname/
mv $zipname.zip ${SNAPSHOT_DIR}/$pkgname
rm ${SNAPSHOT_DIR}/$pkgname/$zipname.zip
fi
if [ "$verbose" == true ] ; then
echo "creating zip archive $zipname.zip ..."
fi
cd ${ACRO_DEV_DIR}
mkdir $pkgname/
mkdir $pkgname/examples
cp ${CODE_DIR}/$styname $pkgname/
cp ${CODE_DIR}/${pkgname}2.sty $pkgname/
cp ${DOC_DIR}/$manualfile.tex $pkgname/
cp ${DOC_DIR}/$manualfile.pdf $pkgname/
cp ${DOC_DIR}/examples/$pkgname.example.*.tex $pkgname/examples/
cp ${DOC_DIR}/examples/$pkgname.example.*.pdf $pkgname/examples/
cp README $pkgname/
zip -r $zipname.zip $pkgname/
rm -r $pkgname/
mv $zipname.zip ${SNAPSHOT_DIR}/$pkgname
fi

cd ${START_DIR}
Expand Down
27 changes: 0 additions & 27 deletions code/acro.acronyms.code.tex
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
% ----------------------------------------------------------------------------
% the ACRO package - acronyms module
%
% Typeset Acronyms
%
% --------------------------------------------------------------------------
% Clemens Niederberger
% Web: https://github.com/cgnieder/acro/
% E-Mail: contact@mychemistry.eu
% --------------------------------------------------------------------------
% Copyright 2011--2020 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
\AcroModule{acronyms}{define acronyms}

% --------------------------------------------------------------------------
Expand Down
16 changes: 14 additions & 2 deletions code/acro.commands.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
\acro_property_if_exist:nTF {#2-acc}
{
\__acro_accsupp:ee
{ \__acro_write_acronym:nn {#1} {#2-acc} }
{ \__acro_write_acronym_acc:nn {#1} {#2-acc} }
{ \__acro_write_acronym:nn {#1} {#2} }
}
{ \__acro_write_acronym:nn {#1} {#2} }
Expand All @@ -169,6 +169,19 @@
}
}

% #1: id
% #2: property
\cs_new:Npn \__acro_write_acronym_acc:nn #1#2
{
\__acro_upper:n
{
\__acro_article:nn {#1} {#2}
\acro_if_ending_form:nnTF {#1} {#2}
{ \acro_ending_form:nn {#1} {#2} }
{ \acro_property_get:nn {#1} {#2} }
}
}

% #1: id
% #2: property
\cs_new_protected:Npn \acro_write:nn #1#2
Expand Down Expand Up @@ -274,7 +287,6 @@
\l__acro_begin_command_hook_tl
\cs_set:Npn \nospace { \exp:w \exp_end_continue_f:w }
\acro_check_definition:n {####1}
\bool_set_true:N \l__acro_use_bool
\keys_set:nV {acro} \l__acro_options_tl
\tl_set:Ne \AcronymID { \acro_case_insensitive:n {####1} }
\tl_set:Ne \l_acro_id_tl { \acro_case_insensitive:n {####1} }
Expand Down
68 changes: 27 additions & 41 deletions code/acro.definitions.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,12 @@
\begin {description}
\acronymsmapF
{
\item [ \acrowrite {short} \acroifT {alt} { / \acrowrite {alt} } ]
\item [ \acrowrite {short} \acroifT {alt} { / } \acrowrite {alt} ]
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
\acroifT {foreign}
{
\acrowrite {foreign}
\acroifT {extra} {,~}
}
\acroifT {extra}
{ \acrowrite {extra} }
\acrowrite {foreign}
\acroifallT {foreign,extra} {,~}
\acrowrite {extra}
\acroifanyT {foreign,extra} {)}
\acropagefill
\acropages
Expand All @@ -217,17 +213,13 @@
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} { / \acrowrite {alt} }
\acroifT {alt} { / } \acrowrite {alt}
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
\acroifT {foreign}
{
\acrowrite {foreign}
\acroifT {extra} {,~}
}
\acroifT {extra}
{ \acrowrite {extra} }
\acrowrite {foreign}
\acroifallT {foreign,extra} {,~}
\acrowrite {extra}
\acroifanyT {foreign,extra} {)}
\acropagefill
\acropages
Expand All @@ -254,17 +246,13 @@
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} { / \acrowrite {alt} }
\acroifT {alt} { / } \acrowrite {alt}
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
\acroifT {foreign}
{
\acrowrite {foreign}
\acroifT {extra} {,~}
}
\acroifT {extra}
{ \acrowrite {extra} }
\acrowrite {foreign}
\acroifallT {foreign,extra} {,~}
\acrowrite {extra}
\acroifanyT {foreign,extra} {)}
\acropagefill
\acropages
Expand Down Expand Up @@ -292,17 +280,13 @@
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} { / \acrowrite {alt} }
\acroifT {alt} { / } \acrowrite {alt}
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
\acroifT {foreign}
{
\acrowrite {foreign}
\acroifT {extra} {,~}
}
\acroifT {extra}
{ \acrowrite {extra} }
\acrowrite {foreign}
\acroifallT {foreign,extra} {,~}
\acrowrite {extra}
\acroifanyT {foreign,extra} {)}
\acropagefill
\acropages
Expand Down Expand Up @@ -331,12 +315,13 @@
\contentsline {acro}
{
\numberline
{ \acrowrite {short} \acroifT {alt} { / \acrowrite {alt} } }
{ \acrowrite {short} \acroifT {alt} { / } \acrowrite {alt} }
{
\acrowrite {list}
\acroifT {foreign}
{ \acrowrite {foreign} \acroifT {extra} {,~} }
\acroifT {extra} { \acrowrite {extra} }
\acroifanyT {foreign,extra} {~(}
\acrowrite {foreign}
\acroifallT {foreign,extra} {,~}
\acrowrite {extra}
\acroifanyT {foreign,extra} {)}
}
}
Expand All @@ -354,15 +339,16 @@
\acronymsmapF
{
\contentsline { \acroifchapterTF {chapter} {section} }
{ \acrowrite {short} \acroifT {alt} { / \acrowrite {alt} } }
{ \acrowrite {short} \acroifT {alt} { / } \acrowrite {alt} }
{}{}
\contentsline { \acroifchapterF {sub} section }
{
\acrowrite {list}
\acroifT {foreign}
{ \acrowrite {foreign} \acroifT {extra} {,~} }
\acroifT {extra} { \acrowrite {extra} }
\acroifanyT {foreign,extra} {) }
\acroifanyT {foreign,extra} {~(}
\acrowrite {foreign}
\acroifallT {foreign,extra} {,~}
\acrowrite {extra}
\acroifanyT {foreign,extra} {)}
}
{ \acropages {} {} }
{}
Expand Down
50 changes: 41 additions & 9 deletions code/acro.formatting.code.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\AcroModule{formatting}{formatting of acronyms}
% --------------------------------------------------------------------------
% formatting:

\bool_new:N \l__acro_format_replace_bool

% sets the format from the global option:
Expand All @@ -19,8 +18,26 @@
% #1: property
\cs_new:Npn \__acro_use_global_format:n #1
{
\tl_if_exist:cT {l__acro_format_ #1 _tl}
{ \tl_use:c {l__acro_format_ #1 _tl} }
\tl_if_exist:cTF {l__acro_format_ #1 _tl}
{
\tl_if_empty:cTF {l__acro_format_ #1 _tl}
{ \use:n }
{ \tl_use:c {l__acro_format_ #1 _tl} }
}
{
\acro_property_if_alias:nTF {#1}
{
\tl_if_exist:cTF
{l__acro_format_ \acro_property_alias:n {#1} _tl}
{
\tl_if_empty:cTF {l__acro_format_ \acro_property_alias:n {#1} _tl}
{ \use:n }
{ \tl_use:c {l__acro_format_ \acro_property_alias:n {#1} _tl} }
}
{ \use:n }
}
{ \use:n }
}
}

% #1: id
Expand Down Expand Up @@ -57,7 +74,7 @@
% #1: id
% #1: property
\cs_new:Npn \__acro_property_format:nn #1#2
{ \__acro_property_format:nnF {#1} {#2} {} }
{ \__acro_property_format:nnF {#1} {#2} { \use:n } }

% sets the individual format:
% #1: id
Expand All @@ -70,27 +87,42 @@
{
\__acro_property_format:nnF {#1} {#2}
{ \__acro_global_format:n {#2} }
{#3}
{ \__acro_pdf_comment:nnn {#1} {#2} {#3} }
}
{
\__acro_global_format:n {#2}
{
\__acro_property_format:nn {#1} {#2}
{#3}
{ \__acro_pdf_comment:nnn {#1} {#2} {#3} }
}
}
}
}
\cs_generate_variant:Nn \acro_format:nnn {e}

\cs_new:Npn \acro_index_format:nnn #1#2#3
{
{
\bool_if:NTF \l__acro_format_replace_bool
{
\__acro_property_format:nnF {#1} {#2}
{ \__acro_global_format:n {#2} }
{#3}
}
{
\__acro_global_format:n {#2}
{ \__acro_property_format:nn {#1} {#2} {#3} }
}
}
}

% #1: property:
\cs_new_protected:Npn \acro_new_format:n #1
{
\tl_new:c {l__acro_format_#1_tl}
\keys_define:nn {acro/format}
{
#1 .tl_set:c = l__acro_format_#1_tl ,
#1 .initial:n =
#1 .tl_set:c = l__acro_format_#1_tl
}
}

Expand Down

0 comments on commit a842937

Please sign in to comment.