Usando \hfill en un entorno de tabulación

Usando \hfill en un entorno de tabulación

Me gustaría usarlo \hfillen un entorno de pestañas, pero parece no tener ningún efecto. ¿Cómo puedo hacerlo?

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}

(Por alguna razón no puedo cargar una captura de pantalla, ya que aparece el mensaje de error "Error al cargar la imagen; ocurrió un error en el servidor")

Respuesta1

Sugiero utilizar un entorno tabular de algún tipo. Aquí un ejemplo con el tabularraypaquete:

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

ingrese la descripción de la imagen aquí

Respuesta2

Puede medir el texto por \tabsetmacro y utilizar el texto para medir el ancho por \tabuse. No es necesario tabular el entorno.

\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

Respuesta3

Quizás la alineación correcta \`tenga el efecto que deseas

\begin{tabbing}
\hspace{0.2\textwidth} \= \hspace{0.2\textwidth} \= \hspace{0.2\textwidth}  \kill   % \kill lets the definition line disappear
Foo bar baz: \> Lib \` right aligned Bizim\\
Foo: \> Kip \> Bizim \\
\end{tabbing}

ingrese la descripción de la imagen aquí

información relacionada