1

In LaTeX text, I sometimes need 'unpaired' parenthesis - ( without ) or vice versa; however, in such a case, delimiter check macro reports error. I found a simple solution: \symbol{40} and \symbol{41}, which aren't recognized as delimiters. The same works for brackets [ and ] (decimal codes are 91 and 93 respectively), but doesn't work for braces { and }. Their codes are 123 and 125 respectively, but \symbol{123} and \symbol{125} produce something like dash and quote. I use fontenc LCY, trying both text and math modes.

I've found solution:\textbraceleft and \textbraceright, but why \symbol doesn't work in such a case?

15
  • 1
    Welcome to TeX.se. Can you post a minimal compilable document showing what you're doing? In math mode, the way to get an unpaired delimiter with \left and \right is to use . as the empty delimiter. Is this what you're trying to do?
    – Alan Munn
    Feb 25, 2018 at 15:13
  • 1
    Do you prefer to have the delimiter check macro working instead of the readability of the text?
    – Sigur
    Feb 25, 2018 at 15:37
  • 1
    Is this in fact a question about your editing environment? In which case, you need to tell us which editor you use.
    – Alan Munn
    Feb 25, 2018 at 15:41
  • 1
    Alan Munn, thanks for reply. I'm using WinEdt, but the question is not 'How to do it' (I've already found the solution), but 'Why \symbol{123} doesn't work'?
    – Spectorsky
    Feb 25, 2018 at 19:09
  • 3
    it is a really bad idea to use \symbol with a number, even when it works. the idea of encoding-specific commands such as \{ or \textbraceleft are that latex knows the encoding currently in use and uses the correct number. If you use a fixed number but the encoding for whatever reason changes then you will get the wrong character with no warning. \symbol{123} works but it does not mean make any particular character it means "print whatever character happens to be in position 123 of the current font" So it works as designed but is not often what you want to do. Feb 28, 2018 at 14:55

1 Answer 1

4

I guess from the comments that you mean the editor delimiter check.

Winedt can get confused by lonely parens:

enter image description here

The easiest way to get around this type of problem is to add the missing delimiter behind a comment sign:

enter image description here

Using commands works too, but \symbol{X} is not a good idea as the number X can depend on the active font encoding.

1
  • Good answer. I note that it is best to "somehow" show both of the pair, even if one half is commented out. Reason: I often detect coding errors by counting the number of left braces and right braces, etc., in a text editor.
    – user139954
    Mar 1, 2018 at 0:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .