I'm keeping this note here as a reminder of how much I liked to torture myself as a first-year graduate student. # VESTA 1. Load up the cell you want to stack in the z-direction 2. Go to edit > unit cell > transform and stack the cell however many times you want in the $z$ direction. 3. Export the cell to VASP POSCAR file (Cartesian Coordinates) # Vim 1. Highlight the atomic coordinates section and run: `!sort -k3n` 2. Note the coordinates of the top $N$ and bottom $M$ atoms that you want to delete then press `u` to undo the sorting 3. Search for the atoms and delete them 4. Decrement the atom counts by the number you deleted 5. Highlight the atomic coordinates section and run: `!sort -k3n`. 6. Note the coordinate of the top atom. Let's say you want 7.5 angstroms of vacuum, then you need to add `delta = 7.5 - {coordinate of top atom}` to every atom. Note down `delta` and press `u` to undo the sort 7. Highlight the atom coordinates and run `!awk -v CONVFMT=\%.11g '{print $1 " " $2 " " ($3 - $delta)}'` 8. Highlight the atomic coordinates section and run: `!sort -k3n`. 9. Note the coordinate of the last atom. Add 7.5 to it (or whatever vacuum you used) and change the size of the cell in the z-direction