Not sure what an MWE would be for this question. Basically I have a script written in XeLaTeX, one that includes dialogue, stage directions, and a lot of additional information. What I would like is some way to produce just a dialogue output for each of the main characters (there are 4). I am open to any method, either within XeLaTeX or in post-processing after a PDF is produced.

I have tried doing this with the ifthenelse package, but the logic gets convoluted very quickly. I have searched for a way to just send selected text to separate files, but I haven't located anything that will do that.

  • 1
    this is just about impossible to answer unless you provide an example. It completely depends on the markup you are using for the individual characters. if it's \mark{asked this}\david{replied} then to get me not you then \def\mark#1{} will discard all your text. If the markup is different, the answer is different Jul 12, 2020 at 18:04
  • An example is tough, the file is very long, and there are a number of very different "environments". However, your comment sparks a possibility in my mind of just including a set of simple newcommand(s) that either just pass through the content, or nullify it. Interesting! Jul 13, 2020 at 16:39
  • please don't edit solutions into the question it messes up the Q&A format of the site, it's Ok to post an answer to your own question. Jul 13, 2020 at 19:43
  • Sorry, I have returned the OP to the original format and posted a solution. Jul 19, 2020 at 16:39
  • thanks voted for your answer:-) Jul 19, 2020 at 17:10

1 Answer 1


Thanks to the insightful comment of Mr. David Carlisle, I have come up with a potential solution. I will post an MWE, which may or may not be robust enough to do what I want, but perhaps some better LaTeXers than myself could add some suggestions. I would also likely need a boolean that would eliminate any non-dialogue in the first place.

As for the environments that the dialogue is in, there are basically two. One for standard dialogue that just sets the spacing to 1.3 and the text to \large, and a second that sets the spacing to 1.4, \large, but in the alltt "format". This second is for prose typesetting where line splitting is essential.





        \estragon{Nothing to be done.}
        \vladimir{I'm beginning to come round to that opinion.}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .