在 LyX 中,我如何全局调整示例、定理等之间的空间?
我可以在序言中添加一些相对较短的命令吗?
上图取自 LyX 文件生成的 PDF,转换为以下 LaTeX(纯文本):
%% LyX 2.2.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setlength{\parskip}{\bigskipamount}
\setlength{\parindent}{0pt}
\usepackage{amsmath}
\usepackage{amsthm}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}
\theoremstyle{definition}
\newtheorem{example}[thm]{\protect\examplename}
\makeatother
\usepackage{babel}
\providecommand{\examplename}{Example}
\providecommand{\theoremname}{Theorem}
\begin{document}
\begin{example}
Hello.
\end{example}
\begin{example}
Hello.
\end{example}
\begin{thm}
Hello.
\end{thm}
\begin{thm}
Hello.
\end{thm}
\end{document}
答案1
除了重新定义定理样式之外,thmtools
例如,您可以更改 的值\topsep
。这样的修改似乎只会改变定理类结构的值,但我没有彻底测试。所以我建议在您的代码中添加这个小部分(值可以根据您的需要进行调整——我为了演示目的夸大了修改):
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setlength{\parskip}{\bigskipamount}
\setlength{\parindent}{0pt}
\usepackage{amsmath}
\usepackage{amsthm}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}
\theoremstyle{definition}
\newtheorem{example}[thm]{\protect\examplename}
\topsep = 1cm
\makeatother
\usepackage{babel}
\providecommand{\examplename}{Example}
\providecommand{\theoremname}{Theorem}
\begin{document}
\begin{example}
Hello.
\end{example}
\begin{example}
Hello.
\end{example}
\begin{thm}
Hello.
\end{thm}
\begin{thm}
Hello.
\end{thm}
\end{document}