\textleftarrowと\textrightarrowを短くする

\textleftarrowと\textrightarrowを短くする

私は、\textleftarrowとで作成された矢印を\textrightarrow50%と75%にし短い矢印の先は同じサイズのままです。私は数学以外の環境、つまり通常のテキストでこれを使用しています。

以下の投稿を参考にしましたが、どれも数学ベースのものばかりなので役に立ちませんでした。

答え1

これにはパッケージを使用できますtrimclip

ここに画像の説明を入力してください

このclipbox*コマンドは、4 つの座標で指定されたボックスの外側にあるテキストの部分を削除します。

\clipbox*{{.25\width} 0pt {\width} {\height}} \textrightarrow

矢印の右75%を残します。同様に、

\clipbox*{0pt 0pt {.75\width} {\height}} \textleftarrow

矢印の左 75% を残します。必要に応じて調整してください。

コードは次のとおりです:

%XeLaTeX
\documentclass[11pt]{book}
\usepackage{polyglossia}
\usepackage{trimclip}

\newcommand{\shorttextrightarrow}{\clipbox*{{.25\width} 0pt {\width} {\height}} \textrightarrow}
\newcommand{\shorttextleftarrow}{\clipbox*{0pt 0pt {.75\width} {\height}} \textleftarrow}

\begin{document}

Why \textrightarrow\ can't I figure this out \textleftarrow ?

Why \shorttextrightarrow\ can't I figure this out \shorttextleftarrow ?

\end{document}

関連情報