Skip to contents

This function is used to parse the given chunk options and build the drawio command that will be executed to export the diagram as an image.

Usage

parse.options(options)

Arguments

options

The list of chunk options. Please see in the details for a list of accepted options.

Value

exe The path to the draw.io executable binary.

args The list of command line arguments to be passed to drawio.

output The path to the image that will result from the execution of `exe

args` (including the cache directory, if it was specified).

Details

This function is executed by the drawio engine and should normally not be used directly by the user.

List of accepted options: (please see drawio's help for more details)

src

Path to the source diagram. Mandatory argument, must not be null nor empty.

format

Format of the output image. Either "pdf", "png", "jpg", "svg", "vsdx", or "xml". If unspecified, a default value is set, depending on the current document output: "pdf" is used for LaTeX, "svg" for HTML, and "png" for other formats.

engine.path

Path to the draw.io executable. If unspecified, the default value depends on the OS (please see drawio.default.path for details).

engine.opts

Optional arguments sent as-is to drawio. Please see the drawio documentation for a list of possible arguments.

crop

Whether to crop the result image or not. (Default: yes)

transparent

Whether to set a transparent background or a blank background. Can only be used if `format` is "pdf".

border

Width of the border surrounding the diagram. (Default: 0)

page.index

Which page to export from the source diagram, if multiple pages are available.

page.range

Similar to `page.index`, but allowing for multiple pages. Can only be used if `format` is "pdf".

fig.path

Path to the figure directory. By default, resulting images are placed in the current working directory.