GeneralBuild two different versions of one document

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
NikoKatich
Posts: 4
Joined: Mon Mar 28, 2016 1:57 pm

Build two different versions of one document

Post by NikoKatich »

Hi there!

I have a document in LaTeX. It's a product userguide. Now I need to make another document for a branded version of the same product.
I.e. now guide name is "Big Apple: user guide" and new document will be "Big Orange: user guide". The Content of the document is the same, exept figures and product names. But it must be the same .tex file with some kind of triggers or macros or something else.

So I want to get an opportunity to configure document building.
For example: if I want to build "big apple guide" I use one variant of building (switch a key or smth.). If I want to build "big orange guide" I just set a special "orange" trigger, which changes product names and figures.

Any ideas how this can be done in LaTex?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Build two different versions of one document

Post by Johannes_B »

You could use package etoolbox and define a new boolean flag, or a toggle. Test the boolean and define macros.

Code: Select all

\ifbool{general}{%do general stuff
\renewcommand{\productname}{big orange}
}{%else, do special stuff
\renewcommand{\productname}{big apple}
}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply