Discussion:
Curly braces in plain text
Add Reply
Peter Flynn
2018-01-20 20:45:29 UTC
Reply
Permalink
Raw Message
The conventional way to get curly braces in plain text is to use math
mode for the nonce, $\{$like this$\}$.

But this is not commutative with the current typeface, nor with the
current font — it uses the math characters from CM.

There doesn't appear to be anything written to address this (that I have
been able to find).

Has anyone produced a working definition of (eg) \textlcb and \textrcb
which would give curly braces in normal text in the current font? Like
textcomp.sty does for many others?

///Peter.
Axel Berger
2018-01-20 21:22:57 UTC
Reply
Permalink
Raw Message
Post by Peter Flynn
The conventional way to get curly braces in plain text is to use math
mode for the nonce, $\{$like this$\}$.
I have never seen anything indicating \{ \} required math mode and a
short test just now confirmed that it doesn't.
--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --
Herb Schulz
2018-01-20 22:02:42 UTC
Reply
Permalink
Raw Message
Post by Axel Berger
Post by Peter Flynn
The conventional way to get curly braces in plain text is to use math
mode for the nonce, $\{$like this$\}$.
I have never seen anything indicating \{ \} required math mode and a
short test just now confirmed that it doesn't.
Howdy,

Did you use Plain TeX? It doesn't need math mode in LaTeX.

Good Luck,
Herb Schulz
Axel Berger
2018-01-21 10:43:35 UTC
Reply
Permalink
Raw Message
Post by Herb Schulz
Did you use Plain TeX?
No, sorry. I overlooked the plain TeX in the question.

A look into latex.ltx yielded:

\DeclareRobustCommand{\{}{\ifmmode\lbrace\else\textbraceleft\fi}

But I don't know if that helps in plain. Is \textbraceleft defined?
--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --
Peter Flynn
2018-01-21 21:34:55 UTC
Reply
Permalink
Raw Message
Post by Axel Berger
Post by Peter Flynn
The conventional way to get curly braces in plain text is to use math
mode for the nonce, $\{$like this$\}$.
I have never seen anything indicating \{ \} required math mode and a
short test just now confirmed that it doesn't.
I'm sorry, quite right. I was using math mode to get the small extra
spacing, and had gotten used to doing it that way.
Post by Axel Berger
No, sorry. I overlooked the plain TeX in the question.
No, it's LaTeX.
Post by Axel Berger
\DeclareRobustCommand{\{}{\ifmmode\lbrace\else\textbraceleft\fi}
That's what I was looking for...I never thought to look in latex.ltx; I
was convinced it was in a package. Many thanks.

///Peter

Loading...