summaryrefslogtreecommitdiff
path: root/support/latexmk/example_rcfiles/texinfo-latexmkrc
blob: 0f8445148546ce4393f44bef94568d85f46ea822 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Modifications 2015 Sep 9-10, John Collins
# Copyright 2014 Vincent Belaïche <vincent.b.1@hotmail.fr>

# With the settings here, latexmk can be used to process texinfo files
# (typical extension .texi) to pdf files, including the making of
# indices.  This version uses a newly documented internal routine
# of latexmk.

###!!!!!!!!!  NOTE THAT THE NAMES OF THE INDEX FILES ARE POSSIBLY
###           SUBJECT TO CHANGE IN FUTURE VERSIONS OF texinfo.
###           The configuration provided by this file was valid in
###           September 2015.  (The file texinfo.tex had version
###           2015-07-01.07.)

$quote_filenames = 1;
$pdflatex = 'internal mylatex %R %Z pdftex %O %S';
$latex = 'internal mylatex %R %Z etex %O %S';

sub mylatex {
    my $root = shift;
    my $dir_string = shift;
    my $ret = system @_;
    for my $ext (split " ",$texinfo_indices){
        my $idx = $dir_string.$root.'.'.$ext;
        my $ind = $idx.'s';
        if ( (-e $idx) && (-s $idx) ) {
            # Only make dependency on the ind-like file
            # if the idx-like file both exists and is of
            # non-zero length.  The test on the length is
            # needed because current versions of texindex
            # produce no output file if the input file is
            # of zero length.
            rdb_ensure_file( $rule, $ind );
	  }
    }
    return $ret;
}

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

$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);
    $clean_ext .= " $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\"" );
}