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).
2 Answers
\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
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:
\chardef\myrangle=62 \texttt{\myrangle}