Fux served Leopold I until his death, and two more Habsburg emperors after that: Joseph I, and Charles VI, both of whom continued to employ him in high positions in the court. Fux was famous as a composer throughout this period, and stood out among his contemporaries as the highest ranking composer in the Holy Roman Empire. However, this renown gradually became eclipsed later in the 18th century as the Baroque style died out. Although his music until recently never regained favor, his mastery of counterpoint influenced countless composers through his treatise "Gradus ad Parnassum" (1725). Haydn largely taught himself counterpoint by reading it and recommended it to the young Beethoven. Mozart had a copy of it that he annotated.