texlive[72212] Master/texmf-dist: naive-ebnf (6sep24)
commits+karl at tug.org
commits+karl at tug.org
Fri Sep 6 23:24:04 CEST 2024
Revision: 72212
https://tug.org/svn/texlive?view=revision&revision=72212
Author: karl
Date: 2024-09-06 23:24:04 +0200 (Fri, 06 Sep 2024)
Log Message:
-----------
naive-ebnf (6sep24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/naive-ebnf/README.md
trunk/Master/texmf-dist/doc/latex/naive-ebnf/naive-ebnf.pdf
trunk/Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx
trunk/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty
Modified: trunk/Master/texmf-dist/doc/latex/naive-ebnf/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/naive-ebnf/README.md 2024-09-06 21:23:48 UTC (rev 72211)
+++ trunk/Master/texmf-dist/doc/latex/naive-ebnf/README.md 2024-09-06 21:24:04 UTC (rev 72212)
@@ -1,12 +1,13 @@
+# EBNF Diagrams in LaTeX
+
[](https://github.com/yegor256/naive-ebnf/actions/workflows/l3build.yml)
[](https://ctan.org/pkg/naive-ebnf)
[](https://github.com/yegor256/naive-ebnf/blob/master/LICENSE.txt)
-This LaTeX package helps you typeset an
-[Extended Backus-Naur Form](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) (EBNF)
-using plain text format.
+This LaTeX package helps you typeset an [Extended Backus-Naur Form][EBNF]
+(EBNF) using plain text format.
-First, [install it](https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages)
+First, [install it][LaTeX]
from [CTAN](https://ctan.org/pkg/naive-ebnf)
and then use in the preamble:
@@ -22,12 +23,16 @@
\end{document}
```
-Otherwise, you can download [`naive-ebnf.sty`](https://raw.githubusercontent.com/yegor256/naive-ebnf/gh-pages/naive-ebnf/naive-ebnf.sty) and add to your project.
+Otherwise, you can download [`naive-ebnf.sty`][sty] and add to your project.
## How to Contribute
-If you want to contribute yourself, make a fork, then create a branch,
+If you want to contribute yourself, make a fork, then create a branch,
then run `l3build ctan` in the root directory.
It should compile everything without errors. If not, submit an issue and wait.
Otherwise, make your changes and then run `l3build ctan` again. If the build is
still clean, submit a pull request.
+
+[EBNF]: https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form
+[LaTeX]: https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages
+[sty]: https://raw.githubusercontent.com/yegor256/naive-ebnf/gh-pages/naive-ebnf/naive-ebnf.sty
Modified: trunk/Master/texmf-dist/doc/latex/naive-ebnf/naive-ebnf.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx 2024-09-06 21:23:48 UTC (rev 72211)
+++ trunk/Master/texmf-dist/source/latex/naive-ebnf/naive-ebnf.dtx 2024-09-06 21:24:04 UTC (rev 72212)
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{naive-ebnf}
%<*package>
-[2023-08-11 0.0.15 EBNF in Plain Text]
+[2024/09/06 0.0.16 EBNF in Plain Text]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -113,6 +113,7 @@
% \item |[...]| denotes an optional substitution;
% \item |{...}| denotes a zero or more times repetition;
% \item |{...}+| denotes one or more times repetition;
+% \item \texttt{\char`\|\char`\|\char`\|} denotes an indent at the beginning of the string.
% \item \texttt{\char`\|\char`\|} denotes an indented vertical bar at the beginning of the string.
% \end{itemize}
@@ -235,6 +236,22 @@
% \end{document}
% \end{docshot}
+
+% The \texttt{\char`\|\char`\|\char`\|} character allows indenting the text on a new line, allowing breaking long expressions:
+% \docshotOptions{firstline=5,lastline=11}
+% \begin{docshot}
+% \documentclass{minimal}
+% \usepackage[T1]{fontenc}
+% \usepackage{naive-ebnf}
+% \begin{document}
+% \begin{ebnf}
+% <x> := "beginning" \\
+% ||| ( <y> | <z> ) \\
+% ||| "ending" \\
+% \end{ebnf}
+% \end{document}
+% \end{docshot}
+
% \section{Package Options}
% It's possible to configure the behavior of the package with the help of a few package options:
@@ -407,6 +424,8 @@
{ >([^\s]) } {\\textgreater{}\1} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\s])'([^\s]) } {\1\\textquotesingle{}\2} \ebnf_tmp%
+ \regex_replace_all:nnN { \|\|\| }%
+ {\c{makebox}[#1][r]{ }} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\s])\|([^\s]) } {\1\\textbar{}\2} \ebnf_tmp%
%
Modified: trunk/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty 2024-09-06 21:23:48 UTC (rev 72211)
+++ trunk/Master/texmf-dist/tex/latex/naive-ebnf/naive-ebnf.sty 2024-09-06 21:24:04 UTC (rev 72212)
@@ -31,7 +31,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{naive-ebnf}
-[2023-08-11 0.0.15 EBNF in Plain Text]
+[2024/09/06 0.0.16 EBNF in Plain Text]
@@ -48,6 +48,7 @@
+
\RequirePackage{pgfopts}
\pgfkeys{
/ebnf/.cd,
@@ -138,6 +139,8 @@
{ >([^\s]) } {\\textgreater{}\1} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\s])'([^\s]) } {\1\\textquotesingle{}\2} \ebnf_tmp%
+ \regex_replace_all:nnN { \|\|\| }%
+ {\c{makebox}[#1][r]{ }} \ebnf_tmp%
\regex_replace_all:nnN
{ ([^\s])\|([^\s]) } {\1\\textbar{}\2} \ebnf_tmp%
%
More information about the tex-live-commits
mailing list.