Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

BXdvidriver Package

LaTeX: To specify a driver option effective only in DVI output

This single-function package enables authors to specify a global driver option (dvips, dvipdfmx, etc) which is applied only when the engine outputs a DVI file. It is useful to create special document- templates that can be compiled in both PDF-mode and DVI-mode.

System requirement

  • TeX format: LaTeX.
  • TeX engine: Anything.
  • Dependent packages:
    • ifpdf, ifluatex, ifxetex, ifvtex
    • pdftexcmds


  • *.sty → $TEXMF/tex/latex/BXdvidriver


This package is distributed under the MIT License.

The bxdvidriver Package

Package Loading


The available options are described hereafter.

Driver options

The following driver options are available:


Suppose the document begins with:


If the document is compiled with pdflatex (or xelatex, lualatex), then the package does nothing and the driver option dvipdfmx is simply ignored.

However, if the document is compiled with latex (or any other engine that outputs DVI files), then the package adds the given driver option dvipdfmx to the global option list, and makes the settings effectively the same as the following:


The driver option is globally in effect, and thus the packages graphicx and color will choose the driver for dvipdfmx.

Note. Some care must be taken when the document class itself has some driver-dependent behavior. In that case, simply loading bxdvidriver after \documentclass would leave its driver option unapplied to the document class. Instead, you must load the bxdvidriver package before \documentclass with \RequirePackage command.


Other options

This package is essentially single-function, but as side effect it also checks some integrity on driver settings:

  • whether (at most) one driver option is given;
  • whether the driver matches the (PDF-output) engine;
  • whether (at most) one graphics driver is loaded.

By default, an error is issued when any check fails. But the behavior can be changed by options.

  • check (default): Check failure issues an error.
  • nocheck: Check failure does not issue an error.


This package offers no user commands or environments. All the settings are done by package options.

Revision History

  • Version 0.2b ‹2022/06/15›
    • Adjust for HiTeX.
  • Version 0.2a ‹2017/02/13›
    • Bug fix.
  • Version 0.2 ‹2016/03/26›
    • The first public version.

Takayuki YATO (aka. "ZR")


LaTeX: To specify a driver option effective only in DVI output







No packages published