在特定文档中,我需要在垂直线旁边生成一个小于符号。这两个符号的高度必须相同。我使用了 \textbar \textless,但小于号的两个符号的高度不同。我不介意哪个符号变大或变小,只要它们的高度相同即可。
(我还需要对大于号和断开的竖线执行相同的操作)。
答案1
答案2
可能像这样吗?
\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}
答案3
只有一个猜测,即笔画是小于符号高度的7.5%。
\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}
答案4
\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}