# How can I place conditional statements in a LaTeX file dependant on how I'm processing it? [duplicate]

Possible Duplicate:
Detect which TeX engine is used
Conditional typesetting / build

I'm currently writing a document in LaTeX (using the article documentclass for now, thinking about switching to memoir later on).

I'm using the navigator package to generate additional meta-fields in the resulting pdf and I use pdflatex to generate my PDF.

However, when I use latex to generate a .dvi I do get errors because the meta-fields for pdf don't make sense now.

How can I put some conditional statements in the file so that certain sections would be included or excluded depending on what command is used to generate (or what target format is being generated)?

Here are the statements that now I have to manually comment out to compile my document with latex.

\usepackage{navigator}
\setparameter navigator:
author = Andy
title = Agile
\par

If this is a FAQ/stupid question please point me in the right direction.

-

## marked as duplicate by lockstep, Peter Grill, Mico, Stefan Kottwitz♦Mar 18 '12 at 18:49

–  Peter Grill Mar 17 '12 at 19:14
Just out of curiosity, why do you need what appears to be a duplicate workflow (Ie pdf and dvi)? –  Brent.Longborough Mar 17 '12 at 19:16
Because if I leave those uncommented and run 'latex' I get errors. And I want duplicate workflow, because I want to process this document also into plain text with dvi2txt or something like this. –  Andy Mar 17 '12 at 19:38