summaryrefslogtreecommitdiff
path: root/support/tex-it/texitrc.unx
blob: 1296c99db88e0264102227175b57ed1400596c90 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
########################################################################;
## PLEASE REMEMBER THAT THIS ISN'T REALLY A PERL FILE.  IT'S ACTUALLY ##;
## READ AND "EVAL"ED ON A LINE BY LINE BASIS.  THE EVALUATOR ACCUM-   ##;
## ULATES LINES UNTIL IT FINDS ONE THAT ENDS IN A SEMICOLON.  USE     ##;
## COMMENT CHARACTERS TO PROTECT SEMICOLONS IN COMPOUND STATEMENTS AND##;
## SEMICOLONS AT THE END OF COMMENTS TO AVOID ACCUMULATING A BUNCH OF ##;
## COMMENTS INTO A STATEMENT.  MOST OF THE TIME, PERL SEEMS TO "DO THE##;
## RIGHT THING", BUT IT DOESN'T HURT TO BE CAREFUL.                   ##;
########################################################################;
## SEE THE COMMENT FOR THE 'require_hack' SUBROUTINE IN texit.pl FOR  ##;
## AN EXPLANATION OF THIS UNFORTUNATE BEHAVIOR.  IT REALLY ISN'T MY   ##;
## FAULT, HONEST!                                                     ##;
########################################################################;
#                                                                       ;
# The .texitrc file that I use on my Unix box at work                   ;
#                                                                       ;
# I like to delete a lot more files...                                  ;

@cleanup_latex = ('aux','log','blg','ilg','ind','idx','bbl','ps');

@latex_rules = (
  '$changed = 1 if &changed($TEXFILEPATH . $TEXFILENAME . ".bbl");',
  '$changed = 1 if &changed($TEXFILEPATH . $TEXFILENAME . ".toc");',
  '$changed = 1 if &changed($TEXFILEPATH . $TEXFILENAME . ".lot");',
  '$changed = 1 if &changed($TEXFILEPATH . $TEXFILENAME . ".lof");'
);

# Ask me about deleting those files on exit..                           ;
$CLEANONEXIT = 1;

# Add some local printers...some PostScript, a PostScript @ 600dpi      ;
# and a special printer to demonstrate how TeXit can be setup to ask    ;
# for options.                                                          ;
#                                                                       ;
$PRQUEUE{"oos"}     = "ps";
$PRQUEUE{"joshua"}  = "ps";
$PRQUEUE{"xerox1"}  = "ps";
$PRQUEUE{"woper"}   = "ps600";
$PRQUEUE{"qtest"}   = "psq";

$DVICMD{"psq"}      = $DVICMD{"ps"};
$DVIOPT{"psq"}      = $DVIOPT{"ps"};
$DVIQUERY{"psq"}    = "Additional DVI options? ";

$DVICMD{"ps600"}    = "dvips %o %d";
$DVIOPT{"ps600"}    = "-Pwoper";

$PRINTCMD{"oos"}    = "lpr %o %s.ps";
$PRINTOPT{"oos"}    = "-Poos";

$PRINTCMD{"joshua"} = "lpr %o %s.ps";
$PRINTOPT{"joshua"} = "-Pjoshua";

$PRINTCMD{"xerox1"} = "lpr %o %s.ps";
$PRINTOPT{"xerox1"} = "-Pxerox1 -K2";

$PRINTCMD{"woper"}  = "lpr %o %s.ps";
$PRINTOPT{"woper"}  = "-Pwoper";

$PRINTCMD{"qtest"}  = $PRINTCMD{"oos"};
$PRINTOPT{"qtest"}  = $PRINTOPT{"oos"};
$PRINTQUERY{"qtest"}= "Additional lpr options? ";
$PRINTCONFIRM{"qtest"} = "no";

# Rather than having two options, dvitty and Xdvi, let's switch between ;
# them based on the terminal type...actually, just as an example, let's ; 
# make the test even more complicated:                                  ;
#                                                                       ;
#  - run xdvi if TERM=xterm                                             ;
#  - run dvgt if we're on a Sparc and not an xterm                      ;
#  - run dvi2tty if we're not on a Sparc or an xterm                    ;
#                                                                       ;
# This code assumes that your login script sets $HOSTTYPE and $TERM...  ;
#                                                                       ;
if ($ENV{"TERM"} eq "xterm") {
    $VIEWCMD = '$VIEW %o %d >/dev/null 2>1 &';	# run xdvi in the background...
} elsif ($ENV{"HOSTTYPE"} eq "sparc") {
    $VIEW = "dvigt";		# avoid end of expr
} else {
    $VIEW = "dvi2tty";		# avoid end of expr
};

