! Missing } inserted. Error with newcommand

1,195

The commands

\newcommand{\beqFmb}[2]{\mathbf{$\mathfrak{e}^{#1}$$_{}$$_{#2}$}}

are clearly in error, you must already be in math mode to use \mathbf so the nested $ takes you out of math mode.

remove all the $ from those commands. also nesting \mathfrak inside \mathbf is not an error but is the same as \mathfrak math alphabet commands to not combine to make bold fraktur (even if you have such a font, which is possibly unlikely)

Not clear what your intended layout is, but perhaps a definition such as:

\newcommand{\beqFmb}[2]{\mathfrak{e}^{\mathbf{#1}}_{\mathbf{#2}}}
Share:
1,195

Related videos on Youtube

youpilat13
Author by

youpilat13

Updated on January 04, 2020

Comments

  • youpilat13
    youpilat13 almost 4 years

    I get a Missing } error with the following \newcommands :

    \newcommand{\bt}[1]{$\mathbf{#1}$}
    \newcommand{\beq}[1]{\mathbf{#1}}
    \newcommand{\btF}[1]{$\mathbf{$\mathfrak{e}_{#1}$}$}
    \newcommand{\beqF}[1]{\mathbf{$\mathfrak{e}_{#1}$}}
    \newcommand{\btFu}[1]{$\mathbf{$\mathfrak{e}^{#1}$}$}
    \newcommand{\beqFu}[1]{\mathbf{$\mathfrak{e}^{#1}$}}
    
    \newcommand{\btFma}[2]{$\mathbf{$\mathfrak{e}_{#1}$$_{}$$^{#2}$}$}
    \newcommand{\btFmb}[2]{$\mathbf{$\mathfrak{e}^{#1}$$_{}$$_{#2}$}$}
    \newcommand{\beqFma}[2]{\mathbf{$\mathfrak{e}_{#1}$$_{}$$^{#2}$}}
    \newcommand{\beqFmb}[2]{\mathbf{$\mathfrak{e}^{#1}$$_{}$$_{#2}$}}
    

    and in .tex source :

    \begin{equation}
    \beqF{k}=(\delta_{1k},\delta_{2k},...,\delta_{9k})\,\,\,\,;\,\,\,\,k=1,2,...,9
    \end{equation}
    

    When I try and compile this, I get the error:

    ! Missing } inserted.
    <inserted text> 
                    }
    l.3633 \beqF{k}
                   =(\delta_{1k},\delta_{2k},...,\delta_{9k})\,\,\,\,;\,\,\,\,k=...
    
    ? 
    

    Can anyone see where my error is?

    Thanks

    UPDATE :

    Originally, I had this first version and it works fine :

    \newcommand{\btF}[1]{{\Fontauri\bfseries e$_{\mathbf{#1}}$}}
    \newcommand{\beqF}[1]{\textrm{{\Fontauri\bfseries e$_{\mathbf{#1}}$}}}
    \newcommand{\btFu}[1]{{\Fontauri\bfseries e$^{\mathbf{#1}}$}}
    \newcommand{\beqFu}[1]{\textrm{{\Fontauri\bfseries e$^{\mathbf{#1}}$}}}
    \newcommand{\btFma}[2]{{\Fontauri\bfseries e$_{\mathbf{#1}}$$_{}$$^{\mathbf{#2}}$}}
    \newcommand{\btFmb}[2]{{\Fontauri\bfseries e$^{\mathbf{#1}}$$_{}$$_{\mathbf{#2}}$}}
    \newcommand{\beqFma}[2]{\textrm{\Fontauri\bfseries e$_{\mathbf{#1}}$$_{}$$^{\mathbf{#2}}$}}
    \newcommand{\beqFmb}[2]{\textrm{\Fontauri\bfseries e$^{\mathbf{#1}}$$_{}$$_{\mathbf{#2}}$}}
    

    But I would like now to use \mathfrak instead of \Fontauri (which comes with aurical.sty packaage)

    I didn't understand why this original solution works and not the one with \mathfrak, espacially with :

    \newcommand{\beqF}[1]{\mathbf{$\mathfrak{e}_{#1}$}}
    

    I think that \mathfrak shoud be between 2 $ and \mathbf is already used into mathmode in my example :

    \begin{equation}
    \beqF{k}=(\delta_{1k},\delta_{2k},\dots\delta_{9k})\dots,k=1,2,...,9
    \end{equation}
    

    Thanks for your help

    • Au101
      Au101 almost 8 years
      Unrelatedly, try \dots instead of ... for better formatting
    • David Carlisle
      David Carlisle almost 8 years
      you should worry about all those repeated \, !! (unrelated to the error but you should never need to do that)
    • Ethan Bolker
      Ethan Bolker almost 8 years
      Your new commands are starting math mode inside the equation environment, which is already in math mode.
    • Au101
      Au101 almost 8 years
      As David Carlisle gets at in his proper answer your $ ... $ are all over the place. As a piece of general advice, LaTeX is about logical structure. Your mathematical objects, equations, expressions, and so on, should go in math mode. If you have a chunk of mathematics it should all be together in math mode and you should enter math mode at the start of the chunk and exit math mode at the end of the chunk, with it all treated as a single unit. You should never skip in and out of math mode like this.
    • Au101
      Au101 almost 8 years
      (Something like The length $a$ and the height $b$ ... in the running text, however, is absolutely fine, with your $a$ and your $b$ being distinct units here, but you wouldn't wanna do something like $a$$_{1}$ or a + b$_{1}$ = c$^{2}$ + $\int x \, dx$ or anything like that, keep it together: $a_{1}$ and $a + b_{1} = c^{2} + \int x \, dx$)
  • youpilat13
    youpilat13 almost 8 years
    \beq, \beqF, \beqFu, \beqFma, \beqFmb are designed to be into "\begin{equation} ... \end{equation}" environment