### Lua tikz

The TikZ driver is one output mode of the generic Lua terminal.

Syntax:

       set terminal lua tikz

        {latex | tex | context}
        {color | monochrome}
        {nooriginreset | originreset}
        {nogparrows | gparrows}
        {nogppoints | gppoints}
        {picenvironment | nopicenvironment}
        {noclip | clip}
        {notightboundingbox | tightboundingbox}
        {background "<colorpec>"}
        {size <x>{unit},<y>{unit}}
        {scale <x>,<y>}
        {plotsize <x>{unit},<y>{unit}}
        {charsize <x>{unit},<y>{unit}}
        {font "<fontdesc>"}
        {{fontscale | textscale} <scale>}
        {dashlength | dl <DL>}
        {linewidth | lw <LW>}
        {nofulldoc | nostandalone | fulldoc | standalone}
        {{preamble | header} "<preamble_string>"}
        {tikzplot <ltn>,...}
        {notikzarrows | tikzarrows}
        {rgbimages | cmykimages}
        {noexternalimages|externalimages}
        {bitmap | nobitmap}
        {providevars <var name>,...}
        {createstyle}
        {help}

For all options that expect lengths as their arguments they will default to 'cm' if no unit is specified. For all lengths the following units may be used: 'cm', 'mm', 'in' or 'inch', 'pt', 'pc', 'bp', 'dd', 'cc'. Blanks between numbers and units are not allowed.

'monochrome' disables line coloring and switches to grayscaled fills.

'originreset' moves the origin of the TikZ picture to the lower left corner of the plot. It may be used to align several plots within one tikzpicture environment. This is not tested with multiplots and pm3d plots!

'gparrows' use gnuplot's internal arrow drawing function instead of the ones provided by TikZ.

'gppoints' use gnuplot's internal plotmark drawing function instead of the ones provided by TikZ.

'nopicenvironment' omits the declaration of the 'tikzpicture' environment in order to set it manually. This permits putting some PGF/TikZ code directly before or after the plot.

'clip' crops the plot at the defined canvas size. Default is 'noclip' by which only a minimum bounding box of the canvas size is set. Neither a fixed bounding box nor a crop box is set if the 'plotsize' or 'tightboundingbox' option is used.

If 'tightboundingbox' is set the 'clip' option is ignored and the final bounding box is the natural bounding box calculated by tikz.

'background' sets the background color to the value specified in the 4#4colorpec5#5 argument. 4#4colorspec5#5 must be a valid color name or a 3 byte RGB code as a hexadecimal number with a preceding number sign ('#'). E.g. '#ff0000' specifies pure red. If omitted the background is transparent.

The 'size' option expects two lenghts 4#4x5#5 and 4#4y5#5 as the canvas size. The default size of the canvas is 12.5cm x 8.75cm.

The 'scale' option works similar to the 'size' option but expects scaling factors 4#4x5#5 and 4#4y5#5 instead of lengths.

The 'plotsize' option permits setting the size of the plot area instead of the canvas size, which is the usual gnuplot behaviour. Using this option may lead to slightly asymmetric tic lengths. Like 'originreset' this option may not lead to convenient results if used with multiplots or pm3d plots. An alternative approach is to set all margins to zero and to use the 'noclip' option. The plot area has then the dimensions of the given canvas sizes.

The 'charsize' option expects the average horizontal and vertical size of the used font. Look at the generated style file for an example of how to use it from within your TeX document.

'fontscale' or 'textscale' expects a scaling factor as a parameter. All texts in the plot are scaled by this factor then.

'dashlength' or 'dl' scales the length of dashed-line segments by 4#4DL5#5, which is a floating-point number greater than zero. 'linewidth' or 'lw' scales all linewidths by 4#4LW5#5.

The options 'tex', 'latex' and 'context' choose the TeX output format. LaTeX is the default. To load the style file put the according line at the beginning of your document:

     \input gnuplot-lua-tikz.tex    % (for plain TeX)
     \usepackage{gnuplot-lua-tikz}  % (for LaTeX)
     \usemodule[gnuplot-lua-tikz]   % (for ConTeXt)

'createstyle' derives the TeX/LaTeX/ConTeXt styles from the script and writes them to the appropriate files.

'fulldoc' or 'standalone' produces a full LaTeX document for direct compilation.

'preamble' or 'header' may be used to put any additional LaTeX code into the document preamble in standalone mode.

With the 'tikzplot' option the '2#2path plot' command will be used instead of only '2#2path'. The following list of numbers of linetypes (4#4ltn5#5,...) defines the affected plotlines. There exists a plotstyle for every linetype. The default plotstyle is 'smooth' for every linetype 5#5= 1.

By using the 'tikzarrows' option the gnuplot arrow styles defined by the user will be mapped to TikZ arrow styles. This is done by 'misusing' the angle value of the arrow definition. E.g. an arrow style with the angle '7' will be mapped to the TikZ style 'gp arrow 7' ignoring all the other given values. By default the TikZ terminal uses the stealth' arrow tips for all arrows. To obtain the default gnuplot behaviour please use the 'gparrows' option.

With 'cmykimages' the CMYK color model will be used for inline image data instead of the RGB model. All other colors (like line colors etc.) are not affected by this option, since they are handled e.g. by LaTeX's xcolor package. This option is ignored if images are externalized.

By using the 'externalimages' option all bitmap images will be written as external PNG images and included at compile time of the document. Generating DVI and later postscript files requires to convert the PNGs into EPS files in a seperate step e.g. by using ImageMagick's convert. Transparent bitmap images are always generated as an external PNGs.

The 'nobitmap' option let images be rendered as filled rectangles instead of the nativ PS or PDF inline image format. This option is ignored if images are externalized.

The 'providevars' options makes gnuplot's internal and user variables available by using the '2#2gpgetvar{4#4var name5#5}' commmand within the TeX script. Use gnuplot's 'show variables all' command to see the list of valid variables.

The 4#4fontdesc5#5 string may contain any valid TeX/LaTeX/ConTeXt font commands like e.g. '2#2small'. It is passed directly as a node parameter in form of `"`font={4#4fontdesc5#5}`"`. This can be 'misused' to add further code to a node, e.g. '2#2small,yshift=1ex' or ',yshift=1ex' are also valid while the latter does not change the current font settings. One exception is the second argument of the list. If it is a number of the form 4#4number5#5{unit} it will be interpreted as a fontsize like in other terminals and will be appended to the first argument. If the unit is omitted the value is interpreted as 'pt'. As an example the string '2#2sffamily,12,fill=red' sets the font to LaTeX's sans serif font at a size of 12pt and red background color. The same applies to ConTeXt, e.g. '2#2switchtobodyfont[iwona],10' changes the font to Iwona at a size of 10pt. Plain TeX users have to change the font size explicitly within the first argument. The second should be set to the same value to get proper scaling of text boxes.

Strings have to be put in single or double quotes. Double quoted strings may contain special characters like newlines '2#2n' etc.