# How do I generate a less than symbol and vertical bar that are the same height?

In a particular document I need to produce a less than symbol next to a vertical bar. The two symbols need to be the same height. I have used \textbar \textless but the less two symbols are not the same height. I don't mind which symbol is made larger or smaller, as long as they are the same height.

(I will also need to do the same with a greater than symbol, and a broken vertical bar).

• Hi ! Could you show us what you done so far and give us an image of what you want. – flav Oct 19 '17 at 4:38
• All I've done so far is use the \textbar and \textless commands. I specifically need to have a symbol that looks like a less than and greater than symbol rather than \langle. – C. de Haer Oct 19 '17 at 5:45

Here is an answer of what I can imagine you mean:

\documentclass{article}
\usepackage{textcomp} % for "\textbrokenbar"
\begin{document}
$\langle\vert$ $\vert\rangle$
$\langle$\textbrokenbar\ \textbrokenbar$\rangle$
\end{document}


Output:

• You may want to mention explicitly that \left<|\right. and \left.\right> generate variously-sized \langle and \rangle symbols, not < and > symbols. Maybe that's exactly what the OP wants. – Mico Oct 19 '17 at 5:11
• @Mico... You can edit to explain or post your own answer with explanation and I am going to remove mine and learn from yours. My answer is based in test and some experience. An answer based in deeper knowledge will be appreciated by more people (and me too). – koleygr Oct 19 '17 at 5:18
• +1. I've gone ahead and taken you up on the "invitation" to edit your posting. As noted earlier, \left< and \right> end up being the same as \langle and \rangle. Because the heights of \langle, \rangle, \vert, and \textbrokenbar are all equal, so resizing of any symbols needs to be performed. – Mico Oct 19 '17 at 5:36
• Thanks @Mico. I would prefer to add this info in the post too (because I will not edit it again-> the real author of the answer has to be there at least in the "edited part"). It is your post now... (I just getting the points for you because you have too much :P)... – koleygr Oct 19 '17 at 5:43

Maybe like this?

\documentclass{article}
\usepackage{textcomp} % \textless, \textgreater, \textbrokenbar macros
\usepackage{graphicx} % \resizebox macro

%% Premiliminaries
\newlength\myheight
\settoheight{\myheight}{\textless}
\newcommand\raisedtextbar{\raisebox{0.4ex}{\textbar}}
\newcommand\raisedbbar{\raisebox{0.4ex}{\textbrokenbar}}
\newcommand{\mybar}{\resizebox{!}{\myheight}{\raisedtextbar}}
\newcommand{\mybbar}{\resizebox{!}{\myheight}{\raisedbbar}}

%% Four user macros (adjust the kerning to taste):
\newcommand\ltbar{\textless\kern-0.5pt\mybar}
\newcommand\bargr{\mybar\kern-0.5pt\textgreater}
\newcommand\ltbbar{\textless\kern-0.2pt\mybbar}
\newcommand\bbargt{\mybbar\kern-0.2pt\textgreater}

\begin{document}
\ltbar{} \bargr

\ltbbar{} \bbargt
\end{document}


Just one guess, namely that the strokes are 7.5% of the height of the less than symbol.

\documentclass{article}
\usepackage{pict2e}

\makeatletter
\newcommand{\lgbar}{\mathrel{\mathpalette\dehaer@lgbar\relax}}
\newcommand{\dehaer@lgbar}[2]{%
\vcenter{\hbox{%
\sbox\z@{$\m@th#1<$}%
\setlength{\unitlength}{\dimexpr\ht\z@+\dp\z@}%
\linethickness{.075\unitlength}%
\begin{picture}(.225,1)
\roundcap
\polyline(0.1125,0)(0.1125,1)
\end{picture}%
}}%
}
\newcommand{\lgbbar}{\mathrel{\mathpalette\dehaer@lgbbar\relax}}
\newcommand{\dehaer@lgbbar}[2]{%
\vcenter{\hbox{%
\sbox\z@{$\m@th#1<$}%
\setlength{\unitlength}{\dimexpr\ht\z@+\dp\z@}%
\linethickness{.075\unitlength}%
\begin{picture}(.225,1)
\roundcap
\polyline(0.1125,0)(0.1125,0.4)
\polyline(0.1125,0.6)(0.1125,1)
\end{picture}%
}}%
}
\makeatother

\newcommand{\ltb}{<\lgbar}
\newcommand{\gtb}{\lgbar>}
\newcommand{\ltbb}{<\lgbbar}
\newcommand{\gtbb}{\lgbbar>}

\begin{document}

$a\gtbb b\ltbb c \gtb d\ltb e_{\ltb}$

\Large
$a\ltb b$

\end{document}


\documentclass{article}
\usepackage{scalerel,textcomp}
\newcommand\ltbar{%
\mathrel{\ThisStyle{\stretchleftright{.}{<\kern-10\LMpt\kern6pt}{$\textbar$}}}}
\newcommand\ltbbar{%
\mathrel{\ThisStyle{\stretchleftright{.}{<\kern-9.5\LMpt\kern6pt}{$\textbrokenbar$}}}}
\begin{document}
$a\ltbar b_{x\ltbar y}\ltbbar c \ltbbar d_{x\ltbbar y}$
\end{document}