The maskless photolithography method direct laser writing (DLW) can achieve sub-100-nm writing resolution if the photoresist is kept well on the plane of best focus of the optical system. Deviation from this plane leads to larger than intended or loss of developed areas. Here we present an approach to account for this problem through a Bessel-Gauss beam for the exposure.