Skip to content
Snippets Groups Projects
  • dgelessus's avatar
    ddda8ac3
    Use \def instead of \newcommand to define custom LaTeX commands · ddda8ac3
    dgelessus authored
    \newcommand doesn't allow overwriting an existing definition. It worked
    fine in Jupyter Notebook, which uses MathJax, which apparently doesn't
    actually check this. However, it causes errors in VS Code, which uses
    KaTeX. It probably also caused errors when converting a notebook to
    LaTeX and typesetting it with a proper LaTeX implementation.
    
    \def overwrites any existing definition and so should work in all cases.
    ddda8ac3
    History
    Use \def instead of \newcommand to define custom LaTeX commands
    dgelessus authored
    \newcommand doesn't allow overwriting an existing definition. It worked
    fine in Jupyter Notebook, which uses MathJax, which apparently doesn't
    actually check this. However, it causes errors in VS Code, which uses
    KaTeX. It probably also caused errors when converting a notebook to
    LaTeX and typesetting it with a proper LaTeX implementation.
    
    \def overwrites any existing definition and so should work in all cases.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.