I do not know how to search for this issue as backwards slash or \ in questions has not gleaned anything useful. How can I set a key-value and then use a font size value without having to use a command in the package options please, e.g.
\usepackage[superscript-fontsize=large]{aminosymb}
instead of
\usepackage[superscript-fontsize=\large]{aminosymb}
I would prefer for the package I am writing to not have to put the backwards slash in the package options although this is always a backup. For instance, my MWE produces this:
using this command:
\NewDocumentCommand { \aasp } { m m }
{
\residueString:nn { #1 } { \l_aminosymb_residue_style_tl }
\textsuperscript{$\l_superscript_font_size_tl\mkern-1mu#2\mkern-1.5mu$}
}
I do not know if there is a LaTeX3 command to convert tokens into a command, does anyone know how this can be done please? MWE:
\begin{filecontents}[overwrite]{aminosymb.sty}
\RequirePackage{l3keys2e}
\ProvidesExplPackage
{aminosymb}
{today}
{version}
{Typesetting amino acid residues with notation and numbers}
\ExplSyntaxOn
\tl_new:N \l_aminosymb_residue_style_tl
\tl_new:N \l_superscript_font_size_tl
\keys_define:nn { AminoSymb / Package }
{
style .tl_set:N = \l_aminosymb_residue_style_tl,
style .initial:n = abbrev-firstcap,
superscript-fontsize .tl_set:N = \l_superscript_font_size_tl,
superscript-fontsize .initial:n = scriptstyle,
}
\ProcessKeysOptions { AminoSymb / Package }
\prop_new:N \l_abbrev_ala_prop
\prop_new:N \l_abbrev_all_prop
\prop_set_from_keyval:Nn \l_abbrev_ala_prop
{
initial-lower=a,
abbrev-firstcap = Ala,
}
\prop_set_from_keyval:Nn \l_abbrev_all_prop
{
ala = \l_abbrev_ala_prop,
}
\cs_new:Npn \residueString:nn #1#2
{
\tl_set:Nx\l_residue{#1}
\tl_set:Nx\l_style{#2}
\prop_map_function:NN \l_abbrev_all_prop __abbrev_aux:nn
}
\cs_generate_variant:Nn\prop_item:Nn{Ne}
\cs_new:Npn __abbrev_aux:nn #1#2
{
\prop_map_inline:Nn #2
{
\tl_if_eq:NnT
\l_residue
{##2}
{\prop_item:Ne#2{\l_style}}
}
}
\NewDocumentCommand { \aasp } { m m }
{
\residueString:nn { #1 } { \l_aminosymb_residue_style_tl }
\textsuperscript{$\l_superscript_font_size_tl\mkern-1mu#2\mkern-1.5mu$}
}
\ExplSyntaxOff
\end{filecontents}
\documentclass{article}
\usepackage[superscript-fontsize=large]{aminosymb}
\begin{document}
\aasp{a}{323}
\end{document}
Apologies if this is a duplicate, I do not know how to search for this issue due to the nature of the \ command.

setup-macro that can be used after the package is loaded. – Skillmon Oct 11 '23 at 05:41expl3. See my edited answer for a version that fixes it. All your functions should contain the module name, same is true for all your variables. – Skillmon Oct 11 '23 at 05:54\<scope>_<module>_<description>_<type>or if it's private\<scope>__<module>_<description>_<type>. And a function should always be called\<module>_<description>:<args>or if it's private\__<module>_<description>:<args>. – Skillmon Oct 11 '23 at 05:56