These instructions are courtesy of arco68 over at xda-developers, who is also the person behind the software downloads linked here. All credit to him/her!
Now don't be fooled by how few steps arco68's instructions have; you will need about half an hour to do this if you've not done this before, I reckon, if you want to be careful and not rush it.
As a prerequisite, download Samsung KIES and make sure that the drivers for your phone are installed correctly. Otherwise, Odin Tool will not read your S4 Mini properly.
Download the Odin tool and the ClockworkMod recovery to your Windows PC. Extract both of these archives.
Download the rootkit GT-I9195_RootKit_v2.zip to your device's SD card. Do not extract it. Place it in the root folder.
Turn off the phone. Press and hold Home, Volume Down and Power simultaneously. The phone will turn on and you will see the following screen:
Connect the USB cable. Press Volume Up. The screen changes to this:
(the fields I blurred out will say something like "Original" initially, can't quite remember)
Run the Odin tool you unzipped in step 1.
Uncheck F. Reset Time
. Click the AP
button. In the dialog that appears, select the "recovery-clockwork-6.0.3.7-serranoltexx.tar.md5" file that you extracted in step 1.
Before you continue, read this step in full because it requires quick action. First you take the phone in your hand. Then you get ready to press and hold Volume Up and Home as soon as the phone vibrates. If you're only a second too slow you'll have to repeat from step 3 (see below).
Now that you're ready to press and hold Volume Up and Home, click the Start
button in the Odin tool. It only takes a few seconds before the phone vibrates. Feel the vibration and immediately press and hold Volume Up and Home.
Once the phone shows the S4 logo with the words "recovery booting", you may release the buttons.
If you did everything right, you will see this screen:
But if you see a black screen like this:
then you've messed up – power off the phone and continue from step 3.
Using the volume up/down keys and the Home key, select "install zip", "choose zip from sdcard", then "0/", then the zip file "GT-I9195_RootKit_v2.zip" that you saved to the SD card in step 2.
The zip will be installed and you will be told that your warranty is now void (which is not necessarily the case, of course). You may now reboot and enjoy your rooted S4 Mini!
When you choose to reboot, you will be asked "ROM may flash stock recovery on boot. Fix?" I suggest you choose No because you don't really need ClockworkMod anymore (although I think I pressed "No" and ClockworkMod remains installed regardless).
For the record, the reason I'm posting this here is that I didn't even realise I got the wrong screen in step 10, so I wasted a whole hour messing around with it. But I can't post this tip on xda due to their draconian requirements for posting replies. So I thought I'd just write up instructions in such a way that others can edit them here.