Skip to content

Commit

Permalink
Putting the styles into cls file called inkbook.cls (#4)
Browse files Browse the repository at this point in the history
* Putting the styles into cls file called inkbook.cls

* The custom titlepage nullified footnotes, fixed
  • Loading branch information
ArcturusZhang authored Jul 6, 2019
1 parent 56387a3 commit be5984b
Show file tree
Hide file tree
Showing 7 changed files with 408 additions and 309 deletions.
Binary file modified CM_chs.pdf
Binary file not shown.
305 changes: 3 additions & 302 deletions CM_chs.tex
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
\documentclass[UTF8,a4paper,openany]{ctexbook}
\usepackage{zhnumber}
% \usepackage[draft]{graphicx}
\usepackage{graphicx}
\usepackage{subfigure}

\usepackage{latexsym, amsmath, amssymb, amsfonts, mathrsfs, amsthm}
\usepackage{siunitx}

\usepackage{cases}

\usepackage{multirow}
\usepackage{textcomp}
\usepackage[top=2.54cm, bottom=2.54cm, left=3.18cm, right=3.18cm]{geometry}
\usepackage[toc,lof]{multitoc}

\documentclass{inkbook}
\usepackage{asymptote}

\usepackage{hyperref}
\hypersetup{colorlinks,
linkcolor=black,
filecolor=black,
Expand All @@ -29,24 +13,6 @@
pdfproducer={XeLaTeX},
pdfborder=0 0 1}

\setcounter{secnumdepth}{3} %使subsubsection也有编号

\usepackage{fancyhdr} %页眉页脚

\usepackage[inline]{enumitem}
\setlist[enumerate,1]{leftmargin=0pt,itemindent=2em,itemsep=0ex,listparindent=2em,parsep = 0ex,topsep = 1ex}
\setlist[enumerate,2]{leftmargin=1em,itemsep=0ex,itemindent=2em,listparindent=2em,parsep = 0ex,topsep = 1ex}
\setlist[enumerate,3]{leftmargin=1em,itemsep=0ex,itemindent=2em,listparindent=2em,parsep = 0ex,topsep = 1ex}
\setlist[itemize,1]{itemsep = 0ex, parsep = 0ex, topsep = 1ex}
\setlist[description]{listparindent=2em, itemsep=0ex, parsep = 0ex,topsep = 1ex}

\ctexset{
figurename={\kaishu 图},
tablename={表},
contentsname={目\quad 录},
listfigurename={插图目录}
}

\newcommand{\ds}{\displaystyle}
\newcommand{\eps}{\varepsilon}
\newcommand{\mbf}{\boldsymbol}
Expand Down Expand Up @@ -75,234 +41,17 @@
\renewcommand{\Re}{\mathrm{Re}\,}
\renewcommand{\Im}{\mathrm{Im}\,}

\newtheoremstyle{theoremwithoutdot}% 类型名
{}% Space above, empty = `usual value'
{}% Space below
{\kaishu}% Body font
{}% Indent amount (empty = no indent, \parindent = para indent)
{\heiti}% Thm head font
{}% Punctuation after thm head
{1em}% Space after thm head
{\thmname{#1}\thmnumber{~#2}\thmnote{~(#3)}}% Thm head spec

\newtheoremstyle{solutionstyle}% 类型名
{}% Space above, empty = `usual value'
{}% Space below
{}% Body font
{}% Indent amount (empty = no indent, \parindent = para indent)
{\heiti}% Thm head font
{}% Punctuation after thm head
{1em}% Space after thm head
{\thmname{#1}\thmnumber{~#2}\thmnote{~(#3)}}% Thm head spec

\theoremstyle{theoremwithoutdot}
\newtheorem{example}{例}[chapter]
\newtheorem{question}{题}[section]
\newtheorem*{solution}{解}
%去掉证明后面的点
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par%
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax%
\trivlist%
\item[\hskip\labelsep%
#1]\ignorespaces%
}{%
\popQED\endtrivlist\@endpefalse%
}
\makeatother
\renewcommand{\proofname}{{\heiti 证明}}

%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
%带圈脚注
\usepackage{pifont}
\usepackage[perpage,stable]{footmisc} %每页脚注重新编号
\renewcommand{\thefootnote}{\ding{\numexpr191+\value{footnote}}}
% 脚注中的脚注序号不用上标,正文中的脚注号保持不变
\makeatletter
\def\my@makefnmark{\hbox{\normalfont\@thefnmark\space}}
\let\my@save@makefntext\@makefntext
\long\def\@makefntext#1{{%
\let\@makefnmark\my@makefnmark
\my@save@makefntext{#1}}}

% Blocked theorem environment
\usepackage[framemethod=TikZ]{mdframed}
\newcommand{\newblocktheorem}[3][]{%
\ifstrempty{#1}%
{\newcounter{#2}\setcounter{#2}{0}%
}%
{\newcounter{#2}[#1]\setcounter{#2}{0}%
\expandafter\renewcommand\csname the#2\endcsname{\csname the#1\endcsname.\arabic{#2}}%
}
\newenvironment{#2}[1][]{%
\refstepcounter{#2}%
\ifstrempty{##1}%
{\mdfsetup{% with title
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=blue!20]
{\strut\heiti #3~\csname the#2\endcsname};}}
}%
{\mdfsetup{% without title
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=blue!20]
{\strut\heiti #3~\csname the#2\endcsname~(##1)};}}%
}%
\mdfsetup{innertopmargin=10pt,linecolor=blue!20,%
linewidth=2pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax
}
\begin{mdframed}[]\relax\kaishu%
}{\end{mdframed}}
}
\newblocktheorem[section]{theorem}{定理}
\newblocktheorem{law}{定律}

\allowdisplaybreaks[3]
\renewcommand*{\proofname}{\normalfont\heiti\color{black}证明}

\title{《经典力学》讲义}
\author{整理:张大鹏\thanks{基于徐晓华2010年的《经典力学》讲义整理,有修改和删节。所有插图均为重新绘制。}\\ Email:\url{[email protected]}}
%\date{}

\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\vspace*{\fill}

\vspace{\fill}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother

%在插图目录图编号前加上“图”
%\usepackage{titletoc}
%\titlecontents{figure}[0.5cm]{\songti}{\figurename~\thecontentslabel\quad}{\hspace*{-1.5cm}}{\titlerule*[0.12cm]{.}\contentspage}[\addvspace{6pt}]

%样式定义
\usepackage{titlesec}
\usepackage{xcolor,colortbl}
\usepackage{tgpagella}
\usepackage[T1]{fontenc}

\definecolor{partcolor}{RGB}{255,0,128}
\definecolor{titlecolor}{RGB}{129,129,188}
\definecolor{contentcolor}{RGB}{129,188,129}
\definecolor{backcolor}{RGB}{129,188,129}

\newcommand{\mypart}[1]{
\begin{tabular}{p{0.01\textwidth}p{0.99\textwidth}}
\arrayrulewidth=0.4pt
\cellcolor{black} & \cellcolor{partcolor} \textcolor{white}
{\newline\heiti\Huge\thepart 部分} \\
\hline
\cellcolor{black} & \multicolumn{1}{r}{\cellcolor{partcolor} \textcolor{white}
{\huge #1}}
\end{tabular}
\arrayrulewidth=0.4pt
}

\newcommand{\mytitle}[1]{
\begin{tabular}{p{0.01\textwidth}p{0.98\textwidth}}
\cellcolor{black} &\cellcolor{titlecolor} \textcolor{white}
{\newline\heiti\LARGE\zhnumber{\thechapter}章 \ \ #1}
\end{tabular}
\arrayrulewidth=0.4pt
}

\newcommand{\mycont}[1]{
\vspace{-0.5cm}
\begin{tabular}{p{0.01\textwidth}p{0.98\textwidth}}
\cellcolor{black} &\cellcolor{contentcolor} \textcolor{white}
{\newline\heiti\LARGE #1}
\end{tabular}
\arrayrulewidth=0.4pt
\vspace{-1.5cm}
}

\newcommand{\mysection}[1]{
\setlength\arrayrulewidth{1pt}\arrayrulecolor{titlecolor}
\begin{tabular}{p{0.01\textwidth}p{0.98\textwidth}}
\hline
\cellcolor{titlecolor} & \textcolor{black}{\heiti\LARGE \thesection ~ #1}
\end{tabular}
\arrayrulewidth=0.4pt
\vspace{-0.7cm}
}

\newcommand{\mysubsection}[1]{
\setlength\arrayrulewidth{1pt}\arrayrulecolor{titlecolor}
\begin{tabular}{p{0.01\textwidth}p{0.98\textwidth}}
\hline
\cellcolor{titlecolor} & \textcolor{black}{\heiti\Large \thesubsection ~ #1} \\
\hline
\end{tabular}
\arrayrulewidth=0.4pt
\vspace{-0.5cm}
}

\newcommand{\mysubsubsection}[1]{
\setlength\arrayrulewidth{1pt}\arrayrulecolor{titlecolor}
\begin{tabular}{p{0.01\textwidth}p{0.975\textwidth}p{0.01\textwidth}}
\hline
\cellcolor{titlecolor} & \textcolor{black}{\heiti\large \thesubsubsection ~ #1} & \cellcolor{titlecolor} \\
\hline
\end{tabular}
\arrayrulewidth=0.4pt
\vspace{-0.5cm}
}

\newcommand{\myappendix}[1]{
\begin{tabular}{p{0.01\textwidth}p{0.98\textwidth}}
\cellcolor{black} &\cellcolor{backcolor} \textcolor{white}
{\newline\heiti\LARGE 附录\thechapter \ \ #1}
\end{tabular}
\arrayrulewidth=0.4pt
}


\newcommand{\appendixsection}[1]{
\setlength\arrayrulewidth{1pt}\arrayrulecolor{backcolor}
\begin{tabular}{p{0.01\textwidth}p{0.99\textwidth}}
\hline
\cellcolor{backcolor} & \textcolor{black}{\heiti\LARGE \thesection ~ #1}
\end{tabular}
\arrayrulewidth=0.4pt
\vspace{-0.7cm}
}

\newcommand{\appendixsubsection}[1]{
\setlength\arrayrulewidth{1pt}\arrayrulecolor{backcolor}
\begin{tabular}{p{0.01\textwidth}p{0.99\textwidth}}
\hline
\cellcolor{backcolor} & \textcolor{black}{\heiti\Large \thesubsection ~ #1} \\
\hline
\end{tabular}
\arrayrulewidth=0.4pt
\vspace{-0.5cm}
}

\newcommand{\appendixsubsubsection}[1]{
\setlength\arrayrulewidth{1pt}\arrayrulecolor{backcolor}
\begin{tabular}{p{0.01\textwidth}p{0.95\textwidth}p{0.01\textwidth}}
\hline
\cellcolor{backcolor} & \textcolor{black}{\heiti\large \thesubsubsection ~ #1} & \cellcolor{backcolor} \\
\hline
\end{tabular}
\arrayrulewidth=0.4pt
\vspace{-0.5cm}
}

\newcommand{\mybackmatter}[1]{
\begin{tabular}{p{0.01\textwidth}p{0.99\textwidth}}
\cellcolor{black} &\cellcolor{backcolor} \textcolor{white}
{\newline\heiti\LARGE #1}
\end{tabular}
\arrayrulewidth=0.4pt
}

\begin{document}

\begin{asydef}
Expand All @@ -319,42 +68,11 @@

\frontmatter

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{第\zhnumber{\thechapter}章\ \ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ \ \rm #1}{}} %这两个命令第一次必须出现在\pagestyle{fancy}之后,否则\pagestyle{fancy}会覆盖掉其效果
\markboth{\leftmark}{\rightmark}
\fancyhf{}
\fancyhead[CO]{\rightmark}
\fancyhead[LE,RO]{$\cdot$\, \thepage\, $\cdot$}
\fancyhead[CE]{\leftmark}
\renewcommand{\headrulewidth}{0.4pt}

\titleformat{\chapter}[hang]{\heiti\LARGE}
{}{0mm}{\hspace{-0.4cm}\mycont}

\tableofcontents
\cleardoublepage

\mainmatter

\titleformat{\part}[hang]{\heiti\Huge}
{}{0mm}{\hspace{-0.4cm}\mypart}

\titleformat{\chapter}[hang]{\heiti\LARGE}
{}{0mm}{\hspace{-0.4cm}\mytitle}

\titleformat{\section}[hang]{\heiti\LARGE}
{}{0mm}{\hspace{-0.5cm}\mysection}

\titleformat{\subsection}[hang]{\heiti\large}
{}{0mm}{\hspace{-0.5cm}\mysubsection}

\titleformat{\subsubsection}[hang]{\heiti\large}
{}{0mm}{\hspace{-0.5cm}\mysubsubsection}

\titlespacing{\chapter}
{0pc}{1.5ex plus .1ex minus .2ex}{.2pc}

\part[矢量力学]{矢量力学\ (Vectorial Mechanics)}

\input{chapter/vectorial-mechanics/Kinematics.tex}%第一章——牛顿力学
Expand Down Expand Up @@ -385,22 +103,6 @@

\appendix

\titleformat{\chapter}[hang]{\heiti\LARGE}
{}{0mm}{\hspace{-0.4cm}\myappendix}

\titleformat{\section}[hang]{\heiti\LARGE}
{}{0mm}{\hspace{-0.5cm}\appendixsection}

\titleformat{\subsection}[hang]{\heiti\large}
{}{0mm}{\hspace{-0.5cm}\appendixsubsection}

\titleformat{\subsubsection}[hang]{\heiti\large}
{}{0mm}{\hspace{-0.5cm}\appendixsubsubsection}

\renewcommand{\chaptermark}[1]{\markboth{附录\ \ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ \ \rm #1}{}} %这两个命令第一次必须出现在\pagestyle{fancy}之后,否则\pagestyle{fancy}会覆盖掉其效果
\markboth{\leftmark}{\rightmark}

\input{chapter/exercise}%附录——金尚年《经典力学》

\input{chapter/exercise2}%附录——理论力学习题集
Expand All @@ -409,8 +111,7 @@

\backmatter

\titleformat{\chapter}[hang]{\heiti\LARGE}
{}{0mm}{\hspace{-0.4cm}\mybackmatter}
\titleformat{\chapter}[hang]{\heiti\LARGE}{}{0mm}{\hspace{-0.4cm}\mybackmatter}

\addcontentsline{toc}{chapter}{\listfigurename}{%
\let\oldnumberline\numberline%
Expand Down
2 changes: 1 addition & 1 deletion chapter/chapter4.tex
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ \subsection{Lagrange函数及其分离变量}

\subsection{两体中心力场}

如果两体相互作用势能只与两个粒子的相对距离$r$有关,而和它们的相对方向无关,即$V(\mbf{r}) = V(r)$,这种势场称为{\heiti 中心势场}。在中心势场中,可有两个质点之间的相互作用力为\footnote{此处由于\begin{equation*} r = \sqrt{x^2+y^2+z^2} \end{equation*}可有\begin{equation*} \frac{\pl r}{\pl \mbf{r}} = \bnb r = \frac{\pl r}{\pl x}{\mbf{e}_1}+\frac{\pl r}{\pl y}{\mbf{e}_2}+\frac{\pl r}{\pl z}{\mbf{e}_3} = \frac{x}{r}\mbf{e}_1 + \frac{y}{r}\mbf{e}_2 + \frac{z}{r}\mbf{e}_3 = \frac{\mbf{r}}{r} \end{equation*}}
如果两体相互作用势能只与两个粒子的相对距离$r$有关,而和它们的相对方向无关,即$V(\mbf{r}) = V(r)$,这种势场称为{\heiti 中心势场}。在中心势场中,可有两个质点之间的相互作用力为\footnote{此处由于\[ r = \sqrt{x^2+y^2+z^2} \]可有\[ \frac{\pl r}{\pl \mbf{r}} = \bnb r = \frac{\pl r}{\pl x}{\mbf{e}_1}+\frac{\pl r}{\pl y}{\mbf{e}_2}+\frac{\pl r}{\pl z}{\mbf{e}_3} = \frac{x}{r}\mbf{e}_1 + \frac{y}{r}\mbf{e}_2 + \frac{z}{r}\mbf{e}_3 = \frac{\mbf{r}}{r} \]}
\begin{equation}
\mbf{f}_{12} = -\frac{\pl V}{\pl \mbf{r}} = -V'(r) \frac{\pl r}{\pl \mbf{r}} = -V'(r) \frac{\mbf{r}}{r} = -\mbf{f}_{21}
\end{equation}
Expand Down
2 changes: 1 addition & 1 deletion chapter/chapter6.tex
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ \section{惯量矩阵}

\subsection{刚体定点转动的角动量、动能与转动惯量}

在平动系中,刚体绕$O$点定点转动。设刚体任意一点的位矢为$\mbf{r}$,则其在平动系中的速度为$\dot{\mbf{r}} = \mbf{\omega} \times \mbf{r}$,由此角动量可计算为\footnote{此式可通过先将刚体分割为$n$块,作为质点系处理,其角动量为\begin{equation*} \mbf{L} = \sum_{i=1}^n \mbf{r}_i \times \Delta m_i \dot{\mbf{r}}_i = \sum_{i=1}^n \mbf{r}_i \times \rho_i \dot{\mbf{r}}_i \Delta V_i \end{equation*}然后令$n$趋于无穷,根据重积分的定义即得。}
在平动系中,刚体绕$O$点定点转动。设刚体任意一点的位矢为$\mbf{r}$,则其在平动系中的速度为$\dot{\mbf{r}} = \mbf{\omega} \times \mbf{r}$,由此角动量可计算为\footnote{此式可通过先将刚体分割为$n$块,作为质点系处理,其角动量为\[ \mbf{L} = \sum_{i=1}^n \mbf{r}_i \times \Delta m_i \dot{\mbf{r}}_i = \sum_{i=1}^n \mbf{r}_i \times \rho_i \dot{\mbf{r}}_i \Delta V_i \]然后令$n$趋于无穷,根据重积分的定义即得。}
\begin{align*}
\mbf{L} = \int_V \mbf{r} \times \rho \dot{\mbf{r}} \mathrm{d} V = \int_V \rho \mbf{r} \times (\mbf{\omega} \times \mbf{r}) \mathrm{d} V = \int_V \rho \big[r^2 \mbf{\omega} - (\mbf{r} \cdot \mbf{\omega}) \mbf{r} \big] \mathrm{d} V
\end{align*}
Expand Down
8 changes: 4 additions & 4 deletions chapter/chapter6_gyro_theory.tex
Original file line number Diff line number Diff line change
Expand Up @@ -690,15 +690,15 @@ \subsubsection{Euler情形下一般刚体的守恒量}

\subsubsection{Euler情形下刚体在空间中方向的确定}\label{chapter6:subsubsection-Euler情形下刚体在空间中方向的确定}

下面考虑Euler情形下,刚体在空间系中的绝对运动,即相对于固定坐标系$OXYZ$的运动。令$Z$轴沿着矢量$\mbf{L}$的方向,由于方向$Z$相对$x_1,x_2,x_3$轴的极角和方位角分别为$\theta$$\dfrac{\pi}{2}-\psi$\label{chapter6:footnote-Euler角和球坐标系之间的关系}\footnote{可见图\ref{刚体定点转动的Euler角}。此处“极角”和“方位角”即为球坐标系
\begin{equation*}
下面考虑Euler情形下,刚体在空间系中的绝对运动,即相对于固定坐标系$OXYZ$的运动。令$Z$轴沿着矢量$\mbf{L}$的方向,由于方向$Z$相对$x_1,x_2,x_3$轴的极角和方位角分别为$\theta$$\dfrac{\pi}{2}-\psi$\label{chapter6:footnote-Euler角和球坐标系之间的关系}。此处“极角”和“方位角”即为球坐标系
\[
\begin{cases}
x = r\sin\theta\cos\phi\\
y = r\sin\theta\sin\phi\\
z = r\cos\theta
\end{cases}
\end{equation*}
中的$\theta$$\phi$。},则矢量$\mbf{L}$沿$x_1,x_2,x_3$的分量分别为
\]
中的$\theta$$\phi$,可见图\ref{刚体定点转动的Euler角}。则矢量$\mbf{L}$沿$x_1,x_2,x_3$的分量分别为
\begin{subnumcases}{\label{非对称Euler陀螺的Euler-1}}
I_1\omega_1 = L\sin\theta\sin\psi \\
I_2\omega_2 = L\sin\theta\cos\psi \\
Expand Down
Loading

0 comments on commit be5984b

Please sign in to comment.