Skip to content

Commit

Permalink
v3.0alpha-1
Browse files Browse the repository at this point in the history
  • Loading branch information
cgnieder committed Apr 7, 2020
1 parent 40b94cc commit 4d4e681
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 20 deletions.
3 changes: 2 additions & 1 deletion code/acro.acronyms.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
\AcroDeclarePropertyAlias {sort} {short}
\AcroDeclareProperty {index}
\AcroDeclarePropertyAlias {index-sort} {sort}
\AcroDeclareProperty {single}
\AcroDeclarePropertyAlias {single} {long}
\AcroDeclarePropertyAlias {pdfstring} {short}
\AcroDeclareProperty {pdfcomment}

Expand All @@ -141,6 +141,7 @@
\AcroDeclareProperty {extra}
\AcroDeclareProperty {post}
\AcroDeclareProperty {first-style}
\AcroDeclareProperty {single-style}
\AcroDeclareProperty {class}
\AcroDeclareProperty {cite}

Expand Down
15 changes: 13 additions & 2 deletions code/acro.sty
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
\ProvidesPackage{acro}[2020/04/06 v3.0alpha Typeset Acronyms]
\ProvidesPackage{acro}[2020/04/07 v3.0alpha-1 Typeset Acronyms]

\newif\ifnewacro
\newif\ifacrodeprecation

\DeclareOption{version=2}{\newacrofalse}
\DeclareOption{version=3}{\newacrotrue}
\DeclareOption{deprecation}{\acrodeprecationtrue}
\DeclareOption*{%
\PassOptionsToPackage{\CurrentOption}{acro2}%
\PassOptionsToPackage{\CurrentOption}{acro3}%
Expand All @@ -44,8 +46,17 @@
\ProcessOptions

\RequirePackage{acro\ifnewacro3\else2\fi}

\ifnewacro
\csname acro_module_load:n\endcsname{upgrade}
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
\ifacrodeprecation\iffalse
\expandafter\@firstofone
\else
\expandafter\@gobble
\fi
{\csname acro_module_load:n\endcsname{upgrade}}

\endinput
19 changes: 15 additions & 4 deletions code/acro.templates.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,25 @@
{first} {
\bool_if:NT \l__acro_tmpa_bool
{ \bool_set_true:N \l__acro_use_bool }
\__acro_template_use:nnx {#1} {#2}
{ \acro_property_get:Vn \l_acro_id_tl {first-style} }
\acro_if_single:VTF \l_acro_id_tl
{
\acro_property_if_set:VnTF \l_acro_id_tl {single-style}
{
\__acro_template_use:nnx {#1} {#2}
{ \acro_property_get:Vn \l_acro_id_tl {single-style} }
}
{ \__acro_template_use:nnV {#1} {#2} \l__acro_single_tl }
}
{
\__acro_template_use:nnx {#1} {#2}
{ \acro_property_get:Vn \l_acro_id_tl {first-style} }
}
}
{single} {
\acro_property_if_set:VnTF \l_acro_id_tl {single}
\acro_property_if_set:VnTF \l_acro_id_tl {single-style}
{
\__acro_template_use:nnx {#1} {#2}
{ \acro_property_get:Vn \l_acro_id_tl {single} }
{ \acro_property_get:Vn \l_acro_id_tl {single-style} }
}
{ \__acro_template_use:nnV {#1} {#2} \l__acro_single_tl }
}
Expand Down
8 changes: 4 additions & 4 deletions code/acro.tools.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
{ \prg_return_false: }
{ \prg_return_true: }
}
\prg_generate_conditional_variant:Nnn \acro_if_single:n {e} {TF}
\prg_generate_conditional_variant:Nnn \acro_if_single:n {e,V} {TF}

\bool_new:N \l__acro_use_only_first_bool
\tl_new:N \l__acro_single_tl
Expand Down Expand Up @@ -155,9 +155,9 @@
{
\tl_use:c
{
\tl_if_exist:cTF {l__acro_format_ #2 _tl}
{l__acro_format_ #2 _tl}
{l__acro_format_ \acro_if_short:nTF {#2} {short} {long} _tl}
\tl_if_exist:cTF {l__acro_format_ #1 _tl}
{l__acro_format_ #1 _tl}
{l__acro_format_ \acro_if_short:nTF {#1} {short} {long} _tl}
}
}

Expand Down
4 changes: 2 additions & 2 deletions doc/acro-manual.cls
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
\acsetup{
single = true ,
index / use = true ,
hyperref = true ,
make-links = true ,
list / template = manual ,
list / heading = section ,
list / display = all ,
Expand Down Expand Up @@ -172,7 +172,7 @@
\tcbset{enhanced,enhanced jigsaw}

\newtcolorbox{bewareofthedog}{
colback = white ,
colback = red!2!white!98 ,
colframe = red ,
underlay={%
\path[draw=none]
Expand Down
Binary file modified doc/acro-manual.pdf
Binary file not shown.
21 changes: 14 additions & 7 deletions doc/acro-manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
% feel free to contact me.
% --------------------------------------------------------------------------
\PassOptionsToPackage{ngerman,english}{babel}
\PassOptionsToPackage{version=3,deprecation}{acro}
\documentclass{acro-manual}

% \usepackage[]{babel}
Expand Down Expand Up @@ -67,11 +68,6 @@
}
\end{filecontents}

% \ExplSyntaxOn
% \tl_put_right:Nn \l_text_letterlike_tl {\LaTeX}
% \tl_show:N \l_text_letterlike_tl
% \ExplSyntaxOff

% declare acronyms
\DeclareAcronym{cd}{
short = CD ,
Expand All @@ -82,7 +78,9 @@
long = Comprehensive \TeX\ Archive Network ,
format = \scshape ,
pdfstring = CTAN ,
short-acc = CTAN
short-acc = CTAN ,
first-style = short-long ,
single-style = short
}
\DeclareAcronym{ecu}{
short = ECU ,
Expand Down Expand Up @@ -169,6 +167,15 @@

\begin{document}

\begin{bewareofthedog}
Hi and thanks that you are testing v3.0 of \acro\ before it is released to
\ac{ctan}. If you want to test the new version use
\cs*{usepackage}\Oarg{version=3}\Marg{acro}. With \code{version=2} or no
option at all you get the old version of acro. Using
\cs*{usepackage}\Oarg{version=3,deprecation}\Marg{acro} is supposed to give
as much meaningful warnings and errors as possible.
\end{bewareofthedog}

\part{Get started with \acro}

\section{Licence and requirements}
Expand Down Expand Up @@ -223,10 +230,10 @@ \section{\acro\ for the impatient}

\part{Comprehensive details}

\clearpage
\appendix
\part{Appendix}

\tracingmacros=1
\printacronyms[
preamble = {Below all abbreviations are listed which have been defined for
the manual.} ,
Expand Down

0 comments on commit 4d4e681

Please sign in to comment.