TransWikia.com

How do I define norm delimiters?

TeX - LaTeX Asked by PHỦ Đỗ Tường on March 22, 2021

I would like to write the following equation in LaTeX:

enter image description here

Here is my code:

begin{equation}
       R =  leftVertnormoverrightarrow{q_1c}rightVert=leftVertnormoverrightarrow{q_2c}rightVert
end{equation}

Although the result as my expectation, I meet the "Undefined control Sequence" error:

enter image description here

Could you help me fix this problem.
Thanks in advance.

One Answer

You've been informed that norm is an "undefined control sequence". You further mention, in a comment, that you load the amsmath and amssymb packages. (Aside: Since the amssymb package loads the amsfonts package automatically, you don't need to load the amsfonts package explicitly.)

You have two main options:

  1. Remove the two norm directives from the code. And, while you're at it, do remove the left and right sizing directives as well, as they don't do anything here except create code clutter.

    documentclass{article} % or some other suitable document class
    usepackage{amsmath,amssymb}
    usepackage{old-arrows} % optional (for smaller arrowheads) 
    
    begin{document}
    begin{equation}
        R = Vertoverrightarrow{q_1c}Vert = Vertoverrightarrow{q_2c}Vert
    end{equation}
    end{document}
    
  2. Remove the leftVert and rightVert directives and define a macro called norm. I'd like to suggest you load the mathtools package -- a superset of the amsmath package -- for its DeclarePairedDelimiter macro to define norm.

    documentclass{article} % or some other suitable document class
    usepackage{mathtools,amssymb}
    DeclarePairedDelimiter{norm}{lVert}{rVert} % define a "norm" macro
    usepackage{old-arrows} % optional (for smaller arrowheads) 
    
    begin{document}
    begin{equation}
        R = norm{overrightarrow{q_1c}} = norm{overrightarrow{q_2c}}
    end{equation}
    end{document}
    

With both approaches, you'll get the following output:

enter image description here

Of the two approaches, the second is definitely more "LaTeX-y" as the code (here: norm{...}) emphasizes the meaning of what you're inputting. This conforms better to LaTeX's design philosophy of distinguishing as much as possible between higher-level meaning and lower-level typesetting aspects of the code.

Correct answer by Mico on March 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP