bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #43122] texi2dvi does not compile enough times to get toc


From: Vincent Belaïche
Subject: Re: [bug #43122] texi2dvi does not compile enough times to get toc
Date: Tue, 08 Sep 2015 23:44:18 +0200

Salut Gavin & Karl,

Answers embedded below...

Le 05/09/2015 00:30, Gavin Smith a écrit :
>> So from the above, I think that with MikTeX, yes it is working, but this
>> is not because of your patch, but thanks to some MikTeX trick which I
>> don't know. This is why I am saying that your patch is not working, I am
>> meaning that it is not working *PER SE*.
>
> I see. Could you try it with an @include of another file along with
> --tidy? MikTeX finds files in the build directory, probably because
> texi2dvi has changed to that directory, so it might not be able to
> find files in the original directory, if it's not using TEXINPUTS.

I have tried that, I placed a file dummy_inc.texi in the same dir as
dummy.texi, dummy_inc.texi contains a single line with a flag DUMMY-SONG
definition which is used in the main file dummy.texi.

Now, when I compile, MikTeX could not find dummy_inc.texi, I had to enter
manually the path ../../../dummy_inc.texi, which confirms that the
current directoy for MikTeX compilation is ./dummy.t2d/pdf/build


>
> Something I read said that MikTeX uses semicolons as a path separator
> sometimes, but you have colons in your log. Could you try changing
> path_sep to ; to see if that makes a difference?
>
> Do you know where there is official documentation of where MikTeX
> looks for input files?
>

I have attached to this email the MikTeX manual as installed with my
MikTeX 2.9. Please have a look at sections 3.2.{7,8,9}

Also look at chapter 8: in fact MikTeX knows the TEXINPUTS environment
variable. The problem is you need to make some directory path list
translation from MSYS path format to MSWindows path format for MikTeX to
be able to use them.

One way to do that path translation would be as in the
test_dirlist_translation script attached to this email.

>>
>> Tell me where I am wrong...
>>
>>
>> There is another issue, dummy.texi is not run_tex'ed with the
>> catcode_special for ~, this is because the make_openout_test has
>> caused catcode_special to go to false.
>>
>> On the other hand when openout.tex is run_tex'ed, there is some
>> special catcode for ~, which is useless.
>
> I thought it was simpler just to leave the catcode for ~ alone, as ~
> isn't used in the test.
>
>> ======================================================================
>>   save_catcode_special=$catcode_special
>>   catcode_special=false
>>   make_tex_cmd
>>   catcode_special=$save_catcode_special
>> ======================================================================
>
> That looks good to me.
>
>> Anyway, I still prefer that we should solve it in texinfo.tex,
>> because that would allow using easily latexmk instead of texi2dvi to
>> do the job. I like texi2dvi, but I think that it makes texinfo more
>> valuable to people if we offer some diversity in tools.
>
> What does latexmk do, and how would changing texinfo.tex help it to be
> used?

latexmk finds the produced aux file thanks to the recorder. It then
makes some md5sum (or something like that) to get a signature of each of
these files. If the aux files are created or refereshed (signature
changed) then it makes compilation again. Well, it is more complex than
that, e.g. non conventional recorder file names, like latex.fls or
pdflatex.fls are supported.

You can find user documentation and code for latexmk here:
http://www.ctan.org/pkg/latexmk

Here is a direct link to the manual:
http://ftp.oleane.net/pub/CTAN/support/latexmk/latexmk.pdf

And the script itself is there:
http://ctan.mines-albi.fr/support/latexmk/latexmk.pl

latexmk is delivered with TeXLive.

I had written a simple rc file for latexmk to be able to comple Texinfo
file, it is attached to this email as texinfo-latexmkrc. My initial
intent was to compile completely metafont-for-beginners.texi, and that
worked properly, as the only problem was the tocand there was no
indices. However, I tried it on another file with indices, and it failed
to call texindex for generating the indices, even though I made some
update of the rc file. I have sent an email to John Collins, cc to you
about hat.



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
http://www.avast.com

Attachment: dummy.tgz
Description: Binary data

Attachment: miktex.pdf
Description: Adobe PDF document

#/bin/sh
        
if [ `uname -o` == Msys ]; then
    dirlist_translator=msys_dirlist_translator
    translated_file_sep=";"
else
    dirlist_translator=identity
    translated_file_sep=:
fi
    
identity ()
{
   echo $1
}

verbose ()
{
  echo $1 > /dev/stderr
}

msys_dirlist_translator ()
{
    save_IFS=$IFS
    IFS=:
    translation=""
    for w in $1; do
      IFS=$save_IFS
      if [ -d $w ]; then
        save_dir=`pwd`
        cd $w
        translated_dir=`pwd -W`
        cd $save_dir
        if [ -z $translation ]; then
          translation="$translated_dir"
        else
          translation="$translation;$translated_dir"
        fi
      else
        verbose "Non existing directory !!"
      fi
    done
    IFS=$save_IFS
   echo $translation
}

TEXINPUTS=".:/c/Programmes/installation/texinfo-install/trunk/util/"
TEXINPUTS=`$dirlist_translator "$TEXINPUTS"`

echo $TEXINPUTS
# Local Variables:
# sh-basic-offset: 2
# sh-indentation: 2
# mode: sh
# End:
# Copyright 2014 Vincent Belaïche <address@hidden>
warn q!
+- latexmkrc for Texinfo -------------------------------------------------+
|   Warning: -c/-C option won't clean user defined index auxiliary files, |
|   for easier ``manual'' cleanup you can use the -auxdir option          |
|   to put them in another directory.                                     |
+-------------------------------------------------------------------------+

!;

$quote_filenames = 0;
$pdflatex = 'pdftex %O "\input" "%S"';
$latex = 'etex %O "\input" "%S"';

# Please add needed other extensions if there are other user defined indices
my $texinfo_indices = 'ky fn cp vr tp pg';

# Please add needed other extensions if there are other user defined indices
# and cleaning is made (latexmk -C, or -c option)
# Another solution is to use latexmk with -auxdir option so that all user 
defined
# indices go to some directory, then directly delete that directory for cleanup 
instead of
# using the -c option
$clean_ext .= ' ' . $texinfo_indices;
$clean_full_ext .= ' pdf toc aux';



for my $ext (split " ",$texinfo_indices){
    my $index_ext = $ext . 's';
    add_cus_dep( $ext, $index_ext, 1, $ext . '_texindex');
    add_input_ext('pdflatex', $index_ext);
    add_input_ext('latex', $index_ext);

}
sub ky_texindex 
{
    system( "texindex \"$_[0].ky\"" );
}
sub fn_texindex 
{
    system( "texindex \"$_[0].fn\"" );
}
sub cp_texindex
{
    system( "texindex \"$_[0].cp\"" );
}
sub vr_texindex
{
    system( "texindex \"$_[0].vr\"" );
}
sub tp_texindex
{
    system( "texindex \"$_[0].tp\"" );
}
sub pg_texindex
{
    system( "texindex \"$_[0].pg\"" );
}



# Local Variables:
# mode: perl
# End:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]