3

I'm new to LaTeX and I'm wondering is there any difference between ( and \(? If there is, does the difference apply to other types of parentheses and keywords? Thanks :)

Trams
  • 365
  • 3
    Welcome to TeX.SX! \( starts math mode and \) ends it, ( just displays a parenthesis. The \( is a command, ( is not a command. The similar thing occurs with \[...\] which switches into display math mode, [ ] has multiple meanings, amongst displaying [] literally –  Nov 27 '15 at 00:35
  • 2
    Specifically, \( ... \) is for inline math, meant to appear in the running text. The most notable thing about this is that variable sized symbols like the integral sign and the summation sign will be smaller, limits will not by default be placed above and below and fractions will be smaller by default. \[ ... \] is for displayed math. These start a new line and here you have large sized integral signs and summation signs, etc. Limits are generally place above and below (though not with the integral sign) and fractions are larger – Au101 Nov 27 '15 at 00:39
  • I see... I only know that I can use $...$ to edit inline math formulas. Thanks :) – Trams Nov 27 '15 at 04:14

1 Answers1

3

This small document shows the usage of the various brackets and the slight ambivalence of \... and ...

\(...\) is meant to start the normal inline math mode, which can be written as $...$ as well. Pure (...) will display parentheses, but they can occur as delimiters as well, see the pstricks macros or commands defined with \NewDocumentCommand from xparse where other delimiters are possible.

\[...\] enters the display mode of math.

[...] can either have the meaning of literal brackets or they are interpreted as the delimiters of an optional argument to a command, such as \chapter[Foo]{Foo bar}. Those [...] are not displayed then.

Now the slightly contradictory definition: {...} are group delimiters and are not displayed directly. If you want to typeset them, use \{ and \}

\documentclass{article}

\begin{document}

Starting math mode: \( E=mc^2 \)

Display parentheses:  ( E -- non-math mode ) and \( ( E ) \) 
\vskip\baselineskip
\hrule
\vskip\baselineskip
Starting display mode: \[ E = mc^2 \]

Displaying brackets  [ ]
\vskip\baselineskip
\hrule
\vskip\baselineskip
Starting group mode { \bfseries this is bold }

Displaying braces  \{ \} 

\end{document}
  • I have some questions about the code above:

    1.what are '\vskip' and '\baselineskip' used for?

    2.Is it true that in group mode that all commands inside will not take effect on contents out of the group? Can the group mode be used in new commands and environment definition?

    – Trams Nov 27 '15 at 04:27
  • @Trams I agree with you that \vskip\baselineskip is mysterious (\vskip should never be used in a LaTeX document, by the way), but it's not relevant: those \vskip\baselineskip\hrule\vskip\baselineskip are just dividers between the examples. – egreg Nov 27 '15 at 09:40
  • @Trams: As egreg stated: It's just vertical separation between the examples. And of course {...} can be used in new commands and environments. Environments are grouping by default –  Nov 27 '15 at 10:21