标题“以负角求值的三角函数”未居中。我发出了命令\begin{center} ... \end{center}
和命令\begin{centering} ... \end{centering}
。如何才能使标题居中?!
这只是文件中的一个小示例。页面上的所有文本均未水平居中。文本被推到了右侧。如何将其水平居中?
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections}
\begin{document}
\begin{centering}\Large{\textbf{Trigonometric Functions Evaluated at Negative Angles}}\end{centering}\vskip0.3in
\noindent {\bf Definition} \vskip1.25mm
\noindent \hspace*{1em}
\begin{minipage}{5.75in}
{\em $\overline{OA}$ and $\overline{OB}$ are the initial and terminal sides of $\angle{AOB}$, respectively, ${\mathrm{m}}\angle{AOB} = \theta$, and $0 \leq \theta < 360^{\circ}$. If $\overline{OB^{\prime}}$ is the reflection of $\overline{OB}$ across the line containing $\overline{OA}$, ${\mathrm{m}}\angle{AOB^{\prime}} = -\theta$.}
\end{minipage}
\vskip0.25in
\noindent {\bf Trigonometric Identities} \vskip1.25mm
\noindent \hspace*{1em}
\begin{minipage}{5.75in}
{\em For any real number $0 < \theta \leq 360$,}
\begin{equation*}
\cos(-\theta) = \cos\theta
\qquad \mbox{\em{and}} \qquad
\sin(-\theta) = -\sin\theta
\end{equation*}
{\em and so, for any such $\theta$ distinct from $90^{\circ}$ and $270^{\circ}$,}
\begin{equation*}
\tan(-\theta) = -\tan\theta .
\end{equation*}
\end{minipage}
\end{document}
答案1
您应该使用语义标记来标记文档元素,而不是手动格式化。例如,如果Trigon...
是文档的标题,则您希望
\title{Trigonometric Functions Evaluated at Negative Angles}% if it is the title of the document
\author{}\date{}
\maketitle
或者如果它是某个部分的标题,你需要
\section{Trigonometric Functions Evaluated at Negative Angles}% if it is a section heading
或者如果该部分不应编号,则使用
\section*{Trigonometric Functions Evaluated at Negative Angles}% if it is an unnumbered section heading
类似的观点适用于定义等。您需要配置您的文档,以便您可以说,例如
\begin{definition}{something}
This is a definition of something.
\end{definition}
并让此代码产生您想要的格式。
amsthm
和等软件包ntheorem
可以帮助您轻松完成此操作。
这可确保格式一致,并且可以通过改变序言中的几个选项轻松更改所有定义或所有词条的格式。
没有环境centering
。\centering
是一个命令。
\begin{center}
Something centred with vertical spacing before and after.
\end{center}
{\centering Something centred without additional vertical spacing.\par}
amsthm
这是一个完整的示例,它使用(via )提供的功能amsart
来配置definition
环境,并使用常规\newenvironment
来创建trig
环境。语法如下definition
:
\begin{definition}
Definition of something.
\end{defintion}
并且对于trig
:
\begin{trig}{Heading}
Whatever.
\end{trig}
代码:
\documentclass{amsart}
\usepackage{titling}
\pretitle{\begin{center}\Large\bfseries}
\posttitle{\par\end{center}\vskip 0.5em}
\newtheoremstyle{mytheorem}{2.5mm}{2.5mm}{\itshape}{0pt}{\bfseries}{}{\newline}{#1}
\theoremstyle{mytheorem}
\newtheorem{definition}{Definition}
\newenvironment{trig}[1]{%
\vskip 2.5mm plus .2ex minus 1ex\par
\noindent\textbf{#1}\par\noindent
\itshape\ignorespaces}{}
\begin{document}
\title{Trigonometric Functions Evaluated at Negative Angles}
\author{}\date{}
\maketitle
\begin{definition}
$\overline{OA}$ and $\overline{OB}$ are the initial and terminal sides of $\angle{AOB}$, respectively, ${\mathrm{m}}\angle{AOB} = \theta$, and $0 \leq \theta < 360^{\circ}$. If $\overline{OB^{\prime}}$ is the reflection of $\overline{OB}$ across the line containing $\overline{OA}$, ${\mathrm{m}}\angle{AOB^{\prime}} = -\theta$.
\end{definition}
\begin{trig}{Trigonometric Identities}
For any real number $0 < \theta \leq 360$,
\begin{equation*}
\cos(-\theta) = \cos\theta
\qquad \mbox{\em{and}} \qquad
\sin(-\theta) = -\sin\theta
\end{equation*}
and so, for any such $\theta$ distinct from $90^{\circ}$ and $270^{\circ}$,
\begin{equation*}
\tan(-\theta) = -\tan\theta .
\end{equation*}
\end{trig}
\end{document}
编辑
在评论中,您表示您真正想要的是实现符合 AMS 风格的目标。如果是这样,那么您应该查看AMSamsart-template.tex
类的文档。amsart.cls
提供了三种定理样式:theorem
和。该模板包含一些示例定理定义,进一步的定义应使用标准样式。remark
plain
例如:
\documentclass{amsart}
% to use standard AMS formatting, take code from amsart-template.textbf
% if appropriate, your document body should also reflect the structure of that template and follow the guidance provided in the comments there and the documentation
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{xca}[theorem]{Exercise}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\numberwithin{equation}{section}
% some additions to demonstrate the third style provided by amsart
\theoremstyle{plain}
\newtheorem{comment}[theorem]{Comment}
\begin{document}
\title{Trigonometric Functions Evaluated at Negative Angles}
\author{}\date{}
\maketitle
\section{Introduction}
\begin{definition}
$\overline{OA}$ and $\overline{OB}$ are the initial and terminal sides of $\angle{AOB}$, respectively, ${\mathrm{m}}\angle{AOB} = \theta$, and $0 \leq \theta < 360^{\circ}$. If $\overline{OB^{\prime}}$ is the reflection of $\overline{OB}$ across the line containing $\overline{OA}$, ${\mathrm{m}}\angle{AOB^{\prime}} = -\theta$.
\end{definition}
\begin{definition}[something]
This is a definition of `something'.
\end{definition}
\begin{remark}
This is a remark.
\end{remark}
\begin{remark}[Aardvarks]
This is a remark about aardvarks.
\end{remark}
\begin{comment}[Trigonometric Identities]
For any real number $0 < \theta \leq 360$,
\begin{equation*}
\cos(-\theta) = \cos\theta
\qquad \mbox{\em{and}} \qquad
\sin(-\theta) = -\sin\theta
\end{equation*}
and so, for any such $\theta$ distinct from $90^{\circ}$ and $270^{\circ}$,
\begin{equation*}
\tan(-\theta) = -\tan\theta .
\end{equation*}
\end{comment}
\end{document}
答案2
该center
环境可用于标题,并且肯定会使内容相对于文本块居中。这可能不是页面的水平中心。如果这是你想要的,请添加
\usepackage[margin=1in]{geometry}
在您的序言中指定制服margin
(或hmargin
)。
最好定义一些结构元素来管理你的格式,因为它将允许你在整个文档中保持一致的布局。
\documentclass{amsart}
\newenvironment{block}[1]
{\par\medskip
\noindent\textbf{#1}% Heading
\par\noindent\ignorespaces
}% \begin{block}{<heading>}
{\par}% \end{block}
\begin{document}
\begin{center}
\Large\bfseries
Trigonometric Functions Evaluated at Negative Angles
\end{center}
\bigskip
\begin{block}{Definition}
$\overline{OA}$ and~$\overline{OB}$ are the initial and terminal sides of~$\angle{AOB}$,
respectively, $\mathrm{m}\angle{AOB} = \theta$, and $0 \leq \theta < 360^{\circ}$.
If~$\overline{OB'}$ is the reflection of~$\overline{OB}$ across the line containing~$\overline{OA}$,
$\mathrm{m}\angle{AOB'} = -\theta$.
\end{block}
\begin{block}{Trigonometric identities}
For any real number $0 < \theta \leq 360$,
\begin{equation*}
\cos(-\theta) = \cos\theta \qquad \text{and} \qquad
\sin(-\theta) = -\sin\theta
\end{equation*}
and so, for any such~$\theta$ distinct from $90^{\circ}$ and $270^{\circ}$,
\begin{equation*}
\tan(-\theta) = -\tan\theta.
\end{equation*}
\end{block}
\end{document}
上面我定义了一个block
采用单个(强制)参数的环境。此参数设置在大胆的作为“标题”。如果需要,您可以在此处添加其他格式选项,例如\itshape
例如斜体。