![如何生成高度相同的小于符号和垂直线?](https://linux22.com/image/363979/%E5%A6%82%E4%BD%95%E7%94%9F%E6%88%90%E9%AB%98%E5%BA%A6%E7%9B%B8%E5%90%8C%E7%9A%84%E5%B0%8F%E4%BA%8E%E7%AC%A6%E5%8F%B7%E5%92%8C%E5%9E%82%E7%9B%B4%E7%BA%BF%EF%BC%9F.png)
在特定文档中,我需要在垂直线旁边生成一个小于符号。这两个符号的高度必须相同。我使用了 \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}