语境
我对 LaTeX 还很陌生,正在尝试使用它来完成作业,但是在格式方面遇到了一些问题。
下面显示的是我的代码的一个最小工作示例:
\documentclass{article}
\usepackage[margin = 2.54 cm]{geometry}
\usepackage{parskip}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\setlength{\parskip}{12 pt}
\renewcommand\qedsymbol{$\blacksquare$}
\begin{document}
\begin{enumerate}[label = (\alph*)]
\item
\newtheorem*{lemma}{Lemma}
\begin{lemma}
Every continuous solution of $f(xy) = f(x)f(y)$ has the form $f(x) = x^c\ \forall\ c \in \mathbb{R}$.
\end{lemma}
\begin{proof}
Let $f(x) = g(\ln x)$, then $g(\ln x + \ln y) = g(\ln x)g(\ln y)$.
Now, let $g(x) = e^{h(x)}$, then $e^{h(\ln x + \ln y)} = e^{h(\ln x) + h(\ln y)}$.
$\implies h(\ln x + \ln y) = h(\ln x) + h(\ln y)$
This is Cauchy's functional equation, which has continuous solutions of the form $h(x) = cx$.
$\implies g(x) = e^{cx}$
$\implies f(x) = x^c$
\end{proof}
\end{enumerate}
\end{document}
但是,我的列表如下所示:
问题
我认为我的问题很容易理解 - 我希望我的引理与 (a) 在同一行开始。我该如何调整代码来实现这一点?
答案1
如果必须的话,你必须...
\documentclass{article}
\usepackage[margin = 2.54 cm]{geometry}
\usepackage{parskip}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\setlength{\parskip}{12 pt}
\renewcommand\qedsymbol{$\blacksquare$}
% dont do the assignments inside an environemnt that just makes things
% even harder
\newtheorem*{lemma}{Lemma}
\begin{document}
\begin{enumerate}[label = (\alph*)]
\item
\mbox{}\vspace{\glueexpr-\parskip-\lastskip-\baselineskip}
\begin{lemma}
Every continuous solution of $f(xy) = f(x)f(y)$ has the form $f(x) = x^c\ \forall\ c \in \mathbb{R}$.
\end{lemma}
\begin{proof}
Let $f(x) = g(\ln x)$, then $g(\ln x + \ln y) = g(\ln x)g(\ln y)$.
Now, let $g(x) = e^{h(x)}$, then $e^{h(\ln x + \ln y)} = e^{h(\ln x) + h(\ln y)}$.
$\implies h(\ln x + \ln y) = h(\ln x) + h(\ln y)$
This is Cauchy's functional equation, which has continuous solutions of the form $h(x) = cx$.
$\implies g(x) = e^{cx}$
$\implies f(x) = x^c$
\end{proof}
\end{enumerate}
\end{document}