I don't have a specific recipe, just a suggestion. Many margaritas that are made from scratch use supervine sugar oar simple syrup as a sweetener. Rosemary is a very strong herb, you could probably infuse some simple syrup with it. Adding that to the tequila, lime juice and orange liqueuer of your choice would probably dilute the rosemary in the simple syrup enough so that it did not overpower the drink. You'd probably have to play around a bit with the proportions of rosemary to sugar and water in the simple syrup until you got it the way you wanted it.