Amplitude of first harmonic of a square wave, $2/\pi$ or $4/\pi$?
It's just a question of the definition of the Fourier series coefficients. There is the complex Fourier series

$$x(t)=\sum_{n=-\infty}^{\infty}c_ne^{j2\pi nt/T}\tag{1}$$

where $c_n$ are the complex Fourier series coefficients, and $T$ is the period of the periodic function $x(t)$. For real-valued $x(t)$ you can also use the real-valued Fourier series

$$x(t)=a_0+\sum_{n=1}^{\infty}\left[a_n\cos(2\pi nt/T)+b_n\sin(2\pi nt/T)\right]\tag{2}$$

with

$$a_0=c_0,\quad a_n=2\text{Re}\{c_n\},\quad b_n=-2\text{Im}\{c_n\}\tag{3}$$

For a $T$-periodic square wave with duty cycle of $50\%$ and amplitude $1$ you get

$$c_n=\begin{cases}\frac{2}{jn\pi},\quad n\text{ odd}\\0,\quad n\text{ even}\end{cases}\tag{4}$$

From $(3)$ you get

$$a_n=0,\quad b_n=\begin{cases}\frac{4}{n\pi},\quad n\text{ odd}\\0,\quad n\text{ even}\end{cases}\tag{5}$$

So if you only use positive frequencies in your series respresentation, as in $(2)$, your get a factor of $4/\pi$ for the first harmonic, whereas if you use positive as well as negative frequencies, as in $(1)$, you get a factor of $2/j\pi$ for $n=1$ and for $n=-1$.

Your representation as a Fourier transform corresponds to $(1)$, where for each frequency component you get a Dirac impulse in the frequency domain. Since that Dirac comb has components at positive as well as at negative frequencies, the amplitudes equal $2/n\pi$:

$$X(f)=\sum_{n=-\infty}^{\infty}c_n\delta\left(f-\frac{n}{T}\right)\tag{6}$$