
這是一個朋友寫的一段程式碼,但我不記得名字了。它實際上允許換行符保持顯示方程式的等號的實際垂直線。然而,顯然它不會增加幀數。此外,它無法在框架內工作,框架編號將自動處理。 2 個問題。
(1)為什麼它在框架內不起作用?
(2)為什麼我不能使用 更改幀外的幀號addtocounter{framenumber}{1}
?
這是我之前的消息的延續,不幸的是,沒有得到完全答案。
\begingroup
\allowdisplaybreaks
\begin{align*}
y(x) &= e^{\int 1dx}\left(C+\int e^{\int(-1)dx}e^xdx\right)\\
&=e^{\int dx}\left(C+\int e^{-\int dx}e^xdx\right)\\
&=e^x\left(C+\int e^{-x}e^xdx\right)\\
&=e^x(C+x).
\end{align*}
\endgroup
這些行在第一頁之後移動到下一頁。但是,第二頁的等號與前一頁上的等號完全對齊。謝謝你!乳膠
這是我的意思的整頁。
\documentclass[11pt,compress,pdf,leqno,article]{beamer}
\mode<presentation>
\usepackage{amsmath}
\usepackage{mathtools}
\usetheme{Madrid}
\setbeamertemplate{footline}[frame number]{} % added march 13, 2020
%
\newcommand{\blo}{Hi!\\}
%
\begin{document}
\blo\blo\blo\blo\blo\blo\blo\blo\blo\blo\blo\blo\blo\blo\blo
\begingroup
\allowdisplaybreaks
\begin{align*}
y(x) &= e^{\int 1dx}\left(C+\int e^{\int(-1)dx}e^xdx\right)\\
&=e^{\int dx}\left(C+\int e^{-\int dx}e^xdx\right)\\
&=e^x\left(C+\int e^{-x}e^xdx\right)\\
&=e^x(C+x).
\end{align*}
\endgroup
\end{document}
謝謝你們! !
答案1
文檔beamer
類別旨在準備簡報。它們由框架組成,但在您的文件範例中它們不存在。
如果它們包含在您的文件中,如以下關於訊框編號的 MWE 所示:
\documentclass[11pt,compress,pdf,leqno,article]{beamer}
\mode<presentation>
\usetheme{Madrid}
\usepackage{mathtools}
%
\newcommand{\blo}{Hi!\\}
%
\begin{document}
\begin{frame}[allowframebreaks]
\blo\blo\blo\blo\blo\blo\blo\blo\blo\blo
\begingroup
\allowdisplaybreaks
\begin{align*}
y(x) &= e^{\int 1dx}\left(C+\int e^{\int(-1)dx}e^xdx\right)\\
&=e^{\int dx}\left(C+\int e^{-\int dx}e^xdx\right)\\
&=e^x\left(C+\int e^{-x}e^xdx\right)\\
&=e^x(C+x).
\end{align*}
\endgroup
\end{frame}
\end{document}
比您在(至少)兩次編譯所需/正確的結果後得到的結果:
編輯: 在我看來,你的演講結果並不漂亮,事實上它不允許聽眾理解你的方程式系統中存在的推導。最好在自己的框架中編寫方程式:
\documentclass[leqno]{beamer}
\mode<presentation>
\usetheme{Madrid}
\usepackage{amsmath}
%%%% modification of the \exp %
%---------------------------------------------------------------%
\makeatletter
\let\origexp\exp
\DeclareRobustCommand{\exp}{\@ifnextchar^{\Exp^{}}{\origexp }}
\def\Exp^#1{\,\mathop{\mathrm{\mathstrut e}\!\!}\nolimits^{#1}\,}
\makeatother
%---------------------------------------------------------------%
\DeclareRobustCommand{\dx}{\,\mathrm{d}x}
\newcommand{\blo}{Hi!\\}
\begin{document}
\begin{frame}[allowframebreaks]
\frametitle{Test of multi slide frame}
\begin{itemize}
\item Hi!
\item Hi!
\item Hi!
\item Hi!
\item Hi!
\item Hi!
\item Hi!
\item Hi!
\item Hi!
\item Hi!
\end{itemize}
\begin{align*}
y(x)& = \exp^{\int 1\dx}\left(C+\int \exp^{\int(-1) \dx}\exp^{x} \dx\right)\\
& = \exp^{\int \dx}\left(C +\int \exp^{-\int \dx}\exp^{x} \dx\right)\\
& = \exp^{x} \left(C+\int \exp^{-x}\exp^x \dx\right)\\
& = \exp^{x}(C+x).
\end{align*}
\end{frame}
\end{document}
在上面的 MWE 中還介紹了編寫方程式的一些變化(根據我的觀點),這些變化可以更輕鬆地區分變數、數學運算符和常數。