
タブ環境内で使用したいのです\hfill
が、効果がないようです。どうすればいいでしょうか?
MWE:
\documentclass{article}
\setlength{\parindent}{0pt}
\begin{document}
\begin{tabbing}
Foo bar baz: \= Lib \hfill Bizim\\
Foo: \> Kip\\
\end{tabbing}
Foo bar baz: Lib \hfill Bizim
Foo: Kip
\end{document}
(何らかの理由でスクリーンショットをアップロードできません。「画像のアップロードに失敗しました。サーバーでエラーが発生しました」というエラーメッセージが表示されます)
答え1
何らかの表形式の環境を使用することをお勧めします。以下はパッケージの例ですtabularray
。
\documentclass{article}
\setlength{\parindent}{0pt}
\usepackage[showframe]{geometry} % just to show that the text is aligned with the margin
\usepackage{tabularray}
\begin{document}
\begin{tblr}{@{}lX@{}}
Foo bar baz: & Lib \hfill Bizim\\
Foo: & Kip\\
\end{tblr}
\end{document}
答え2
マクロでテキストを測定し\tabset
、 で測定したテキストの幅を使用できます\tabuse
。タブ環境は必要ありません。
\newdimen\tabw
\def\tabset#1{\par \setbox0=\hbox{#1}\tabw=\wd0 \leavevmode\box0 }
\def\tabuse#1{\par \leavevmode\hbox to\tabw{#1\hss}}
\tabset {Foo bar baz:} \ Lib \hfill Bizim
\tabuse {Foo:} \ Kip