Skip to content
TheChatArchiveThe Chat Archive
Metallama-4-maverick-03-26-experimental· MetaHugging Face LMArena Human Preference 140K

I'm getting an undefined control sequence in LaTeX with: [code]

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Geminigemini-2.5-pro’s answer.
  1. User

    I'm getting an undefined control sequence in LaTeX with:

       Hidden layers  & $\llbracket $ 4, 11 $\rrbracket $  \\
       Nodes per layer  & $\llbracket $ 200, 480 $\rrbracket $  \\
    
  2. Meta Assistant

    A classic error!

    The issue is that LaTeX doesn't know what \llbracket and \rrbracket are by default. These commands are part of the stmaryrd package (or alternatively, the mathabx package, but stmaryrd is more commonly used).

    Solution: Add the following line to your preamble (before \begin{document}):

    \usepackage{stmaryrd}
    

    The stmaryrd package provides various mathematical symbols, including the "blackboard bold brackets" \llbracket and \rrbracket (as well as \llangle and \rrangle, if you ever need those too).

    Here's the corrected code:

    \documentclass{article}
    \usepackage{stmaryrd} % <--- Add this line
    \begin{document}
    
    \begin{tabular}{ll}
       Hidden layers  & $\llbracket 4, 11 \rrbracket$  \\
       Nodes per layer  & $\llbracket 200, 480 \rrbracket$  \\
    \end{tabular}
    
    \end{document}
    

    Now, LaTeX should happily typeset your double brackets:

    ℒℒ[4, 11ℛℛ] and ℒℒ[200, 480ℛℛ]

    Alternative: If you don't want to load an extra package, you can use the mathtools package (which is a superset of amsmath) and define the commands yourself:

    \documentclass{article}
    \usepackage{mathtools}
    \DeclarePairedDelimiter{\llbracket}{\llbracket}{\rrbracket}
    \begin{document}
    
    \begin{tabular}{ll}
       Hidden layers  & $\llbracket 4, 11 \rrbracket$  \\
       Nodes per layer  & $\llbracket 200, 480 \rrbracket$  \\
    \end{tabular}
    
    \end{document}
    

    However, using stmaryrd is usually the simpler and more straightforward solution.

    Troubleshooting tip: When LaTeX complains about an "undefined control sequence", it means it doesn't recognize the command (in this case, \llbracket). The error message will actually tell you the exact command name that's causing the issue. Just Google the command name + "LaTeX" and you'll likely find the required package or a workaround!

    Happy LaTeXing!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.