19

What is the purpose of \left., i.e., \left followed by a period? Similarly for \right.

E.g. for \right. and \left (no period)

begin{eqnarray}\label{Dsys}
  \textcolor[rgb]{.25,.0,.8}{%
    \left\{\begin{array}{l}
              u_t=F(u) \\ \\ 
              u(0)=u_0\in H,
           \end{array}
     \right. 
  }
\end{eqnarray}
Mico
  • 506,678
peter
  • 191
  • 3
    Off-topic/aside: Don't use eqnarray. It's badly deprecated. Much better alternatives are readily available. – Mico May 01 '18 at 05:41
  • 3
    @HenriMenke I think you would need to point to a duplicate answer here (there probably is one) almost every question could be closed if "read the manual" was an acceptable close reason. – David Carlisle May 01 '18 at 08:04
  • @DavidCarlisle - A search for the Missing delimiter (. inserted) warning message brings up (at least) 76 "hits". (Most of these hits are related to users either forgetting to provide a suitable fence symbol or to forgetting that curly braces must be entered as \{ and \} and hence expressing surprise that \left{ ... \right} doesn't generate the intended output.) Somewhat to my surprise, I couldn't find an earlier question that asked directly what \left. and/or \right. do... – Mico May 01 '18 at 11:46
  • 4
    Closing this question goes against the grain of the desire to make Stack Overflow and the entire Stack Exchange network a more welcoming place. Marking as a duplicate of a question asking for books is downright insulting. This question has a short and simple answer; it does not require a book. – David Hammen May 01 '18 at 12:24
  • See also https://tex.stackexchange.com/q/77589/15925 – Andrew Swann May 01 '18 at 13:51
  • @Mico Has eqnarray been officially deprecated by the Latex team and "powers that be", or there is just a wide consensus that it is a bad idea to use it? – Federico Poloni May 01 '18 at 19:59
  • @FedericoPoloni - Not being a member of the LaTeX team, I'm afraid I have no special knowledge of what's "officially deprecated" or not. (Suggestion: Ask Frank Mittelbach, David Carlisle, and/or Joseph Wright about their views...) For sure, there's a widespread consensus -- actually, make that a unanimous view -- that it's a bad idea to keep using eqnarray. However, since eqnarray and eqnarray* are mentioned in Leslie Lamport's textbook, and since people still cite that book, it's probably infeasible to officially deprecate these wretched environments. – Mico May 01 '18 at 20:10
  • @Mico I asked this because you used the word "deprecated" in your comment --- that word is usually reserved for something that has officially declared obsolete by the developers (and will likely be removed in future versions), in my experience. – Federico Poloni May 01 '18 at 20:21
  • @FedericoPoloni - I see. Indeed, the term "deprecated" may have created the false impression that I was speaking with some kind of official authority. That wasn't my intent. – Mico May 01 '18 at 20:41

1 Answers1

33

I assume you're familiar with the most common use case for \left and \right, which is to provide automatic sizing of visual delimiters or "fences" -- round parentheses, square brackets, curly braces, angle-brackets, vertical bars, etc -- so that the "fences" may visually enclose the material they surround. Example:

\[ \left( \frac{a}{b} \right) \]

Well, sometimes a "one-sided fence" is called for. The example code you provided is such a case: we need a large curly brace to the left of the array, but nothing to the right of the array. To cater to such needs, TeX lets you "pair" the \left\{ statement with a \right. statement. If you will, the "." symbol after \right denotes "no fence on this side". Because \left and \right must occur in pairs and need to operate on something, it wouldn't work to write \right without a suitable argument. (As explained below, LaTeX issues a warning message if no suitable argument is encountered.) Similarly, there may be cases for which one needs to "pair" a \left. directive with a \right| directive, as in

\[ \left. \frac{\partial f}{\partial x} \right|_{x=x_0} \]

Aside: In case you're wondering how TeX goes about processing the material that immediately follows \left and \right, here's a TeXnical explanation. As @egreg has pointed out in a comment, TeX assigns a "delimiter code" (\delcode for short) to all (math-mode) tokens: "fence symbols" -- such as round parentheses, square brackets, curly braces, and vertical bars -- have a positive \delcode, the . ("dot", "period", "full stop") symbol has a \delcode of zero, and all other tokens have -1 as their \delcode. If the token that follows \left or \right has a positive \delcode, i.e., if a "real" fence symbol is to be processed, the fence is sized according to TeX's algorithms; if the \delcode is zero, nothing is done (apart from the insertion of a bit of horizontal whitespace); and if the \delcode is negative, TeX issues a

Missing delimiter (. inserted)

warning message. This message should be taken seriously, i.e., one should examine the code and fix it appropriately. For more information on \delcodes, do peruse Chapter 17 of The TeXbook, entitled "More about Math", and especially the second double-dangerous-bend material on p. 156. For still more information, please check out pages 290 and 345 of The TeXbook.

Incidentally, the amsmath package provides an environment called cases which is designed to typeset your example code in a way that focuses on the meaning of what you're writing, without distractions about how one should go about implementing the typesetting chore.

\documentclass{article}
\usepackage{amsmath,xcolor}
\begin{document}
\begin{equation}\label{Dsys}
\textcolor[rgb]{.25,.0,.8}{%
   \begin{cases}
       u_t=F(u)    \\ 
       u(0)=u_0\in H
   \end{cases} 
}
\end{equation}
\end{document}
Mico
  • 506,678
  • 7
    The special status of . comes from the fact its \delcode is 0; “true” fences have positive \delcode, all other characters have \delcode set to −1. – egreg May 01 '18 at 06:30
  • 1
    @egreg - Many thanks for mentioning the \delcode system; I've updated my answer to provide an entire paragraph on this topic. – Mico May 01 '18 at 11:30
  • If you'd like to learn more about delimiters and \delcode, another good reference is section 21.2, "Delimiters", on pp. 191f. of Victor Eijkhout's book TeX by Topic. (Type texdoc texbytopic to bring up a copy of this document.) – Mico May 01 '18 at 20:20
  • 1
    After \left or \right one can also have \delimiter; indeed, macros such as \lceil are defined as \delimiter"4264306 (after \delimiter one should have a 28 bit integer). – egreg May 01 '18 at 20:23
  • @egreg - Thanks. Let's see if the OP (or anyone else...) posts a follow-up query about what's allowed/expected to follow \left and \right. – Mico May 01 '18 at 20:26
  • 1
    THANK YOU Mico That completely answered my question. Thanks to others who posted helpful comments too. – peter May 01 '18 at 22:55
  • @peter - You're most welcome! If you feel like this answer has been fully helpful, please feel free to "accept" it by clicking on the "checkmark" symbol along the upper-left edge of the answer. ;-) – Mico May 17 '18 at 11:36