Skip to content

Commit

Permalink
nearly v6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cgnieder committed Jan 16, 2022
1 parent bb8c993 commit 7a2477d
Show file tree
Hide file tree
Showing 10 changed files with 310 additions and 228 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
the CHEMMACROS package v6.0 2022/??/??
the CHEMMACROS package v6.0 2022/01/16

comprehensive support for typesetting chemistry documents

Expand Down
5 changes: 1 addition & 4 deletions code/chemmacros.base.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
\cs_new_protected:Npn \chemmacros_define_deprecated:NN #1#2
{
\cs_set_protected:Npn #1
{
\msg_warning:nnnn {chemmacros} {command-deprecated} {#1} {#2}
#2
}
{ \msg_warning:nnnn {chemmacros} {command-deprecated} {#1} {#2} #2 }
}

\NewDocumentCommand \DeclareChemDeprecated {mm}
Expand Down
1 change: 1 addition & 0 deletions code/chemmacros.reactants.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
\bool_set_false:N \l__chemmacros_reactants_acronym_support_bool
\str_clear:N \l__chemmacros_reactants_acronym_support_str ,
acronym-support .initial:n = none ,
%%
printreactants-style .choice: ,
printreactants-style / xltabular .code:n =
\bool_set_true:N \l__chemmacros_reactants_printreactants_style_bool
Expand Down
8 changes: 5 additions & 3 deletions code/chemmacros.start.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,24 @@
\clist_set:Nn \l_chemmacros_modules_clist
{
base, errorcheck, lang, greek, chemformula, charges, acid-base, symbols,
particles, phases, nomenclature, tikz, xfrac
particles, phases, nomenclature, tikz, xfrac, translations
}

\clist_const:Nn \c_chemmacros_all_modules_clist
{
base, errorcheck, lang, greek, chemformula, charges, acid-base, symbols,
particles, phases, nomenclature, tikz, isotopes, mechanisms, newman,
orbital, polymers, reactions, redox, xfrac, scheme, spectroscopy,
thermodynamics, units, reactants
thermodynamics, units, reactants, translations
}

\keys_define:nn {chemmacros/package-options}
{
minimal .bool_set:N = \l__chemmacros_minimal_bool ,
minimal .initial:n = false ,
modules .code:n = \clist_put_right:Nn \l_chemmacros_modules_clist {#1} ,
modules .code:n =
\clist_if_in:NF \l_chemmacros_modules_clist
{ \clist_put_right:Nn \l_chemmacros_modules_clist {#1} } ,
unknown .code:n = \__chemmacros_loadtime_warning:n {unknown-option}
}

Expand Down
13 changes: 6 additions & 7 deletions code/chemmacros.sty
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,24 @@
\clist_set:Nn \l_chemmacros_modules_clist
{
base, errorcheck, lang, greek, chemformula, charges, acid-base, symbols,
particles, phases, nomenclature, tikz, xfrac
particles, phases, nomenclature, tikz, xfrac, translations
}

\clist_const:Nn \c_chemmacros_all_modules_clist
{
base, errorcheck, lang, greek, chemformula, charges, acid-base, symbols,
particles, phases, nomenclature, tikz, isotopes, mechanisms, newman,
orbital, polymers, reactions, redox, xfrac, scheme, spectroscopy,
thermodynamics, units, reactants
thermodynamics, units, reactants, translations
}

\keys_define:nn {chemmacros/package-options}
{
minimal .bool_set:N = \l__chemmacros_minimal_bool ,
minimal .initial:n = false ,
modules .code:n = \clist_put_right:Nn \l_chemmacros_modules_clist {#1} ,
modules .code:n =
\clist_if_in:NF \l_chemmacros_modules_clist
{ \clist_put_right:Nn \l_chemmacros_modules_clist {#1} } ,
unknown .code:n = \__chemmacros_loadtime_warning:n {unknown-option}
}

Expand Down Expand Up @@ -400,10 +402,7 @@
\cs_new_protected:Npn \chemmacros_define_deprecated:NN #1#2
{
\cs_set_protected:Npn #1
{
\msg_warning:nnnn {chemmacros} {command-deprecated} {#1} {#2}
#2
}
{ \msg_warning:nnnn {chemmacros} {command-deprecated} {#1} {#2} #2 }
}

\NewDocumentCommand \DeclareChemDeprecated {mm}
Expand Down
Binary file added doc/chemmacros-logo.pdf
Binary file not shown.
50 changes: 50 additions & 0 deletions doc/chemmacros-logo.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
% arara: xelatex
% arara: xelatex
\documentclass[margin=1cm]{standalone}
\usepackage{fontspec}
\usepackage{chemmacros}
\usetikzlibrary{calc,positioning,decorations.pathmorphing,patterns}

% credits:
% https://tex.stackexchange.com/a/49961/
\pgfdeclaredecoration{pencilline}{initial}{
\state{initial}[
width=+\pgfdecoratedinputsegmentremainingdistance,
auto corner on length=1mm
]{
\pgfpathcurveto%
{% From
\pgfqpoint
{\pgfdecoratedinputsegmentremainingdistance}
{\pgfdecorationsegmentamplitude}
}
{% Control 1
\pgfmathrand
\pgfpointadd
{\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
{%
\pgfqpoint
{-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}%
{\pgfmathresult\pgfdecorationsegmentamplitude}
}
}
{%TO
\pgfpointadd
{\pgfpointdecoratedinputsegmentlast}
{\pgfpoint{1pt}{1pt}}
}
}
\state{final}{}
}
\tikzset{pencil/.style={decorate,decoration=pencilline}}
\begin{document}
\ch[font-spec={Augie}]{
2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2
->
2 "\OX{o2,\ox{+1,Na}}" {}+ + 2 "\OX{r2,\ox{-1,Cl}}" {}-
}
\redox(o1,o2)[red,pencil,-cf]{%
\small\ch[font-spec={[Color=red]Augie},math-space=.3em]{$-$ 2 e-}}
\redox(r1,r2)[blue,pencil,-cf][-1]{%
\small\ch[font-spec={[Color=blue]Augie},math-space=.3em]{$+$ 2 e-}}
\end{document}
69 changes: 67 additions & 2 deletions doc/chemmacros-manual.cls
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
%
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
\ProvidesClass{chemmacros-manual}[2022/01/13]
\ProvidesClass{chemmacros-manual}[2022/01/16]

\LoadClass[load-preamble,add-index]{cnltx-doc}
\RequirePackage{imakeidx}
Expand Down Expand Up @@ -158,7 +158,6 @@
}%
}

\RequirePackage{chemformula}
\DeclareInstance{xfrac}{chemformula-text-frac}{text}{
scale-factor = 1 ,
denominator-bot-sep = -.2ex ,
Expand Down Expand Up @@ -425,6 +424,72 @@
}
\ExplSyntaxOff

\DeclareAcronym{ghs}{
short = ghs ,
long = Globally Harmonized System of Classification and Labelling of
Chemicals ,
pdfstring = GHS ,
short-acc = GHS
}
\DeclareAcronym{eu}{
short = eu ,
long = European Union ,
pdfstring = EU ,
short-acc = EU
}
\DeclareAcronym{iupac}{
short = iupac ,
long = International Union of Pure and Applied Chemistry ,
pdfstring = IUPAC ,
short-acc = IUPAC
}
\DeclareAcronym{UN}{
short = un ,
long = United Nations ,
pdfstring = UN ,
short-acc = UN
}
\DeclareAcronym{dvi}{
short = dvi ,
long = device independent file format ,
pdfstring = DVI ,
short-acc = DVI
}
\DeclareAcronym{pdf}{
short = pdf ,
long = portable document file ,
pdfstring = PDF ,
short-acc = PDF
}
\DeclareAcronym{id}{
short = id ,
long = identification string ,
pdfstring = ID ,
short-acc = ID
}

\chemsetup{
greek = newtx ,
formula = chemformula ,
chemformula/format = \libertineLF ,
reactants/acronym-support = acro ,
reactants/printreactants-style = longtable
}

\sisetup{
detect-mode=false,
mode=text,
text-font-command=\libertineLF
}

\DeclareChemReactant{nBuLi}{name={\iupac{\textit{n}=butyllithium}}}
\DeclareChemReactant{Br2benzene}{name={\iupac{1,4=di|bromo|benzene}}}
\DeclareChemReactant{HBr}{name={\ch{HBr\aq}}}
\DeclareChemReactant{dcm}{name={dichloromethane}, short={DCM}}
\DeclareChemReactant{thf}{name={tetrahydrofuran}}
\DeclareChemReactant{H2SO4}{name={\ch{H2SO4}}}
\DeclareChemReactant{dichloropentane}{name={\iupac{2,4-di|chloro|pentane}}}

\chemmacros@add@version{2012-01-28}{3.0}
\chemmacros@add@version{2012-01-30}{3.0a}
\chemmacros@add@version{2012-02-03}{3.0b}
Expand Down
Binary file modified doc/chemmacros-manual.pdf
Binary file not shown.
Loading

0 comments on commit 7a2477d

Please sign in to comment.