adjustwidth
insere uma nova linha redundante somente quando é usada com eqnarray
. Como posso evitar isso?
Entrada:
\documentclass{article}
\usepackage{changepage}
\begin{document}
\noindent
Hello World!
\begin{adjustwidth}{-1cm}{-1cm}
Hello World!
\end{adjustwidth}
\ \\
Hello World!
\begin{eqnarray}
f(x) = 1
\end{eqnarray}
\ \\
Hello World!
\begin{adjustwidth}{-1cm}{-1cm}
\begin{eqnarray}
f(x) = 1
\end{eqnarray}
\end{adjustwidth}
\end{document}
Saída:
Saída com legenda:
Tanto quanto eu meço com uma régua, a altura do espaço é duplicada quando com adjustwidth
.
Entrada MWE:
\documentclass{article}
\usepackage[top=30truemm,bottom=30truemm,left=25truemm,right=25truemm]{geometry}
\usepackage{changepage}
\usepackage{braket}
\usepackage{bm}
\newcommand{\bmk}{{\bm{k}}}
\newcommand{\brac}[1]{\left( #1 \right)}
\newcommand{\expo}[1]{e^{#1}}
\newcommand{\ao}[1]{a_{#1}}
\newcommand{\aod}[1]{a^\dagger _{#1}}
\begin{document}
Operator $A$ is defined as
\begin{eqnarray}
A &=& \sum _{\bmk _1, \bmk _2} \Braket{\bmk _1, \uparrow | \hat{A} | \bmk _2, \uparrow} \left\{ \brac{\cos \theta _{\bmk _1} \cos \theta _{\bmk _2} - \eta \sin \theta _{\bmk _1} \sin \theta _{\bmk _2}} \brac{\aod{\bmk _1, \uparrow} \ao{\bmk _2, \uparrow} + \eta \aod{- \bmk _2, \downarrow} \ao{- \bmk _1, \downarrow}} \right. \nonumber \\
&\ & \hspace{3cm} \left. + \brac{\cos \theta _{\bmk _1} \sin \theta _{\bmk _2} + \eta \sin \theta _{\bmk _1} \cos \theta _{\bmk _2}} \brac{\aod{\bmk _1, \uparrow} \aod{- \bmk _2, \downarrow} + \eta \ao{- \bmk _1, \downarrow} \ao{\bmk _2, \uparrow}} \right\}.
\end{eqnarray}
The Heisenberg representation of this gives
\begin{eqnarray}
A(t) &=& \sum _{\bmk _1, \bmk _2} \Braket{\bmk _1, \uparrow | \hat{A} | \bmk _2, \uparrow} \left\{ \brac{\cos \theta _{\bmk _1} \cos \theta _{\bmk _2} - \eta \sin \theta _{\bmk _1} \sin \theta _{\bmk _2}} \brac{\aod{\bmk _1, \uparrow} \ao{\bmk _2, \uparrow} \expo{\frac{i}{\hbar} (E_{\bmk _1} - E_{\bmk _2}) t} + \eta \aod{- \bmk _2, \downarrow} \ao{- \bmk _1, \downarrow} \expo{- \frac{i}{\hbar} (E_{\bmk _1} - E_{\bmk _2}) t}} \right. \nonumber \\
&\ & \hspace{1.5cm} \left. + \brac{\cos \theta _{\bmk _1} \sin \theta _{\bmk _2} + \eta \sin \theta _{\bmk _1} \cos \theta _{\bmk _2}} \brac{\aod{\bmk _1, \uparrow} \aod{- \bmk _2, \downarrow} \expo{\frac{i}{\hbar} (E_{\bmk _1} + E_{\bmk _2}) t} + \eta \ao{- \bmk _1, \downarrow} \ao{\bmk _2, \uparrow} \expo{- \frac{i}{\hbar} (E_{\bmk _1} + E_{\bmk _2}) t} } \right\}.
\end{eqnarray}
The Heisenberg representation of this gives
\begin{adjustwidth}{-1cm}{-1cm}
\begin{eqnarray}
A(t) &=& \sum _{\bmk _1, \bmk _2} \Braket{\bmk _1, \uparrow | \hat{A} | \bmk _2, \uparrow} \left\{ \brac{\cos \theta _{\bmk _1} \cos \theta _{\bmk _2} - \eta \sin \theta _{\bmk _1} \sin \theta _{\bmk _2}} \brac{\aod{\bmk _1, \uparrow} \ao{\bmk _2, \uparrow} \expo{\frac{i}{\hbar} (E_{\bmk _1} - E_{\bmk _2}) t} + \eta \aod{- \bmk _2, \downarrow} \ao{- \bmk _1, \downarrow} \expo{- \frac{i}{\hbar} (E_{\bmk _1} - E_{\bmk _2}) t}} \right. \nonumber \\
&\ & \hspace{1.5cm} \left. + \brac{\cos \theta _{\bmk _1} \sin \theta _{\bmk _2} + \eta \sin \theta _{\bmk _1} \cos \theta _{\bmk _2}} \brac{\aod{\bmk _1, \uparrow} \aod{- \bmk _2, \downarrow} \expo{\frac{i}{\hbar} (E_{\bmk _1} + E_{\bmk _2}) t} + \eta \ao{- \bmk _1, \downarrow} \ao{\bmk _2, \uparrow} \expo{- \frac{i}{\hbar} (E_{\bmk _1} + E_{\bmk _2}) t} } \right\}.
\end{eqnarray}
\end{adjustwidth}
\end{document}
Saída MWE:
A Eq(2) é escrita sem adjustwidth
. Isso é o suficiente quando vejo o pdf no meu computador, mas a parte da borda direita desaparece quando impresso. A Eq (3) é escrita com adjustwidth
. É legível e imprimível. No entanto, há um espaço redundante inserido. (Na Eq(2) ou Eq(3), uma única equação é dividida em duas linhas. Não quero mais dividir a equação (em três ou mais linhas).)
Responder1
Eu sugiro split
. Nunca use eqnarray
com LaTeX, prefira os ambientes de alinhamento oferecidos pelo amsmath
.
\documentclass{article}
\usepackage[top=30truemm,bottom=30truemm,left=25truemm,right=25truemm]{geometry}
\usepackage{amsmath}
\usepackage{changepage}
\usepackage{braket}
\usepackage{bm}
\newcommand{\bmk}{\bm{k}}
\newcommand{\brac}[1]{\left( #1 \right)}
\newcommand{\expo}[1]{e^{#1}}
\newcommand{\ao}[1]{a_{#1}}
\newcommand{\aod}[1]{a^\dagger_{#1}}
\newcommand{\up}{{\uparrow}}
\newcommand{\down}{{\downarrow}}
\begin{document}
Operator $A$ is defined as
\begin{equation}
\begin{split}
A =
\sum_{\bmk_1, \bmk_2} \braket{\bmk_1, \up | \hat{A} | \bmk_2, \up} \bigl\{
&
(\cos\theta_{\bmk_1} \cos\theta_{\bmk_2} - \eta \sin\theta_{\bmk_1} \sin\theta_{\bmk_2})
(\aod{\bmk_1, \up} \ao{\bmk_2, \up} + \eta \aod{- \bmk_2, \down} \ao{- \bmk_1, \down}) \\
{}+{} &
(\cos\theta_{\bmk_1} \sin\theta_{\bmk_2} + \eta \sin\theta_{\bmk_1} \cos\theta_{\bmk_2})
(\aod{\bmk_1, \up} \aod{- \bmk_2, \down} + \eta \ao{- \bmk_1, \down} \ao{\bmk_2, \up})
\bigr\}.
\end{split}
\end{equation}
The Heisenberg representation of this gives
\begin{equation}
\begin{split}
A(t) = \sum_{\bmk_1, \bmk_2} &\braket{\bmk_1, \up | \hat{A} | \bmk_2, \up}
\\
{}\cdot\bigl\{&
(\cos\theta_{\bmk_1} \cos\theta_{\bmk_2} - \eta \sin\theta_{\bmk_1} \sin\theta_{\bmk_2})
(\aod{\bmk_1, \up} \ao{\bmk_2, \up} \expo{\frac{i}{\hbar} (E_{\bmk_1} -
E_{\bmk_2}) t} + \eta \aod{- \bmk_2, \down} \ao{- \bmk_1, \down}
\expo{- \frac{i}{\hbar} (E_{\bmk_1} - E_{\bmk_2}) t})
\\
{}+{}&
(\cos\theta_{\bmk_1} \sin\theta_{\bmk_2} + \eta \sin\theta_{\bmk_1} \cos\theta_{\bmk_2})
(\aod{\bmk_1, \up} \aod{- \bmk_2, \down} \expo{\frac{i}{\hbar} (E_{\bmk_1} + E_{\bmk_2}) t} +
\eta \ao{- \bmk_1, \down} \ao{\bmk_2, \up}
\expo{- \frac{i}{\hbar} (E_{\bmk_1} + E_{\bmk_2}) t}) \bigl\}.
\end{split}
\end{equation}
\end{document}
Algumas notas: Removi todos \left
os \right
comandos, que dão cercas muito grandes ao redor. Também defini \up
e \down
, porque \uparrow
e \downarrow
são símbolos de relação e podem produzir espaçamento ruim se usados como símbolos comuns. Os colchetes na definição formam \up
e \down
se comportam como símbolos comuns em todos os lugares.
Responder2
Primeiro, não use eqnarray
– use align
em vez disso. Segundo, não há necessidade de recorrer à adjustwidth
marreta se você inserir algumas quebras de linha adicionais. Para maior legibilidade, considere usar \exp
a notação -dentro da \expo
macro, como é feito na captura de tela a seguir.
\documentclass{article}
\usepackage[vmargin=3cm,hmargin=2.5cm]{geometry}
\usepackage{amsmath}
\allowdisplaybreaks
\usepackage{changepage}
\usepackage{braket}
\usepackage{bm}
\newcommand{\bmk}{{\bm{k}}}
\newcommand{\brac}[1]{\Bigl( #1 \Bigr)}
\newcommand{\expo}[1]{\exp\bigl(#1\bigr)}
\newcommand{\ao}[1]{a^{\vphantom{\dagger}}_{#1}}
\newcommand{\aod}[1]{a^\dagger _{#1}}
\begin{document}
Operator $A$ is defined as
\begin{align}
A &= \sum _{\bmk _1, \bmk _2}
\Braket{\bmk _1, \uparrow | \hat{A} | \bmk _2, \uparrow}
\Bigl\{
\brac{\cos \theta _{\bmk _1} \cos \theta _{\bmk _2}
- \eta \sin \theta _{\bmk _1} \sin \theta _{\bmk _2}} \notag\\
&\qquad\times\brac{\aod{\bmk _1, \uparrow} \ao{\bmk _2, \uparrow}
+ \eta \aod{- \bmk _2, \downarrow} \ao{- \bmk _1, \downarrow}} \nonumber \\
&\quad+ \brac{\cos \theta _{\bmk _1} \sin \theta _{\bmk _2}
+ \eta \sin \theta _{\bmk _1} \cos \theta _{\bmk _2}}
\brac{\aod{\bmk _1, \uparrow} \aod{- \bmk _2, \downarrow}
+ \eta \ao{- \bmk _1, \downarrow} \ao{\bmk _2, \uparrow}}
\Bigr\}.\\
\intertext{The Heisenberg representation of this gives}
A(t) &= \sum _{\bmk _1, \bmk _2}
\Braket{\bmk _1, \uparrow | \hat{A} | \bmk _2, \uparrow}
\Bigl\{
\brac{\cos \theta _{\bmk _1} \cos \theta _{\bmk _2}
- \eta \sin \theta _{\bmk _1} \sin \theta _{\bmk _2}} \notag\\
&\qquad\times\brac{\aod{\bmk _1, \uparrow} \ao{\bmk _2, \uparrow}
\expo{\tfrac{i}{\hbar} (E_{\bmk _1} - E_{\bmk _2}) t}
+ \eta \aod{- \bmk _2, \downarrow} \ao{- \bmk _1, \downarrow}
\expo{- \tfrac{i}{\hbar} (E_{\bmk _1} - E_{\bmk _2}) t}} \nonumber \\
&\quad + \brac{\cos \theta _{\bmk _1} \sin \theta _{\bmk _2}
+ \eta \sin \theta _{\bmk _1} \cos \theta _{\bmk _2}} \notag\\
&\qquad\times\brac{\aod{\bmk _1, \uparrow} \aod{- \bmk _2, \downarrow}
\expo{\tfrac{i}{\hbar} (E_{\bmk _1} + E_{\bmk _2}) t}
+ \eta \ao{- \bmk _1, \downarrow} \ao{\bmk _2, \uparrow}
\expo{- \tfrac{i}{\hbar} (E_{\bmk _1} + E_{\bmk _2}) t} }
\Bigr\}\,.
\end{align}
\end{document}
Responder3
O código-fonte changepage.sty
mostra
\newenvironment{adjustwidth}[2]{%
\begin{list}{}{%
\topsep\z@%
\listparindent\parindent%
\parsep\parskip%
\@ifmtarg{#1}{\setlength{\leftmargin}{\z@}}%
{\setlength{\leftmargin}{#1}}%
\@ifmtarg{#2}{\setlength{\rightmargin}{\z@}}%
{\setlength{\rightmargin}{#2}}%
}
\item[]}{\end{list}}
(Esses links podem ajudá-lo a entender o código acima:O que \z@ faz?e\topsep, \itemsep, \partopsep e \parsep - o que significa cada um deles (e o que acontece com o fundo)?)
Portanto, o problema não é devido, adjustwidth
mas devido a eqnarray
. O list
ambiente fornece uma linha para um item, mas eqnarray
insere automaticamente uma nova linha, de modo que o espaço é ampliado. As configurações de margem são irrelevantes e o mesmo problema pode ser reproduzido com arquivos itemize
. Por exemplo,
Entrada:
\documentclass{article}
\begin{document}
\begin{itemize}
\item
\begin{eqnarray}
f(x) = 1
\end{eqnarray}
\end{itemize}
\begin{itemize}
\item Hello
\begin{eqnarray}
f(x) = 1
\end{eqnarray}
\end{itemize}
\end{document}
Saída:
Então a solução é mover o texto para adjustwidth
o ambiente.
Entrada:
\documentclass{article}
\usepackage[top=30truemm,bottom=30truemm,left=25truemm,right=25truemm]{geometry}
\usepackage{changepage}
\begin{document}
\ \\ % normal
Hello World!
\begin{eqnarray}
f(x) = 1
\end{eqnarray}
\ \\ % with adjustwidth
Hello World!
\begin{adjustwidth}{-1cm}{-1cm}
\begin{eqnarray}
f(x) = 1
\end{eqnarray}
\end{adjustwidth}
\ \\ % solution
\begin{adjustwidth}{-1cm}{-1cm}
\hspace{1.0cm}Hello World! % note that this text is INSIDE the environment
\begin{eqnarray}
f(x) = 1
\end{eqnarray}
\end{adjustwidth}
\end{document}
Saída:
Isso é o que eu queria, embora esteja obsoleto eqnarray
...