0

Please, don't ask why I need this. I need to print > character, but I can't use the > symbol inside the .tex file. \rangle doesn't work for me, since it prints a math-mode char, which looks very much different from \texttt{>} (I need true-type font).

3

2 Answers 2

1

\textgreater works with any encoding (in text mode); remember that TeX will ignore spaces following the command, so you may need \textgreater{} if a space must follow.

If you also need to use > in math mode (but cannot input the character), also do

\DeclareMathSymbol{\mathgreater}{\mathrel}{letters}{"3E}

or, more simply but more cryptic,

\mathchardef\mathgreater=\mathcode62
3
  • There is also \textless
    – yegor256
    Jun 29 at 17:52
  • apparently, \texttt{\textgreater} and \texttt{>} look differently, do you know why and how to fix?
    – yegor256
    Jun 29 at 17:54
  • 1
    @yegor256 You need \usepackage[T1]{fontenc} if you need \textgreater in typewriter type.
    – egreg
    Jun 29 at 20:02
1

When compiling with XeLaTeX or LuaLaTeX you can use the following:

\documentclass{article}

\chardef\myrangle=62
\chardef\mylangle=60

\begin{document}
\mylangle\myrangle
\end{document}

(in pdfLaTeX you'll need to also \usepackage[T1]{fontenc}).

This'll give the following output:

enter image description here

You must log in to answer this question.

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