一千萬個為什麽

搜索

LaTeX:如何創建左對齊段落和右對齊段落作者

請幫我創建具有以下結構的LaTeX文檔

Text
Author

Text
Author

Text是一個2-10行左對齊的塊,而Author是一行右對齊,我需要這些Text + Author塊始終出現在同一頁面上。

最佳答案

  • 使用 \ nobreak 來避免分頁。
  • 使用 \ raggedright 進行左對齊, {} 來限制宏 \ raggedright} 之前的空行。
  • 使用 \ hfill 將作者轉移到右側。

{\raggedright
Please help me in creating LaTex document with the following structure
Where Text is a block of 2--10 lines left aligned and Author is one line aligned to the right, and I need these Text+Author blocks to always appear on the same page. 

}

\nobreak
\hfill se\_pavel

{\raggedright
Please help me in creating LaTex document with the following structure
Where Text is a block of 2--10 lines left aligned and Author is one line aligned to the right, and I need these Text+Author blocks to always appear on the same page. 

}

\nobreak
\hfill se\_pavel

轉載註明原文: LaTeX:如何創建左對齊段落和右對齊段落作者