In general my preferred course of action in this case would be option 2
I accept the answer to my original question and ask a new question »How to solve problem X in a way compatible with my piece of code Y«
If you edit your question with additional requirements after an answer has been posted you are not unlikely to invalidate that answer.
The person who answered judged your original question worthy of an answer (and their time), so and argument could be made that they imply it is a good or interesting (or at least easy-to-answer) question that is worthy of being kept on this site for future visitors with a similar problem.
Think of it that way: The answer to your original problem might have been chosen for its simplicity and elegance. If incompatibilities in your document require a different approach, it would be unfortunate for people who don't suffer from these incompatibilities to be presented with a potentially more complicated workaround.
Related questions on Meta are When is it Kosher to edit one’s own question? and Should I ask one question with many requirements instead of many questions on same topic?. An acceptable reason for editing your question mentioned there is to provide (requested) clarification. It is not entirely clear from the outset what constitutes an acceptable clarification and what is an unacceptable edit to your question. I'm inclined to say that requested clarifications are allowed more leeway than clarifications you want to add after you have got an answer. See for example this recent question where clarification was requested in the comments and the question was edited after the first answer was posted. In that case I'd argue that the question could not be properly answered without clarification since it was missing the crucial information which bibliography package was used and an answer depends on that information. Questions that can be answered properly, however, should not be edited to include new requirements. (I'm aware that this puts initially "bad" questions into a better position with regards to later edits than questions that were good from the start and thus got a good answer quickly.)
So the general approach would be to ask a new question. Ideally linking back to the old question and mentioning that and why the answer there did not work for you. Of course you can always leave a comment on the answer first and ask nicely if there is a quick work-around before you ask a new question, but be prepared to be asked to ask a new question.