# Let's make sure we can find the previewer and turn off the option if  ;
# we can't.  Print a warning message in that case too...                ;
#                                                                       ;
if (&find_on_path ($ENV{"PATH"}, $VIEW) eq "") {
    print "*** Can't find previewer ($VIEW) on path.  "; # 
    print "Viewing disabled. ***\n"; # 
    delete $CMDTEST{$ViewReply}; # 
    delete $CMDPROMPT{$ViewReply}; # 
};

# Uncomment this code if you _always_ want a choice for dvi2tty instead ;
# of using the switch above.  For example, if you want dvi2tty as a choice ;
# even if you are running on an Xterm.                                  ;
#                                                                       ;
#$DVITTY      = "/exp/rcf/share/tex/bin/dvi2tty";
#$DVITTYCMD   = "$DVITTY %o %d";
#$DvittyReply = "dvi2[tty]";
#$CMDPROMPT{$DvittyReply} = '&run("$DVITTYCMD", "$opts"); $REASK;';
#$CMDTEST{$DvittyReply}   = '"$DVITTY" && -x "$DVITTY" && -r &auxfile("dvi")';

# Setting up dvips as a command...;
#$DVIPS      = "/usr/local/bin/dvips";
#$DVIPSCMD   = "$DVIPS -o %s.ps %d";
#$DvipsReply = "dvi[ps]";
#$CMDPROMPT{$DvipsReply} = '&run("$DVIPSCMD", "$opts"); $REASK;';
#$CMDTEST{$DvipsReply}   = '"$DVIPS" && -x "$DVIPS" && -r &auxfile("dvi")';

# Adding a query printer option...;
#
$LpqReply = "[q]uery printer";
$CMDPROMPT{$LpqReply} = '&run("lpq -P%o", $opts); $REASK;';
$CMDTEST{$LpqReply}   = '';

# Delete Ghostview...                                                   ;
#                                                                       ;
delete $CMDPROMPT{$GhostviewReply};
delete $CMDTEST{$GhostviewReply};

# Default action when hitting Enter after TeXing is Viewing...          ;
#                                                                       ;
$DEFAULTCMD{$TeXReply} = $ViewReply;

# Add a new command which runs TeX and then automatically runs View...  ;
#                                                                       ;
$TeXandViewReply = "[T]eX & View";
$CMDPROMPT{$TeXandViewReply} = $CMDPROMPT{$TeXReply};
$CMDTEST{$TeXandViewReply} = $CMDTEST{$TeXReply};
$AUTOCMD{$TeXandViewReply} = $ViewReply;
$AUTOOPT{$TeXandViewReply} = "";

# let ! run any command, but don't bother to show the prompt...The fact ;
# that there are two !'s in this example is coincidence, they are       ;
# unrelated.                                                            ;
#                                                                       ;
$RunCommand = "![!] run command";
$CMDPROMPT{$RunCommand} = '&run("$opts",""); $REASK;';
$CMDTEST{$RunCommand}   = '';

# Add an edit command.  This is kind of funky because we want to edit   ;
# the master TeX file if no option is given, but edit the file specified;
# if a file is given...                                                 ;
# We get the editor from the "EDITOR" environment variable or use emacs.;
# This option is hidden because I never use it (the joys of an Xterm,   ;
# I guess ;-).  It's included just because it's an interesting example. ;
#                                                                       ;
$EditCommand = "![e]dit a file";
$EDITOR = $ENV{"EDITOR"};
$EDITOR = "emacs" if $EDITOR eq "";
$CMDPROMPT{$EditCommand} = 
  'if ("\$opts" eq "") { 
     &run("\$EDITOR %o &", 
          \$TEXFILEPATH . \$TEXFILENAME . "." . \$TEXFILEEXT); #
   } else { 
     &run("\$EDITOR %o &", "\$opts"); } ';
$CMDTEST{$EditCommand} = "";