maybe related: https://ask.latexstudio.net/ask/question/17595.html
- 标签不要放一些诸如『大佬救命』的内容,适得其反...
- 代码要用markdown语法,不然无法正确高亮
- 可以关注一下
\parindent以及\indent和\noindent的作用,少用\\
如非必要,勿增实体。只用了amsthm的功能实现...
\documentclass[12pt]{ctexbook}
\usepackage[showframe]{geometry}
\usepackage{amsmath,amsthm}
% \usepackage{hyperref}
\newtheoremstyle{qaqstyle}
{3pt} % Space above
{3pt} % Space below
{} % Body font
{1cm} % Indent amount(修改间距)
{\bfseries} % Theorem head font
{:} % Punctuation after theorem head(冒号)
{.5em} % Space after theorem head
{\thmname{#1}\thmnumber{ #2}.\thmnote{ #3}} % Theorem head spec (can be left empty, meaning `normal')
\theoremstyle{qaqstyle}%切换为新样式
\newtheorem{example}{例}[section]
\setlength{\parindent}{0pt}%取消段前缩进
\begin{document}
% 1\\%这一行的缩进是默认的\parindent
对比
\hspace{1cm}对比:你应该用theorem的title, 而不是自己手动输入『\texttt{\char92 textbf{椭球面:}}』
\begin{example}[椭球面]
$\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}+\frac{z^{2}}{c^{2}}=1$
\end{example}
\end{document}
































问 在newtheorem环境前面生成空白区