$$ \begin{aligned} &{\displaystyle \lim_{x\to1}\left(x-1\right)\tan\left(\frac{\pi x}2\right)}\to\small{\begin{bmatrix} &t=x-1&\\ &t\to0& \end{bmatrix}}\to{\displaystyle \lim_{t\to0}t\cdot\tan\left(\frac{\pi t}2+\frac{\pi}2\right)}=-{\displaystyle\lim_{t\to0}t\cdot\cot\left(\frac{\pi t}2\right)}=\\ \\ &=-{\displaystyle\lim_{t\to0}t\frac{\cos\left(\frac{\pi t}2\right)}{\sin\left(\frac{\pi t}2\right)}}=-{\displaystyle\lim_{t\to0}\frac{\cos\left(\frac{\pi t}2\right)}{\sin\left(\frac{\pi t}2\right)}\cdot\frac{\frac{\pi}{2}t}{\frac{\pi}2}}=-{\displaystyle\lim_{t\to0}\frac{2\cos\left(\frac{\pi t}2\right)}{\pi}}\cdot1=-\frac{2}{\pi}\,. \end{aligned}$$