6

I have a memoir-class document:

\documentclass[oneside,letterpaper]{memoir}

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;
    end
    
0
5

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.

3
  • Thank you, this answers the third question perfectly. Do you know the answer to question 1)?
    – Jordan
    Apr 26 '13 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 '13 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 '13 at 19:57
0

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:

\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}}

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

0

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.

1
  • 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 '15 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.