Thomas Arildsen
\textlangle and \textrangle from textcomp are exactly for this;
but $\langle$text$\rangle$ works as well.
Ciao
Enrico
In what (semantical) context do you want to use angle brackets?
/August
> Thomas Arildsen <tha.es...@spamgourmet.com> wrote:
>
>> I am trying to figure out the correct way to enter angle brackets in
>> LaTeX text mode. Entering < and > directly translates into completely
>> different characters, \langle and \rangle are for math mode and so, I
>> have resorted to using \verb to produce them in text mode. Is this the
>> best way? It seems unlikely that I should have to use \verb to get them.
>
> \textlangle and \textrangle from textcomp are exactly for this;
> but $\langle$text$\rangle$ works as well.
note that < and > are oddly represented only if you're using the
(default) ot1 encoding.
it _may_ be that your installation is configured so that simply adding
\usepackage[T1]{fontenc}
will sort the problem, but this is a non-trivial change if you're using
the default (computer modern) fonts.
i tend to use
\usepackage[T1]{fontenc}
\usepackage{lmodern}
but, again, that is only ok if your installation has the latin modern
fonts. most recent installations do, but...
--
Robin Fairbairns, Cambridge
I think the general recommendation is to include complete expressions in
math mode. This is to get the correct spacing and sizes. In this
particular case it may not affect the output though but I would prefer
$\langle\mbox{text}\rangle$ over $\langle$text$\rangle$.
/August
With \usepackage[T1]{fontenc} you get < and > with the corresponding
input, but I believe that these symbols should not be used in place
of angle brackets.
Ciao
Enrico
Thanks to all for the suggestions. That made it a bit clearer.
Best regards,
Thomas Arildsen
I am using it to write things like (in some documentation):
Type 'help <function>' too see the help information.
Best regards,
Thomas Arildsen
The very standard package doc.sty used to make package documentations
defines \meta with
\ensuremath\langle ... \ensuremath\rangle
Precisely:
\DeclareRobustCommand\meta[1]{%
\ensuremath\langle
\ifmmode \expandafter \nfss@text \fi
{%
\meta@font@select
\edef\meta@hyphen@restore
{\hyphenchar\the\font\the\hyphenchar\font}%
\hyphenchar\font\m@ne
\language\l@nohyphenation
#1\/%
\meta@hyphen@restore
}\ensuremath\rangle
}
Yours sincerely.
>
> Best regards,
> Thomas Arildsen
> Le 03/11/2010 10:43, Thomas Arildsen a écrit :
[snip]
>> I am using it to write things like (in some documentation):
>>
>> Type 'help<function>' too see the help information.
>
> The very standard package doc.sty used to make package documentations
> defines \meta with
> \ensuremath\langle ... \ensuremath\rangle
>
> Precisely:
>
> \DeclareRobustCommand\meta[1]{%
> \ensuremath\langle
> \ifmmode \expandafter \nfss@text \fi
> {%
> \meta@font@select
> \edef\meta@hyphen@restore
> {\hyphenchar\the\font\the\hyphenchar\font}%
> \hyphenchar\font\m@ne
> \language\l@nohyphenation
> #1\/%
> \meta@hyphen@restore
> }\ensuremath\rangle
> }
>
>
> Yours sincerely.
Thanks, I will take a look at that too.
Best regards,
Thomas Arildsen
>Le 03/11/2010 10:43, Thomas Arildsen a écrit :
>> On Tue, 02 Nov 2010 11:48:06 +0100, August Karlstrom wrote:
>>
[...]
>> I am using it to write things like (in some documentation):
>>
>> Type 'help<function>' too see the help information.
>
>The very standard package doc.sty used to make package documentations
>defines \meta with
> \ensuremath\langle ... \ensuremath\rangle
>
>Precisely:
>
>\DeclareRobustCommand\meta[1]{%
> \ensuremath\langle
> \ifmmode \expandafter \nfss@text \fi
> {%
> \meta@font@select
> \edef\meta@hyphen@restore
> {\hyphenchar\the\font\the\hyphenchar\font}%
> \hyphenchar\font\m@ne
> \language\l@nohyphenation
> #1\/%
> \meta@hyphen@restore
> }\ensuremath\rangle
>}
This seems strange to me. Does setting \hyphenchar\font
to -1 do anything important except turn off hyphenation?
Does setting \language to \l@nohyphenation do anything
important except turn off hyphenation? Are both needed?
I've always used
\ensuremath{\langle\mbox{\itshape#1\/}\rangle}
sometimes with different font selection command(s).
Of course \mbox prevents even manual hyphenation, but
this is something I've never needed.
Dan
To reply by email, change LookInSig to luecking
\hypenchar\font=-1 does not turn hyphenation off, but set
the hyphen character to an empty character.
Now why not \mbox I don't known. doc.sty wants to stick
to TeX rather than LaTeX, although the command is defined
with \DeclareRobustCommand ...
> > This seems strange to me. Does setting \hyphenchar\font
> > to -1 do anything important except turn off hyphenation?
What do you mean by important? Its detailed behaviour is
different from other methods.
> > Does setting \language to \l@nohyphenation do anything
> > important except turn off hyphenation? Are both needed?
Setting hyphenchar turns off hyphenation *by font*.
Setting language controls hyphenation by language region.
Setting \hyphenpenalty controls hyphenation by paragraph
(relevant value at end of paragraph).
> \hypenchar\font=-1 does not turn hyphenation off, but set
> the hyphen character to an empty character.
You are wrong. However, setting it to a valid number but
an empty character slot does do hyphenation without any
hyphen character. (The TeXbook used to say that missing
characters would inhibit hyphenation.)
--
Donald Arseneau as...@triumf.ca
From the TeXbook, page 454:
"If a suitable starting letter is found, let it be in
font~$f$. Hyphenation is abandoned unless the
^|\hyphenchar| of~$f$ is a number between 0 and~255,
inclusive."
>GL <goua...@gmail.com> writes:
>
>> > This seems strange to me. Does setting \hyphenchar\font
>> > to -1 do anything important except turn off hyphenation?
>
>What do you mean by important? Its detailed behaviour is
>different from other methods.
OK: does it have a purpose inside the definition of \meta
apart from inhibiting hyphenation? Note that, unless the user
changes fonts inside the argument of \meta, the change to
\hyphenchar completely inhihits hyphenation.
>
>> > Does setting \language to \l@nohyphenation do anything
>> > important except turn off hyphenation? Are both needed?
>
>Setting hyphenchar turns off hyphenation *by font*.
>Setting language controls hyphenation by language region.
>Setting \hyphenpenalty controls hyphenation by paragraph
>(relevant value at end of paragraph).
Again, unless the user changes language inside the argument
of \meta, this change inhibits hyphenation.
The authors of \meta seems to have chosen definition that
inhibits hyphenation, but lets it occur if the argument
contains both a language and font change, or a discretionary.
So let me make my question clear: I was wondering why this
method was chosen, and was wondering if there were any side
effects that I was unaware of. If not, I can conclude they
wanted to inhibit hyphenation, but wanted to allow it
at discretionaries. (I imagine that no one would likely change
font and language.)
> On 05 Nov 2010 11:44:56 -0700, Donald Arseneau <as...@triumf.ca> wrote:
>
> >GL <goua...@gmail.com> writes:
> >
> >> > This seems strange to me. Does setting \hyphenchar\font
> >> > to -1 do anything important except turn off hyphenation?
> >
> >What do you mean by important? Its detailed behaviour is
> >different from other methods.
>
> OK: does it have a purpose inside the definition of \meta
> apart from inhibiting hyphenation?
Not that I know of.
> >> > Does setting \language to \l@nohyphenation do anything
> >> > important except turn off hyphenation? Are both needed?
Now I see what you (GL?) mean by " Are both needed?"
> The authors of \meta seems to have chosen definition that
> inhibits hyphenation, but lets it occur if the argument
> contains both a language and font change, or a discretionary.
Also, the \hyphenchar=-1 is important on installations
where the "nohyphenation" language was not built into the
format (latex.fmt).
> So let me make my question clear: I was wondering why this
> method was chosen, and was wondering if there were any side
> effects that I was unaware of. If not, I can conclude they
> wanted to inhibit hyphenation, but wanted to allow it
> at discretionaries. (I imagine that no one would likely change
> font and language.)
I can't speak for the authors, but I guess the two settings are a
belt-and-suspenders solution.
--
Donald Arseneau as...@triumf.ca
Hi,
amsmath is your friend when it comes to entering text in math mode:
\usepackage{amsmath}
$\langle\text{YOUR TEXT HERE}\rangle$
Note that the \langle and \rangle are already quite high as delimiters
of text expressions, which is why I didn't use \left\langle and \right
\rangle.
Regards,
Marc van Dongen
\usepackage{textcomp}
\textlangle \textrangle
http://www.ctan.org/tex-archive/info/symbols/comprehensive/
Bob T.