Latex:在枚舉環境中將一組單字推到右邊緣

Latex:在枚舉環境中將一組單字推到右邊緣

我正在準備這份文檔,需要在枚舉環境中將一些單字推到遠離其他單字的右側邊緣。我使用hfill函數來存檔它,但是當行足夠長時,它將溢出到下一頁,因此,以left edge.以下是我的MWE:

\begin{document}
    \begin{enumerate}
        \item \textbf{Indicate Option where applicable}: \hfill Not Applicable
        \item \textbf{Approval of Course-Work Examination Results by Board of Postgraduate Studies:} \hfill Not applicable  
        
        \item \textbf{Ratification of Course-Work Examination Results by Senate:} \hfill Not applicable
    \end{enumerate}
\end{document}

這是我的試驗輸出好像:

您可以看到第一個看起來不錯,而我希望透過將單字推送到 來使item第二個和第三個項目看起來像第一個。Not applicableright edge

我想要的是

我希望將這些溢出的單字推到right edge溢出行的末尾。

答案1

我已經提供了我的解決方案嘗試。你需要使用\hspace*代替\hspace,這樣 TeX 就不會吃掉下一行開頭的所有膠水。這使得Not~Applicable文字在第三項中正確顯示。

\documentclass{article}
%
\usepackage{microtype}%added to fix bad boxes
%
\usepackage{enumitem}
%
\begin{document}
%
\begin{enumerate}
%
\item
\textbf{Indicate Option where applicable}:
\hspace*{\fill}Not~Applicable
%
\item
\textbf{Approval of Course-Work Examination Results by Board of Postgraduate Studies:}
\hspace*{\fill}Not~Applicable  
%
\item
\textbf{Ratification of Course-Work Examination Results by Senate:}
\hspace*{\fill}Not~Applicable
%
\end{enumerate}
%
\end{document}

相關內容