如何使用 \maketitle 而不使其成为标题页,以便页眉和页脚不会改变?

如何使用 \maketitle 而不使其成为标题页,以便页眉和页脚不会改变?

如果我使用\title,那么它会改变页面样式。如何在不使其成为标题页的情况下显示标题、作者和日期等信息?

或者如何在标题页上显示页眉和页脚?

自从我昨天学到这个以来,代码就很糟糕。

\documentclass[12pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{titlesec}

%set page header and footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Com S 311: Homework 1}
\chead{Daolin Cheng}
\rhead{\today}
%\cfoot{Page \thepage}


\usepackage[left=4cm,right=4cm,top=4cm,bottom=4cm]{geometry}


\titlelabel{\thetitle}% reduce the space after section title
%\titleformat{\subsection}[runin]
%{\normalfont\large\bfseries}{\thesubsection}{1em}{} %text can follow subsection title




\begin{document}
%\pagestyle{fancy}
%\fancypagestyle{plain}


\renewcommand{\footrulewidth}{0.4pt}% default is 0pt





\section*{Problem 1}
\renewcommand{\thesubsection}{\alph{subsection}}

\subsection{) $12|\mathbb{N}\subseteq3|\mathbb{N}$} 

Proof:



\subsection{) $35|\mathbb{N}=5|\mathbb{N}\cap7|\mathbb{N}$} Proof:



%\newpage
\section*{Problem 2}
For arbitrary sets A, B, prove:
\setcounter{subsection}{0}%reset numbering
\subsection{) $A\cup B=B\Longleftrightarrow A\subseteq B$}
\subsection{) $A\cap B=B\Longleftrightarrow B\subseteq A$}
\subsection{) $A-(A-B)\subseteq B$}
\vspace*{1\baselineskip} %add one blank line
And prove there exists sets A,B such that:
\subsection{) $B\nsubseteq A-(A-B)$}
\section*{Problem 3}
Give an example of a function $f:\mathbb{Z}\rightarrow\mathbb{N}$ that is both one-to-            one and onto.
\section*{Problem 4}
Let $f:\mathbb{Z}\rightarrow\mathbb{Z}$ be a function defined as $f(x)=3x+7$. Prove:
\setcounter{subsection}{0}%reset numbering
\subsection{) $f$ is one-to-one}
\subsection{) $f$ is NOT onto}

\section*{Problem 5}
Let $\sim$ be a relation over the real numbers such that for $a,b\in\mathbb{R}, a\sim b$     if and only if $a-b\in\mathbb{Z}$. Prove that $\sim$ is an equivalence relation.


\section*{Problem 6}
Use the well-ordering principle to prove that proofs by induction are valid. More     precisely, prove that if: $P:\mathbb{N}\rightarrow \{T,F\}$ is a predicate with the     following properties,
\renewcommand{\thesubsection}{\arabic{subsection}}
\setcounter{subsection}{0} %reset numbering
\titleformat{\subsection}[block]{\hspace{2em}}{\thesubsection}{1pt}{.\quad} %add     indent, space after number and text followed
\subsection{$P(0)=T$}
\subsection{$P(n)=T\Rightarrow P(n+1)=T$}
then $\forall n\in\mathbb{N}, P(n)=T$.


\section*{Problem 7}
\renewcommand{\thesubsection}{\alph{subsection}}    
\setcounter{subsection}{0} %reset numbering
\titleformat{\subsection}[block]{\hspace{2em}}{\thesubsection}{1pt}{)\quad}
\subsection{$\forall n \in \mathbb{Z}^+$,}
$$1+3+5+\cdots+2n-1=n^2$$
\subsection{$\forall n \in \mathbb{Z}^+$,}
$$3^n>2^n$$
\subsection{$\forall n \in \mathbb{Z}^+$,}
$$\sum_{i=1}^ni=\frac{n(n+1)}{2}$$
\subsection{$\forall n \in \mathbb{Z}^+$,}
\begin{center}
$n^3+2n$ is divisible by 3
\end{center}




\section*{Bonus Problem}
\paragraph{\indent}%add indent to paragraph
A friend of yours challenges you to a game skittles. The game requires two piles each     containing exactly N skittles. On a player's turn, the player removes some (non-zero) number of skittles from exactly one of the piles. The player that takes the last skittle, wins!
\paragraph{\indent}
Your friend decides to go first. Describe a strategy that ensures that you will always win. Prove its correctness using induction.




\end{document}

答案1

您可以\thispagestyle立即发出\maketitle

示例输出

\documentclass[12pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{titlesec}

%set page header and footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Com S 311: Homework 1}
\chead{First Last}
\rhead{\today}

\usepackage[left=4cm,right=4cm,top=4cm,bottom=4cm]{geometry}

\titlelabel{\thetitle\enspace}

\begin{document}
\title{Homework 1}
\author{First Last}
\maketitle
\thispagestyle{fancy}

\section*{Problem 1}
\renewcommand{\thesubsection}{\alph{subsection})}

\subsection{$12|\mathbb{N}\subseteq3|\mathbb{N}$} 

Proof:

\subsection{$35|\mathbb{N}=5|\mathbb{N}\cap7|\mathbb{N}$} Proof:

\newpage
\section*{Problem 2}
For arbitrary sets A, B, prove:
\setcounter{subsection}{0}%reset numbering
\subsection{$A\cup B=B\Longleftrightarrow A\subseteq B$}
\subsection{$A\cap B=B\Longleftrightarrow B\subseteq A$}
\subsection{$A-(A-B)\subseteq B$}
\vspace*{1\baselineskip} %add one blank line
And prove there exists sets A,B such that:
\subsection{$B\nsubseteq A-(A-B)$}

\end{document}

相关内容