[...]
On 25 June 2012 11:00, Lex Trotman <[email protected]> wrote:
> On 25 June 2012 06:11, Stan Marée <[email protected]> wrote:
>> Two basic asciidoc files (main1.asc and main2.asc) include a third
>> (./extra/equation.asc) with a latex block equation.
>> The only difference between main1.asc and main2.asc is that main1.asc starts
>> with 'title\n-----\n'.
>>
>> asciidoc -v -a data-uri -b xhtml11 main1.asc: FAILS TO INCLUDE PIC
>> CORRESPONDING TO EQUATION.
>> asciidoc -v -a data-uri -b xhtml11 main2.asc: WORKS FINE.
>>
>
> Hi,
>
> Failing is the "correct" behaviour, the latex filter doesn't properly
> support being executed in the context of files included in
> subdirectories, it always puts its output png file in the base
> document dir, but the image block that tries to import the png expects
> it to be in the subdirectory.
>
>
@Stuart,
I think the problem seems to be that the {indir} in the
[latex-filter-style] section of latex-filter.conf is substituted when
the filter is loaded and so it is the document directory, but the
{indir} in [image-blockmacro] is substituted when that template is
expanded during processing of the included file in a subdirectory and
so is the subdirectory. So the two occurrences of {indir} are not the
same and the image encoding fails.
Really both should use something that is constant {docdir} or similar.
But [image-blockmacro] can't simply be changed as it will break many
existing documents. Similarly delaying substitution in the filter
would allow both commands to use the subdirectory, but would not be
backward compatible and again may break current documents.
I don't have a simple solution that is backward compatible, and I
wonder how many other filters are subject to similar problems?
@Anibal,
As you can see above, it may not be that simple to fix.
One interim "solution" if you can't put everything in one directory,
is to pre-process the latex to png and include the processed result
with image:: macros. The filter command latex2png can be run by
itself, see the filter documentation and latex2png --help for more
info. If the latex was always in its own files (say with a .asclatex
extension) a script could easily process all those files and generate
the png. At a later time the image:: macros could be replaced with
include:: to include the original.
Cheers
Lex
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.