diff options
author | Karl Berry <karl@freefriends.org> | 2022-02-09 20:57:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-02-09 20:57:57 +0000 |
commit | a6cb485d98d5c0f84b3c42631ed7f69361110bd6 (patch) | |
tree | ba42b3c1efdcf7e7a4689f6814b69363c4c524b3 /Master/texmf-dist/tex/latex/formal-grammar | |
parent | 9b2ee457b89b42f999b1d2ec36364b73e41e3450 (diff) |
formal-grammar (9feb22)
git-svn-id: svn://tug.org/texlive/trunk@61955 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/formal-grammar')
-rw-r--r-- | Master/texmf-dist/tex/latex/formal-grammar/formal-grammar.sty | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/formal-grammar/formal-grammar.sty b/Master/texmf-dist/tex/latex/formal-grammar/formal-grammar.sty index 990b3e5a4d3..d7cc0b7f1c7 100644 --- a/Master/texmf-dist/tex/latex/formal-grammar/formal-grammar.sty +++ b/Master/texmf-dist/tex/latex/formal-grammar/formal-grammar.sty @@ -20,7 +20,7 @@ %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{formal-grammar}[2021/11/15 v1.1 A package to typeset formal grammars] +\ProvidesPackage{formal-grammar}[2022/02/09 v1.2 A package to typeset formal grammars] \RequirePackage{xparse} \RequirePackage{newfloat} \RequirePackage{xcolor} @@ -30,6 +30,11 @@ %% \begin{abstract} %% The \textsf{formal-grammar} package provides commands to typeset formal grammars. %% \end{abstract} + \newif\if@formalalignsymbol\@formalalignsymbolfalse + \DeclareOption{center}{ + \@formalalignsymboltrue + } + \ProcessOptions\relax \DeclareFloatingEnvironment[ name=Grammar, listname={List of Grammars}, @@ -50,6 +55,11 @@ placement=tbhp, >{\formal@rowstyle}% } %% End of stackexchange + \if@formalalignsymbol + \newcolumntype{\formal@symbol}{c} + \else + \newcolumntype{\formal@symbol}{r} + \fi \ExplSyntaxOn %% 1st argument: caption (makes it float) %% 2nd argument: positionning option (`p` by default) @@ -61,7 +71,7 @@ placement=tbhp, \centering } -\begin{tabular}{\formal@reset l \formal@add r \formal@add l \formal@add l} +\begin{tabular}{\formal@reset l \formal@add \formal@symbol \formal@add l \formal@add l} }{ \end{tabular} |