Underwater gliders are vehicles characterized by their persistence as they allow missions extremely long requiring very low power consumption. However, this also implicates that they are much more affected by adverse environmental conditions during navigation, making the use of path planning a crucial tool for this vehicles. In this work we analyse the problem of following a desired trajectory, also known as hold-track navigation. We propose a solution based on optimizations that offers promising results on simulation, both for synthetic and real ocean currents. The scheme is flexible and can be adapted to different sub-problems.