如何僅在第一頁的右上角獲得標題?

如何僅在第一頁的右上角獲得標題?

我想用 LaTeX 做作業。我希望格式如下:一個簡單的答案枚舉列表(在同一行上有簡單的數字,而不是部分標記),標題僅位於第一頁的右上角。我還想要更小的邊距和 12 磅字體。我處理過的清單、邊距和字體

\documentclass[a4paper, 12pt]{article}
\usepackage{enumitem}
\usepackage{fullpage}
\begin{document}
\begin{enumerate}

 \item[1.] Here is some text. $$f(x+h) = f(x) + f'(x)h + o(h).$$

\end{enumerate}
\end{document}

我現在正在嘗試弄清楚如何在第一頁的右上角獲得標題。我在網站上搜尋了舊答案,但沒有成功。

答案1

從技術上講,無需將您想要的內容放置在頁面中標頭。我只是將其設置為文本塊的一部分 - 第一頁上的第一件事,向右對齊:

在此輸入影像描述

\documentclass[12pt]{article}
\usepackage[paper=a4paper,margin=1in]{geometry}
\begin{document}
\null\hfill\begin{tabular}[t]{l@{}}
  \textbf{My name} \\
  \textit{My University}
\end{tabular}

\begin{enumerate}
  \item
  Here is some text. $f(x+h) = f(x) + f'(x)h + \mathcal{O}(h)$.
\end{enumerate}
\end{document}

我用過geometry設定頁面邊界/大小。依照您的喜好進行調整。 a 背後的想法tabular只是強調你可以做一個建造您想要放置為包含多行的「標題」的內容。但是,如果您只想要一個條目,則可能不需要使用tabular.

相關內容