3

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).

2
  • 2
    Hi ! Could you show us what you done so far and give us an image of what you want.
    – flav
    Commented Oct 19, 2017 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
    Commented Oct 19, 2017 at 5:45

4 Answers 4

6

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:

enter image description here

4
  • 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
    Commented Oct 19, 2017 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
    Commented Oct 19, 2017 at 5:18
  • 1
    +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
    Commented Oct 19, 2017 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
    Commented Oct 19, 2017 at 5:43
6

Maybe like this?

enter image description here

\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}
0
4

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}

enter image description here

3
\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}

enter image description here

You must log in to answer this question.

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