% Chapter 1
\documentclass[../easybook-demo]{subfiles}
\begin{document}

\chapter{常用环境}

\section{公式}\index{g@公式}
\zhlipsum*[42][name = aspirin]
\begin{equation}\label{eq1}
  \bm{A} = \left[
  \begin{matrix}
    a_{11} & a_{12} & \cdots & a_{1n} \\
    a_{21} & a_{22} & \cdots & a_{2n} \\
    \vdots & \vdots & \ddots & \vdots \\
    a_{m1} & a_{m2} & \cdots & a_{mn} \\
  \end{matrix}
  \right] = \left[
    \begin{matrix}
      \bm{a}_1 & \bm{a}_2 & \cdots & \bm{a}_n
    \end{matrix}
  \right]
\end{equation}
可以通过添加标签在正文中引用公式，如带有中文括号的引用\cref{eq1}。

\zhlipsum*[56][name = aspirin]
\begin{equation}
  \begin{split}
    \iint_{A}E\rho(\bm{v}\cdot\bm{n})\mathrm{d}A+\frac{\partial}{\partial t}\iiint_{V}E\rho \mathrm{d}V & = \frac{\delta Q}{\mathrm{d}t}-\frac{\delta W}{\mathrm{d}t}
    \\
    \iint_{A}\left(U+\frac{v^{2}}{2}+gz+\frac{P}{\rho}\right)\rho(\bm{v}\cdot\bm{n})\mathrm{d}A+\frac{\partial}{\partial t}\iiint_{V}E\rho\mathrm{d}V & = \frac{\delta Q}{\mathrm{d}t}-\frac{\delta W_{s}}{\mathrm{d}t}
  \end{split}
\end{equation}

\zhlipsum*[42][name = aspirin]
\begin{subnumcases}{y =}
  C_1e^{r_1x}+C_2e^{r_2x} & \quad $p^2-4q > 0$
  \\
  \left(C_1+C_2\right)e^{r_1x} & \quad $p^2-4q=0$
  \\
  e^{\alpha x}\left(C_1\cos\beta x+C_2\sin\beta x\right) & \quad $p^2-4q<0$
\end{subnumcases}

\zhlipsum*[57][name = aspirin]

\clearpage
\section{插图}\index{c@插图}
当我们需要排列一组子图共享标题的图片时，可以使用依赖于 \lstinline{caption} 宏包的 \lstinline{subcaption} 宏包的功能，效果见\cref{fig1}。
\begin{figure}[htbp]
  \centering
  \subcaptionbox{并排子图1}
    {\includegraphics[width=0.4\textwidth]{example-image-4x3}}
  \hspace{1.2em}
  \subcaptionbox{并排子图2}
    {\includegraphics[width=0.4\textwidth]{example-image-4x3}}
  \bicaption[使用subcaption排版子图]{使用subcaption宏包的subcaptionbox命令排版子图}[Use subcaption to typeset subgraphs]{Use the subcaptionbox command of the subcaption package to typeset sub-pictures}\label{fig1}
\end{figure} 

\section{表格}\index{b@表格}
合并表格列使用 \lstinline{\multicolumn} 命令，合并行使用 \lstinline{\multirowcell} 命令。当插入的表格内容过长以至于一行放不下的情况可以使用 \lstinline{tabularx} 环境，设置了\textsf{L、C和R}三个列对齐选项，一个例子如\cref{tab1} 所示。
\begin{table}[htbp]
  \centering
  \bicaption{使用tabularx创建内容过长表格}{Use tabularx to create a table with too long content}\label{tab1}\small
  \begin{tabularx}{0.87\textwidth}{@{}llL@{}}
    \toprule
    Aliquam & Integer & Pellentesque tincidunt purus
    vel magna. \\
    \midrule
    viverra & \multirowcell{3}[0ex][l]{metus} & Nulla malesuada porttitor diam. Vestibulum lectus. Proin mauris. Proin eu nunc eu urna hendrerit faucibus. \\
    semper & & Nullam elementum, urna vel imperdiet sodales, elit ipsum pharetra ligula, ac pretium ante justo a nulla. Curabitur tristique arcu eu metus. \\
    \multicolumn{2}{c}{\multirowcell{3}{convallis}} & Nunc elementum fermentum wisi. Aenean placerat. Ut imperdiet, enim sed gravida sollicitudin, felis odio placerat quam, ac pulvinar elit purus eget enim. \\
    \bottomrule
  \end{tabularx}
\end{table}

\clearpage
\section{列表}\index{l@列表}
\zhlipsum*[10][name = aspirin]

\subsection{排序列表}\label{subsec1}\index{l@列表!p@排序列表}
\begin{enumerate}
  \item \zhlipsum*[41][name = aspirin]
  \begin{enumerate}
    \item \zhlipsum*[42][name = aspirin]
  \end{enumerate}
  \item \zhlipsum*[41][name = aspirin]
\end{enumerate}

\subsection{常规列表}\index{l@列表!c@常规列表}
\begin{itemize}
  \item \zhlipsum[41-42][name = aspirin]
  \begin{itemize}
    \item \zhlipsum*[42][name = aspirin]
  \end{itemize}
  \item \zhlipsum*[41][name = aspirin]
\end{itemize}

\subsection{主题列表}\index{l@列表!z@主题列表}
\begin{description}
  \item[主题一] \zhlipsum*[42][name = aspirin]
  \item[主题二] \zhlipsum*[42][name = aspirin]
\end{description}

\end{document}