#
# AsciiDoc latex filter configuration file.
#
# Documented in latex-filter.txt in AsciiDoc distribution
# ./examples/website/ directory.
#

[latex-filter-style]
# When the filter output image is data-uri encoded write it to the indir
# (instead of the outdir) so that encoder can find it.
ifndef::data-uri[]
latex-style=template="latex-block",subs=(),posattrs=("style","target","dpi"),filter='latex2img.py -m{verbose? -v}{dpi? -D {dpi}}{imgfmt? -f {imgfmt}} -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -'
endif::data-uri[]
ifdef::data-uri[]
latex-style=template="latex-block",subs=(),posattrs=("style","target","dpi"),filter='latex2img.py -m{verbose? -v}{dpi? -D {dpi}}{imgfmt? -f {imgfmt}} -o "{indir={outdir}}/{imagesdir=}{imagesdir?/}{target}" -'
endif::data-uri[]

[blockdef-open]
template::[latex-filter-style]

[blockdef-listing]
template::[latex-filter-style]

[paradef-default]
template::[latex-filter-style]

[latex-block]
template::[latex-filter-image-blockmacro]

[latex-filter-image-blockmacro]
# Synthesize missing target attribute for filter generated file names.
# The tag split | ensures missing target file names are auto-generated
# before the filter is executed, the remainder (the [image-blockmacro])
# is executed after the filter to ensure data URI encoding comes after
# the image is created.
# This template replaces the filter-image-blockmacro template so that
# we can generate SVG images from LaTeX code.
{target%}{counter2:target-number}
{imgfmt%}{set2:imgfmt:{latex-imgfmt=png}}
{target%}{set2:target:{docname}__{target-number}.{imgfmt}}
|
template::[image-blockmacro]
