\documentclass{article}[12pt]
\usepackage{hyperref}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[margin=0.8in,footskip=0.25in]{geometry}
\newcommand{\vs}{\vspace{0.2in}}
\newcommand{\ds}{\displaystyle}
\newcommand{\di}{\mathrm{d}}
\newcommand{\vitem}{\vs \item}
\pagestyle{plain}
\begin{document}
\Large
\hfill bob
\hfill time
\hfill class
\hfill 3/25/2015
\textbf{Problem 1:}
\begin{enumerate}[label=(\alph*)]
\item \Theta(n^{0.35})
\item \Theta(n^{0.9})
\item \Theta(\log_2(n))
\item \Theta(n \log_2(n))
\item \Theta(5^{n})
\item \Theta(1)
\item \Theta(8^{n})
\item \Theta(n^{2})
\item \Theta(1)
\item \Theta(n)
\end{enumerate}
\end{document}
我的列表格式不正确,它没有将项目添加到列表结构中。列表中的每个项目没有按顺序排列,大多数项目共享相同的字母,这是不正确的。我还需要在页脚区域的右上角放置页码。我是 Latex 的新手,请帮忙!
答案1
您需要告诉 TeX 何时切换到数学模式。对于内联数学,您可以使用$...$
或 来执行此操作\(...\)
。
\documentclass{article}[12pt]
\usepackage{hyperref}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[margin=0.8in,footskip=0.25in]{geometry}
\newcommand{\vs}{\vspace{0.2in}}
\newcommand{\ds}{\displaystyle}
\newcommand{\di}{\mathrm{d}}
\newcommand{\vitem}{\vs \item}
\pagestyle{plain}
\begin{document}
\Large
\hfill bob
\hfill time
\hfill class
\hfill 3/25/2015
\textbf{Problem 1:}
\begin{enumerate}[label=(\alph*)]
\item $\Theta(n^{0.35})$
\item $\Theta(n^{0.9})$
\item $\Theta(\log_2(n))$
\item $\Theta(n \log_2(n))$
\item $\Theta(5^{n})$
\item $\Theta(1)$
\item $\Theta(8^{n})$
\item $\Theta(n^{2})$
\item $\Theta(1)$
\item $\Theta(n)$
\end{enumerate}
\end{document}
整理
这会将页码放在页面的右下角,并用于\maketitle
在右上角创建信息。titling
用于标题的自定义格式和fancyhdr
页脚。
\documentclass{article}[12pt]
\usepackage{hyperref}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[margin=0.8in,footskip=0.25in]{geometry}
\usepackage{fancyhdr,titling}
\newcommand{\vs}{\vspace{0.2in}}
\newcommand{\ds}{\displaystyle}
\newcommand{\di}{\mathrm{d}}
\newcommand{\vitem}{\vs \item}
\fancypagestyle{plain}{%
\fancyhf{}%
\renewcommand\headrulewidth{0pt}%
\fancyhf[rf]{\thepage}}
\pagestyle{plain}
\newcommand*\classtime[1]{%
\gdef\makeclasstime{\Large\raggedleft #1\par}}
\newcommand*\class[1]{\gdef\makeclass{\Large\raggedleft #1\par}}
\pretitle{\Large\raggedleft}
\posttitle{\par}
\preauthor{\Large\raggedleft}
\postauthor{\par}
\predate{\raggedleft}
\postdate{\par}
\renewcommand\maketitlehookc{\makeclasstime\makeclass}
\begin{document}
\title{}\author{bob}\classtime{time}\class{class}\date{3/25/2015}
\maketitle
\textbf{Problem 1:}
\begin{enumerate}[label=(\alph*)]
\item $\Theta(n^{0.35})$
\item $\Theta(n^{0.9})$
\item $\Theta(\log_2(n))$
\item $\Theta(n \log_2(n))$
\item $\Theta(5^{n})$
\item $\Theta(1)$
\item $\Theta(8^{n})$
\item $\Theta(n^{2})$
\item $\Theta(1)$
\item $\Theta(n)$
\end{enumerate}
\end{document}