### 46.4 Running DITA2Map

You must run DITA2Map from a command line, in a Windows Command Prompt window. DITA2Map looks for a configuration file in the current directory. However, a configuration file is optional. If you are satisfied with default values for most configuration settings, you can specify the rest with command-line switches.

To use dita2map.exe to generate a .ditamap file from a DITA topic file:

1. Open a Windows Command Prompt window.
2. Navigate to the directory where you want to use the map file that DITA2Map produces, and where an optional DITA2Map configuration file (dita2map.ini) or DITA2Go project configuration file is located.
3. Type a command of the following form (all on one line):

       dita2map [-v] [-t "Map Title"] [-d "D:\path\to\DTDs"] [-i inifile.ini] [-o mapfile.ditamap] topicfile.dita

   where the switches specify the following:

   -v | Verbose command-line output.
   -t | Content of the <title> element for the map, enclosed in double quotes.
   -d | Relative or absolute path to local DITA DTDs, enclosed in double quotes.
   -i | Name of a configuration file to use; must be in the current directory.
   -o | Name of the map file to produce.

4. Press Enter.

All the command-line arguments to dita2map.exe are optional except the name of the DITA topic file from which to generate the map. You can include a path for topicfile. The generated topicrefs use the name of the topic file exactly as you specify it on the command line, including any path. Links in the topicrefs are all relative to the directory where DITA2Map is run. This is generally not the same directory where you run DITA2Go, because that is the output directory, which is usually different from the input directory. This means you should run dita2map.exe from the DITA2Go directory, which is where you want to use the .ditamap file DITA2Map produces.

If you run dita2map.exe without the -o switch, the map file will have the same name as the input topic file, except with extension .ditamap.

By default, dita2map.exe produces a log file called DITA2map_log.txt; see §46.3.4 Specifying logging options.

Previous Topic: 46.3.5 Specifying map options for DITA2Map

Next Topic: VIII. Reference

Parent Topic: 46. Creating a map with DITA2Map

Sibling Topics:

46.1 Understanding how DITA2Map works

46.2 Setting up a DITA2Map project

46.3 Specifying DITA2Map configuration options