Fascinating stuff - so what is the simple trig underpinning it?
Basically if you know the precise location of two points (which you will have already surveyed), and have measured the distance between them you can then use the cosine rule to calculate the angle to one of the next points you wish to mark and the tangent rule to calculate the angle to the other (or you can use the cosine rule for both if you are able and willing to move between the two reference points).
Once you have calculated the angle and distances you then use a thodolyte to measure both the angle and the distance with the help of your assistant, who you guide to the locations where he will place markers that become the known points from which you will calculate the next steps.
The maths is fairly straight forwards however accuracy is critically important as even a small error (especially near the start) can accumulate as you go. To reduce the risk it was normal practice to remeasure from the new points back to the reference point to make sure the angles were also correct in that direction. The skill of the surveyor was not in his maths skills but in his accuracy and attention to detail.
With a tunnel - typically the navvies would try to dig in a straight a line as possible, after a certain distance they would pause and the surveyor would place new markers in the freshly dug section which the navvies would use to realign their digging to correct the inevitable tendency to drift off track.