I have a memoir-class document:


which I set to oneside or twoside depending on if I want to create either an electronic copy (one side) or printable copy (two side). I have three questions:

  1. Is it possible to have it (TeXnicCenter in this case) create two PDF versions when I build (both onesided and twosided) automatically, with different file names?

  2. There is a blank page I need to add only when in twoside mode, not oneside. How can I integrate that with the above question?

  3. If I can't do the two-versions-on-build, how can I do in "if-then" that checks if it's set to oneside or twoside mode? i.e.

    if(twoside) then
        add blank page;

3 Answers 3


In general you can use the test \if@twoside to test for twoside but for conditional blank pages it normally suffices to use \cleardoublepage which acts like \clearpage in one side documents but will force a blank page if necessary to get to an odd page in twoside documents.

  • Thank you, this answers the third question perfectly. Do you know the answer to question 1)?
    – Jordan
    Apr 26, 2013 at 19:50
  • @Jordan sorry I can't help with that: that would be a setting in the editor and I've never used that one. Apr 26, 2013 at 19:53
  • @jordan: I'll write something up regarding your first question. Note that this Q&A works best if you ask a single question, since it therefore encourages a single answer, rather than a host of answers that addresses the respective parts of the original question. Another motivation for a single-question post is because you have to eventually choose "the answer that helped the most" through accepting it, which becomes conflicting when you have partial answers.
    – Werner
    Apr 26, 2013 at 19:57

1) I've been using TeXnicCenter for a while now, and I don't think that's possible. However, you can always run your file with oneside, 'save-as' it and then re-run it with twoside.

2) I've actually used a macro (\clearemptydoublepage) for avoiding a left page with numbers when using twoside option, and it won't create an extra page if using oneside:


3) Using the macro in 2 I think you won't have any trouble, or as David described, using \cleardoublepage.


I know this topic is a bit outdated, but maybe somebody else experiences the same challenge.

I have an idea for solving question one: you could just program a loop with the \forloop package and use it to run the whole code twice. Then you produce the one-sided document in the first iteration and the two-sided one in the second.

At the end of each loop, you'd need to export the compiled file as pdf. I'm relatively new to latex and don't know how to do this with code, but I guess that this is the smaller problem.

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. And do not be shy to give a partial working example.
    – Symbol 1
    Mar 9, 2015 at 15:29

You must log in to answer this question.

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