0

I saw a lot solutions to this questions in here, unfortunately none of them works in my case. The code below works exactly as I would expect it. For my thesis however the \setlength{\abovedisplayskip}{30pt} doesnt work at all. I tried to construct a MWE, but I can't figure out whats causing the problem, and I dont think its gonna help to paste my entire preamble and settings here.

So my question is: Is there anything to keep in mind when using \setlength{\abovedisplayskip} ? I read that empty lines before \begin{align} might cause the problem, but removing them didnt help and also I want to keep them for clarity of the document as I got tons of aligns.

Any help or hint is very much appreciated! :)

\documentclass[a4paper,12pt,bibliography=totoc,parskip=false]{scrreprt}

\usepackage{eurosym,bm,amsmath}     % Mathematische Notationen
\usepackage{amssymb,verbatim}
\usepackage{amsthm}                 % Beweise / Theorem
\usepackage{xfrac}                  % nice fracs
\usepackage{nccmath}                % mfrac
\usepackage{bbold}
\usepackage{mathtools}              % rcases

\begin{document}    


\def\mycommand{\setlength{\abovedisplayskip}{30pt}% spacing before and after align
\setlength{\belowdisplayskip}{20pt}%
\let\oldselectfont\selectfont
\def\selectfont{\oldselectfont\mycommand}

\protect\setlength{\jot}{8pt}   


\begin{proof}[Beweis von Gleichung \textit{\eqref{form:delta_n}}]
Per Definition \eqref{form:delta_1} gilt

\begin{align*}
\delta^{(n)}_k = \frac{\partial C}{\partial \hat{x}^{(n)}_k}.
\end{align*}

Nach Anwendung der Kettenregel lässt sich dieser Term als Summe über alle Neuronen $\partial x^{(n)}_l$ des Output-Layers umformulieren:

\begin{align*}
\delta^{(n)}_k = \sum_{l=1}^{m^{(n)}} \frac{\partial C}{\partial x^{(n)}_l} \frac{x^{(n)}_l}{\partial \hat{x}^{(n)}_k}.
\end{align*}

Dabei gilt $\sfrac{x^{(n)}_l}{\partial \hat{x}^{(n)}_k} =0$ für $l\neq k$, da $x^{(n)}_k = \varphi(\hat{x}^{(n)}_k)$ und somit die Aktivierung des $k$-ten Neurons auch nur von $\hat{x}^{(n)}_k$ abhängt. Dadurch fallen alle bis einen Summanden weg und die Gleichung lässt sich zu 

\begin{align*}
\delta^{(n)}_k = \frac{\partial C}{\partial x^{(n)}_k} \frac{\partial x^{(n)}_k}{\partial \hat{x}^{(n)}_k}
\end{align*}

vereinfachen. Der rechte Bruch ist gegeben durch $\varphi'(x^{(n)}_k)$ und somit erhalten wir

\begin{align*}
\delta^{(n)}_k = \frac{\partial C}{\partial x^{(n)}_k} \varphi'(x^{(n)}_k)
\end{align*}

was genau der geforderten Aussage \eqref{form:delta_1} entspricht.
\end{proof}

\end{document}
Quastiat
  • 285
  • 2
    \abovedisplayskip and its cousins are links to the font size commands, so everything say \normalsize gets executed, your change to \abovedisplayskip gets reset to the default. – daleif Sep 12 '19 at 08:23
  • BTW: what do you mean by not working at all? If I run your example I get a large gap above each align. BTW: It is not a good idea to use align for one-liners, then you never get the benefit of the space saving features of equation. – daleif Sep 12 '19 at 08:25
  • @daleif thanks I already saw your comment in here link but the suggestion posted there also doesnt change a thing. But I added it to the question. In the example above everything works fine, in my document it doesnt, not even for the first formula. I just can't reproduce a MWE thats smaller than my entire document :/ – Quastiat Sep 12 '19 at 08:29
  • Do not mess with things like \selectfont. Also I said font size not font. You need to patch \normalsize and friends. See the xpatch package and have a look in scrsize11pt.clo for how \normalsize is defined in that case – daleif Sep 12 '19 at 08:32
  • @Quastiat Please confirm what is your text font size? – MadyYuvi Sep 12 '19 at 10:35
  • 12pt. I also added my settings to the example: \documentclass[a4paper,12pt,bibliography=totoc,parskip=false]{scrreprt} – Quastiat Sep 12 '19 at 12:06

0 Answers0