3

This question already has an answer here:

I'm trying to improve an answer of mine and I've found a solution which works perfectly on Overleaf (I looked at the log, not only what is displayed).

\listfiles
\documentclass[12pt,fleqn]{article}
\usepackage{amsmath}
\usepackage{environ}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usetikzlibrary{decorations.pathreplacing, calligraphy, calc}
\tikzset{
    mymatr/.style={
        matrix of math nodes, 
        column sep = 10pt,
        nodes={
            anchor=text, 
            inner xsep=3pt
            }, 
        inner xsep=7pt,
        ampersand replacement=\&
        }
    }
\NewEnviron{mybrak}[1][2]{%
    \begin{tikzpicture}[baseline=(mybase)]
    \matrix[mymatr](A){
        \BODY\\
        };
    \coordinate (mybase) at ($(A-1-1.text)!.5! (A-#1-1.text)$);
    \draw[thick]([xshift=-6.4pt]A-1-1.west) -- +(4.4pt,0);
    \foreach[evaluate=\mystep as \prev using int(\mystep-1)] \mystep in {2,...,#1}{
        \draw[thick]([xshift=-6pt]A-\prev-1.west) -- ([xshift=-6pt]A-\mystep-1.west) -- + (4pt,0);
    }
    \end{tikzpicture}
    }

\NewEnviron{mycurly}[1][2]{%
    \begin{tikzpicture}[baseline=(mybase)]
    \matrix[mymatr](A){
        \BODY\\
        };
    \coordinate (mybase) at ($(A-1-1.text)!.5! (A-#1-1.text)$); 
    \draw[line width=.9pt,decorate,decoration={calligraphic brace,amplitude=4pt, mirror}](A-1-1.west) -- (A-#1-1.west);
    \end{tikzpicture}
    }


\begin{document}
Environment who puts curly braces:
\[
\begin{mycurly}
    \frac{3}{4}x+y=2 \\
    e^{2x}+3y=4
\end{mycurly}
\]
if you have more than 2 equation, you have to indicate their number in the optional argument:
\[
\begin{mycurly}[3]
    \frac{3}{4}x+y=2 \\
    e^{2x}+3y=4\\
    \sqrt{x+3}+5z=0
\end{mycurly}
\]
\[
\begin{mycurly}[4]
    x+y=2 \\
    2x+3y=4 \\
    3x+5z=0 \\
    \dfrac{7x}{x+9}+y+z=2
\end{mycurly}
\]
Environment who puts square brakets:
\[
\begin{mybrak}
    \frac{3}{4}x+y=2 \\
    e^{2x}+3y=4
\end{mybrak}
\]
if you have more than 2 equation, you have to indicate their number in the optional argument:
\[
\begin{mybrak}[3]
    \frac{3}{4}x+y=2 \\
    e^{2x}+3y=4\\
    \sqrt{x+3}+5z=0
\end{mybrak}
\]
\[
\begin{mybrak}[4]
    x+y=2 \\
    2x+3y=4 \\
    3x+5z=0 \\
    \dfrac{7x}{x+9}+y+z=2
\end{mybrak}
\]
Please note you have to use \verb|\&| instead of \verb|&| here:
\[
 f(x) = 
  \begin{mycurly}[4]
   \dfrac{1}{3}x+y=2 \& \text{if }x<0 \\
    2x+3y=4 \& \text{if }0\leq x<1\\
    3x+5z=0 \& \text{if }1\leq x<2\\
    \dfrac{7x}{x+9}+y+z=2 \& \text{if } x>2
  \end{mycurly}
\]
\[
 f(x) = 
  \begin{mycurly}[3]
    2x+3y=4 \& \text{if } x<1\\
    3x+5z=0 \& \text{if }1\leq x<2\\
    \dfrac{7x}{x+9}+y+z=2 \& \text{if } x>2
  \end{mycurly}
\]
It works also with the bracket type (even if I don't know if it is used in your country):
\[
 f(x) = 
  \begin{mybrak}[4]
   \dfrac{1}{3}x+y=2 \& \text{if }x<0 \\
    2x+3y=4 \& \text{if }0\leq x<1\\
    3x+5z=0 \& \text{if }1\leq x<2\\
    \dfrac{7x}{x+9}+y+z=2 \& \text{if } x>2
  \end{mybrak}
\]
\[
 f(x) = 
  \begin{mybrak}[3]
    2x+3y=4 \& \text{if } x<1\\
    3x+5z=0 \& \text{if }1\leq x<2\\
    \dfrac{7x}{x+9}+y+z=2 \& \text{if } x>2
  \end{mybrak}
\]
\end{document}

with these versions of the packages:

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
   fleqn.clo    2016/12/29 v1.2a Standard LaTeX option (flush left equations)
  size12.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 amsmath.sty    2016/11/05 v2.16a AMS math features
 amstext.sty    2000/06/29 v2.01 AMS text
  amsgen.sty    1999/11/30 v2.0 generic functions
  amsbsy.sty    1999/11/29 v1.2d Bold Symbols
  amsopn.sty    2016/03/08 v2.02 operator names
 environ.sty    2014/05/04 v0.3 A new way to define environments
trimspaces.sty    2009/09/17 v1.1 Trim spaces around a token list
    tikz.sty    2015/08/07 v3.0.1a (rcs-revision 1.151)
     pgf.sty    2015/08/07 v3.0.1a (rcs-revision 1.15)
  pgfrcs.sty    2015/08/07 v3.0.1a (rcs-revision 1.31)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.1a (rcs-revision 1.7)
graphicx.sty    2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
  pdftex.def    2017/06/24 v1.0g Graphics/color driver for pdftex
  pgfsys.sty    2014/07/09 v3.0.1a (rcs-revision 1.48)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v3.0.1a (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.1a (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.1a (rcs-revision 1.25)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
  spath3.sty    2016/02/19 v1.1 Functions for manipulating PGF soft paths
   expl3.sty    2017/05/29 L3 programming layer (loader) 
expl3-code.tex    2017/05/29 L3 programming layer 
l3pdfmode.def    2017/03/18 v L3 Experimental driver: PDF mode
  xparse.sty    2017/05/29 L3 Experimental document command parser
supp-pdf.mkii
epstopdf-base.sty    2016/05/15 v2.6 Base part for package epstopdf
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
  grfext.sty    2016/05/16 v1.2 Manage graphics extensions (HO)
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
pdftexcmds.sty    2017/03/19 v0.25 Utility functions of pdfTeX for LuaTeX (HO)
   ifpdf.sty    2017/03/15 v3.2 Provides the ifpdf switch
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 ***********

But if I try on my computer, with the updated versions of the packages:

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
   fleqn.clo    2016/12/29 v1.2a Standard LaTeX option (flush left equations)
  size12.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 amsmath.sty    2017/09/02 v2.17a AMS math features
 amstext.sty    2000/06/29 v2.01 AMS text
  amsgen.sty    1999/11/30 v2.0 generic functions
  amsbsy.sty    1999/11/29 v1.2d Bold Symbols
  amsopn.sty    2016/03/08 v2.02 operator names
 environ.sty    2014/05/04 v0.3 A new way to define environments
trimspaces.sty    2009/09/17 v1.1 Trim spaces around a token list
    tikz.sty    2015/08/07 v3.0.1a (rcs-revision 1.151)
     pgf.sty    2015/08/07 v3.0.1a (rcs-revision 1.15)
  pgfrcs.sty    2015/08/07 v3.0.1a (rcs-revision 1.31)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.1a (rcs-revision 1.7)
graphicx.sty    2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
  pdftex.def    2018/01/08 v1.0l Graphics/color driver for pdftex
  pgfsys.sty    2014/07/09 v3.0.1a (rcs-revision 1.48)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v3.0.1a (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.1a (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.1a (rcs-revision 1.25)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
  spath3.sty    2016/02/19 v1.1 Functions for manipulating PGF soft paths
   expl3.sty    2018-11-19 L3 programming layer (loader) 
expl3-code.tex    2018-11-19 L3 programming layer 
l3pdfmode.def    2018-11-19 v L3 Experimental driver: PDF mode
  xparse.sty    2018-10-17 L3 Experimental document command parser
supp-pdf.mkii
epstopdf-base.sty    2016/05/15 v2.6 Base part for package epstopdf
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
  grfext.sty    2016/05/16 v1.2 Manage graphics extensions (HO)
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
pdftexcmds.sty    2018/09/10 v0.29 Utility functions of pdfTeX for LuaTeX (HO)
   ifpdf.sty    2018/09/07 v3.3 Provides the ifpdf switch
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 ***********

I get the error (followed by many others):

! Undefined control sequence.
<argument> \g__prg_map_int 

l.54    \end{mycurly}

The error seems to be in the calligraphy library of TikZ, but it has not been changed since 2016/02/19.

How can I solve this error?

marked as duplicate by Zarko tikz-pgf Dec 5 '18 at 7:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    I can reproduce the issue. My guess is that the calligraphy library uses either now deprecated or removed commands or internal commands that were never meant for use outside of the kernel itself and changed without notice. – moewe Dec 5 '18 at 7:15
  • @moewe That's my guess, too. Do you think there could be an alternative solution? – CarLaTeX Dec 5 '18 at 7:17
  • 1
    The author is aware that he uses "inappropriate" commands (see the comments below tex.stackexchange.com/a/408381, especially tex.stackexchange.com/questions/408378/…) and wanted to take action at some time. – TeXnician Dec 5 '18 at 7:24
  • No idea, sorry. I guess one of the expl3 or TikZ experts will swing by soon to have a look. Maybe even the author of the library himself (but as always, if he doesn't respond here, please report the bug properly should it turn out it is one). – moewe Dec 5 '18 at 7:25
  • @TeXnician Thank you! I didn't see the duplicate. – CarLaTeX Dec 5 '18 at 9:08
7

In the process of tightening up some expl3 concepts, a few internal commands were removed. Here, one was used by a third-party package. (Part of the reason for the tighten-up was that it was not clear that third-parties should not use this code, so there is no fault with the package author.) Until the code there is altered, one can use

\usepackage{expl3}
\ExplSyntaxOn
\int_new:N \g__prg_map_int 
\ExplSyntaxOff

before

\usetikzlibrary{decorations.pathreplacing, calligraphy, calc}
  • Thank you! I didn't see the duplicate! – CarLaTeX Dec 5 '18 at 7:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.