0

I want to leave some space between the aligned environments and some below the texts in the environments so to have a nicer output. How can I do that?

\documentclass[12pt]{article}
\usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}

\setlength{\parindent}{0cm}

\usepackage{xltxtra}
\usepackage{xgreek}
\setmainfont[Mapping=tex-text]{GFSDidot.otf}
\setsansfont[Mapping=tex-text]{GFSDidot.otf}

\usepackage[fleqn]{amsmath}
\usepackage{unicode-math}

\everymath{\displaystyle}

\setlength{\mathindent}{0cm}

\allowdisplaybreaks

\newcommand{\CustomGather}[1]
{\begin{gather*}#1\end{gather*}}

\newcommand{\CustomAligned}[1]
{\begin{aligned}#1\end{aligned}}

\newcommand{\CustomAlign}[1]
{\begin{align*}#1\end{align*}}

\newcommand{\3}{\vspace{0.3cm}}

\begin{document}


Άσκηση 4

\3


\CustomGather
{
\CustomAlign
{
&\text{Ερώτημα α.}\\
&\mathcal{E}=-\frac{d}{dt}\int\limits_{S}\vec{B}\cdot \vec{dS}=-\frac{d}{dt}\int\limits_{x-b/2}^{x+b/2}\int\limits_{-b/2}^{b/2}B_{0}(x/a)^{2}\hat{y}\cdot dxdz\hat{y}=-\frac{d}{dt}\left( \frac{B_{0}}{a^{2}}\int\limits_{-b/2}^{b/2}dz\int\limits_{x-b/2}^{x+b/2}x^{2}dx\right)=\\
&=-\frac{d}{dt}\left(\frac{B_{0}b}{a^{2}}\left[\frac{x^{3}}{3}\right]_{x-b/2}^{x+b/2}\right)=\frac{B_{0}b}{a^{2}}\frac{d}{dt}\left[\frac{(x+b/2)^{3}}{3}-\frac{(x-b/2)^{3}}{3}\right]=-\frac{B_{0}b}{a^{2}}\frac{d}{dt}\left[x^{2}b+\frac{b^{3}}{12}\right]=\\
&=-\frac{B_{0}b^{2}2x}{a^{2}}\frac{dx}{dt}=-\frac{2B_{0}b^{2}xu_{0}}{a^{2}}
}\\
\CustomAlign
{
&\text{Ερώτημα β.}\\
&I=\frac{dq}{dt}\Rightarrow dq=Idt\Rightarrow Q=\int\limits_{0}^{t}Idt\\
&dx=u_{0}dt\Rightarrow dt=\frac{dx}{u_{0}}\\
&Q=\int\limits_{0}^{x}\frac{Idx}{u_{0}}=\int\limits_{0}^{x}\frac{\mathcal{E}dx}{Ru_{0}}\Rightarrow Q=\frac{2B_{0}b^{2}x^{2}}{a^{2}R2}=\frac{B_{0}b^{2}x^{2}}{a^{2}R}
}\\
\CustomAlign
{
&\text{Ερώτημα γ.}\\
&dW=\mathcal{E}Idt\Rightarrow W=\int\limits_{0}^{t}\mathcal{E}Idt=\frac{4u_{0}B^{2}_{0}b^{4}x^{3}}{3Ra^{4}}
}
}

\end{document}

enter image description here

Also why in gather/align environments with text in between the text isn't equally spaced in the middle but there is more space above it?

\CustomAlign
{&\text{Ερώτημα α.}\\
&\oint\vec{H}\cdot\vec{dl}=NI\Rightarrow H_{z}\cdot\hat{z}\cdot l \hat{z}=nlI \Rightarrow \vec{H}=nI\hat{z}\\
&\vec{B}=\mu_{0}nI\hat{z}=\mu_{0}nI_{0}\sin (\omega t) \hat{z}\\
&\oint\vec{E}\cdot\vec{dl}=-\frac{d}{dt}\int\limits_{S}\vec{B}\cdot \vec{dS}
}
Text
\CustomAlign
{&\text{Ερώτημα α.}\\
&\oint\vec{H}\cdot\vec{dl}=NI\Rightarrow H_{z}\cdot\hat{z}\cdot l \hat{z}=nlI \Rightarrow \vec{H}=nI\hat{z}\\
&\vec{B}=\mu_{0}nI\hat{z}=\mu_{0}nI_{0}\sin (\omega t) \hat{z}\\
&\oint\vec{E}\cdot\vec{dl}=-\frac{d}{dt}\int\limits_{S}\vec{B}\cdot \vec{dS}
}

enter image description here

\CustomGather
{
\CustomAligned
{
&E=\vec{u}\times \vec{B}\\
&\vec{u}=\omega \rho \hat{\phi}\\
&\vec{B}=B_{0}\hat{z}\\
&\Rightarrow \vec{E}=B_{0}\omega\rho\hat{\rho} \Rightarrow \vec{J}=\sigma B_{0}\omega\rho\hat{\rho}\\
&d^{3}\vec{F}=\vec{J}\times\vec{B}dV=\vec{J}\times\vec{B}\rho d\rho d\phi dz\\
&d^{3}\vec{T}=\vec{R} \times d^{3}vec{F}= \rho \hat{\rho} \times (\vec{J}\times\vec{B})\rho d\rho d\phi dz\\
&d^{3}\vec{T}=(-\hat{z})B^{2}_{0} \sigma \omega \rho^{3}d\rho d\phi dz\\
}
}

Άσκηση 7

\CustomGather
{
\CustomAligned
{
&\text{Ερώτημα α.}\\
&\oint\vec{H}\cdot\vec{dl}=NI\Rightarrow H_{z}\cdot\hat{z}\cdot l \hat{z}=nlI \Rightarrow \vec{H}=nI\hat{z}\\
&\vec{B}=\mu_{0}nI\hat{z}=\mu_{0}nI_{0}\sin (\omega t) \hat{z}\\
&\oint\vec{E}\cdot\vec{dl}=-\frac{d}{dt}\int\limits_{S}\vec{B}\cdot \vec{dS}
}
}

enter image description here

1 Answer 1

1

Is that better? I replaced amsmath with mathtools and had the titles (Ερώτημα α, &c.) made with the \shortintertext command. Also replaced \CustomAlign with \CustomAligned since it is nested in a gather* environment. Btw, as far as I know, loading xltxtra is useless nowadays.

\documentclass[12pt]{article}
\usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}

\setlength{\parindent}{0cm}

\usepackage{xltxtra}
\usepackage{xgreek}
\setmainfont[Mapping=tex-text]{GFSDidot.otf}
\setsansfont[Mapping=tex-text]{GFSDidot.otf}

\usepackage[fleqn]{mathtools}
\usepackage{unicode-math}

\everymath{\displaystyle}

\setlength{\mathindent}{0cm}

\allowdisplaybreaks

\newcommand{\CustomGather}[1]
{\begin{gather*}#1\end{gather*}}

\newcommand{\CustomAligned}[1]
{\begin{aligned}#1\end{aligned}}

\newcommand{\CustomAlign}[1]
{\begin{align*}#1\end{align*}}

\newcommand{\3}{\vspace{0.3cm}}

\begin{document}


Άσκηση 4

\3


\CustomGather
{
\CustomAligned
{
\shortintertext{Ερώτημα α.}
\mathcal{E}&=-\frac{d}{dt}\int\limits_{S}\vec{B} · \vec{dS}=-\frac{d}{dt}\int\limits_{x-b/2}^{x+b/2}\int\limits_{-b/2}^{b/2}B_{0}(x/a)^{2}\hat{y} · dxdz\hat{y}=-\frac{d}{dt}\left( \frac{B_{0}}{a^{2}}\int\limits_{-b/2}^{b/2}dz\int\limits_{x-b/2}^{x+b/2}x^{2}dx\right)=\\
&=-\frac{d}{dt}\left(\frac{B_{0}b}{a^{2}}\left[\frac{x^{3}}{3}\right]_{x-b/2}^{x+b/2}\right)=\frac{B_{0}b}{a^{2}}\frac{d}{dt}\left[\frac{(x+b/2)^{3}}{3}-\frac{(x-b/2)^{3}}{3}\right]=-\frac{B_{0}b}{a^{2}}\frac{d}{dt}\left[x^{2}b+\frac{b^{3}}{12}\right]=\\
&=-\frac{B_{0}b^{2}2x}{a^{2}}\frac{dx}{dt}=-\frac{2B_{0}b^{2}xu_{0}}{a^{2}}
}\\[\baselineskip]
\CustomAligned
{
\shortintertext{Ερώτημα β.}
I&=\frac{dq}{dt} ⇒  dq=Idt ⇒  Q=\int\limits_{0}^{t}Idt\\
dx&=u_{0}dt ⇒  dt=\frac{dx}{u_{0}}\\
Q&=\int\limits_{0}^{x}\frac{Idx}{u_{0}}=\int\limits_{0}^{x}\frac{\mathcal{E}dx}{Ru_{0}} ⇒  Q=\frac{2B_{0}b^{2}x^{2}}{a^{2}R2}=\frac{B_{0}b^{2}x^{2}}{a^{2}R}
}\\[\baselineskip]
\CustomAligned
{
\shortintertext{Ερώτημα γ.}
dW&=\mathcal{E}Idt ⇒  W=\int\limits_{0}^{t}\mathcal{E}Idt=\frac{4u_{0}B^{2}_{0}b^{4}x^{3}}{3Ra^{4}}
}
}

\end{document} 

enter image description here

2
  • i'm not sure this wouldn't be better as a single align* environment with suitable \shortintertext inclusions. Jul 10, 2014 at 18:55
  • @barbara beeton: Maybe… I confess I don't remember the contextual details (two months!). However I think if it had been possible to satisfy the OP's requirements with the simpler solution without manual adjustments, I'd have used it. Here the adjustment is minimal and uniform (1\baselineskip).
    – Bernard
    Jul 10, 2014 at 19:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .