幅が異なる 2 行の小さなテキストがあります。前のテキストの左揃えと行の高さを維持しながら、右揃えにしたいです。
\documentclass{article}
\usepackage{fontspec}
\usepackage{lipsum}
\begin{document}
I was yet young in life, which I had begun early; but my intimacy with him was of a recent date: we had been educated at the same schools and university; but his progress through these had preceded mine, and he had been deeply initiated into what is called the world while I was in noviciate noviciate noviciate.
\hfill\vbox{\hbox{Foo}
\hbox{Foobar}}
\end{document}
答え1
tabular
op アライメントで を使用できます[t]
。
\documentclass{article}
\usepackage{fontspec}
\usepackage{lipsum}
\begin{document}
I was yet young in life, which I had begun early; but my intimacy with him was of a recent date: we had been educated at the same schools and university; but his progress through these had preceded mine, and he had been deeply initiated into what is called the world while I was in noviciate noviciate noviciate.
\hspace*{\fill}
\begin{tabular}[t]{l@{}}
Foo\\
Foobar
\end{tabular}
\end{document}
答え2
\strut
最も簡単な解決策は、前のテキストの末尾と の両方にを配置することです\hbox
。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\begin{document}
I was yet young in life, which I had begun early; but my intimacy with him
was of a recent date: we had been educated at the same schools and
university; but his progress through these had preceded mine, and he had
been deeply initiated into what is called the world while I was in
noviciate noviciate noviciate.\strut
\hfill\vbox{\hbox{\strut Foo}
\hbox{Foobar}}
\end{document}
ただし、LaTeX でプリミティブなボックス化コマンドを使用することはお勧めしません。