File: pslatex.trm

package info (click to toggle)
gnuplot 3.7.2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,212 kB
  • ctags: 4,635
  • sloc: ansic: 43,538; cpp: 970; makefile: 883; lisp: 661; sh: 578; asm: 539; objc: 379; csh: 297; pascal: 192; perl: 138
file content (675 lines) | stat: -rw-r--r-- 19,926 bytes parent folder | download
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
/*
 * $Id: pslatex.trm,v 1.15.2.6 2002/03/17 14:10:01 broeker Exp $
 */

/* GNUPLOT - pslatex.trm */

/*[
 * Copyright 1990 - 1993, 1998
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the complete modified source code.  Modifications are to
 * be distributed as patches to the released version.  Permission to
 * distribute binaries produced by compiling modified sources is granted,
 * provided you
 *   1. distribute the corresponding source modifications from the
 *    released version in the form of a patch file along with the binaries,
 *   2. add special version identification to distinguish your version
 *    in addition to the base release version number,
 *   3. provide your name and address as the primary contact for the
 *    support of your modified version, and
 *   4. retain our contact information in regard to use of the base
 *    software.
 * Permission to distribute the released version of the source code along
 * with corresponding source modifications in the form of a patch file is
 * granted with same provisions 2 through 4 for binary distributions.
 *
 * This software is provided "as is" without express or implied warranty
 * to the extent permitted by applicable law.
]*/

/*
 * This file is included by ../term.c.
 *
 * This file supplies the terminal drivers:
 *     pslatex --latex with embedded postscript
 *     pstex   --plain TeX with embedded postscript
 *
 * AUTHORS
 *  George Phillips
 *  Russell Lang
 *  David Kotz
 * 
 * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
 */

#include "driver.h"

#ifdef TERM_REGISTER
register_term(pslatex)
register_term(pstex)
#endif

#ifdef TERM_PROTO
TERM_PUBLIC void PSLATEX_options __PROTO((void));
TERM_PUBLIC void PSLATEX_init __PROTO((void));
TERM_PUBLIC void PSLATEX_graphics __PROTO((void));
TERM_PUBLIC void PSLATEX_put_text __PROTO((unsigned int x, unsigned int y, char str[]));
TERM_PUBLIC int PSLATEX_justify_text __PROTO((enum JUSTIFY mode));
TERM_PUBLIC int PSLATEX_text_angle __PROTO((int ang));
TERM_PUBLIC void PSLATEX_reset __PROTO((void));
TERM_PUBLIC void PSLATEX_text __PROTO((void));
TERM_PUBLIC void PSLATEX_move __PROTO((unsigned int x, unsigned int y));
TERM_PUBLIC void PSLATEX_vector __PROTO((unsigned int x, unsigned int y));
TERM_PUBLIC void PSLATEX_linetype __PROTO((int lt));
TERM_PUBLIC void PSLATEX_point __PROTO((unsigned int x, unsigned int y, int number));
TERM_PUBLIC void PSLATEX_pointsize __PROTO((double size));
TERM_PUBLIC void PSLATEX_linewidth __PROTO((double width));

#define PSLATEX_XMAX (5*720)
#define PSLATEX_YMAX (3*720)

/* 10 pt char is about 10 pts high (say) */
#define PSLATEX_VCHAR (100)
/* 10 pt char is about 6 pts wide (say) */
/* I find about 5 points (output from test) - div */
#define PSLATEX_HCHAR (50)
#define GOT_PSLATEX_PROTO
#endif

#ifndef TERM_PROTO_ONLY

#ifdef TERM_BODY
static int PSLATEX_angle;
static int PSLATEX_justify;
static int PSLATEX_rotate = TRUE;
static char *PSLATEX_psfile = NULL;
static TBOOLEAN PSLATEX_useAuxFile = FALSE;	/* do we write two files? */
static FILE *PSLATEX_auxFile = NULL;
static TBOOLEAN PSLATEX_output = TRUE;	/* do we write LaTeX? */
static int PSLATEX_fontsize = 0;

struct text_command {
    int x, y, angle, justify;
    char *label;
    struct text_command *next;
};

static struct text_command *PSLATEX_labels;

TERM_PUBLIC void PSLATEX_options()
{
    if (!END_OF_COMMAND) {
	if (almost_equals(c_token, "d$efault")) {
	    ps_color = FALSE;
	    ps_solid = FALSE;
	    PSLATEX_rotate = TRUE;
	    PSLATEX_useAuxFile = FALSE;
	    c_token++;
	}
    }
    if (!END_OF_COMMAND) {
	if (almost_equals(c_token, "c$olor")
	    || almost_equals(c_token, "c$olour")) {
	    ps_color = TRUE;
	    c_token++;
	}
    }
    if (!END_OF_COMMAND) {
	if (almost_equals(c_token, "m$onochrome")) {
	    ps_color = FALSE;
	    c_token++;
	}
    }
    if (!END_OF_COMMAND) {
	if (almost_equals(c_token, "so$lid")) {
	    ps_solid = TRUE;
	    c_token++;
	} else if (almost_equals(c_token, "da$shed")) {
	    ps_solid = FALSE;
	    c_token++;
	}
    }
    if (!END_OF_COMMAND) {
	if (almost_equals(c_token, "r$otate")) {
	    PSLATEX_rotate = TRUE;
	    c_token++;
	}
    }
    if (!END_OF_COMMAND) {
	if (almost_equals(c_token, "n$orotate")) {
	    PSLATEX_rotate = FALSE;
	    c_token++;
	}
    }
    if (!END_OF_COMMAND) {
	if (almost_equals(c_token, "a$uxfile")) {
	    PSLATEX_useAuxFile = TRUE;
	    c_token++;
	}
    }
    if (!END_OF_COMMAND) {
	/* We have font size specified */
	struct value a;
	/* Copied from latex.trm */
        PSLATEX_fontsize = (int) real(const_express(&a));
	/*
	term->v_char = (unsigned int) (PSLATEX_fontsize * DOTS_PER_INCH / 72);
	term->h_char = (unsigned int) (PSLATEX_fontsize * DOTS_PER_INCH / 144);
	*/
	term->v_char = (unsigned int) (PSLATEX_fontsize * DOTS_PER_INCH / 60);
	term->h_char = (unsigned int) (PSLATEX_fontsize * DOTS_PER_INCH / 120);
    }
    /* be sure to generate an options string that PSLATEX_init understands */

    sprintf(term_options, "%s %s %s%s",
	    ps_color ? "color" : "monochrome",
	    ps_solid ? "solid" : "dashed",
	    PSLATEX_rotate ? "rotate" : "norotate",
	    PSLATEX_useAuxFile ? " auxfile" : "");
    if (PSLATEX_fontsize) {
      char fs[8] = "";
      sprintf(fs," %d", PSLATEX_fontsize);
      strcat(term_options, fs);
    }
}

TERM_PUBLIC void PSLATEX_init()
{
    char *dotIndex;

    if (strcmp(term->name, "pstex") == 0)
	PSLATEX_output = FALSE;

    /* until we know otherwise */
    PSLATEX_auxFile = NULL;

    /* dont tweak PSLATEX_useAuxFile if we decide we cannot comply
     * since this affects subsequent plots even after a set out
     * Instead, we will use PSLATEX_auxFile != NULL to indicate
     * use of an aux file
     */

    /* if there's no extension, append ".ps" */
    if (outstr && (dotIndex = strrchr(outstr, '.')) == NULL)
	dotIndex = strchr(outstr, NUL);

    /* try to open the auxiliary file for the postscript parts. */
    if (outstr && PSLATEX_useAuxFile == TRUE) {

	/* length of outstr plus ('.' or '\0') plus "ps" plus '\0' */
	PSLATEX_psfile = gp_realloc (PSLATEX_psfile,(dotIndex - outstr) + 4,"pslatex aux filename");
	if (PSLATEX_psfile) {
	    /* include period or '\0' */
	    strncpy(PSLATEX_psfile, outstr, (dotIndex - outstr) + 1);
	    /* period or '\0' is overwritten with period, and "ps" appended */
	    strcpy(PSLATEX_psfile + (dotIndex - outstr), ".ps");
	    PSLATEX_auxFile = fopen(PSLATEX_psfile, "w");
	    if (PSLATEX_auxFile  == (FILE *) NULL) {
		fprintf(stderr, "Cannot open aux file %s for output\n",
			PSLATEX_psfile);
		/* And what? Error handling????? */
	    }
	} else {
	    fprintf(stderr, "\
Cannot make PostScript file name from %s\n\
Turning off auxfile option\n", outstr);
	    PSLATEX_auxFile = NULL;
	    /* NEW! */ PSLATEX_useAuxFile = FALSE;
	}
    }
    if (PSLATEX_output) {
	fputs("\
% GNUPLOT: LaTeX picture with Postscript\n\
\\begingroup%\n\
  \\makeatletter%\n\
  \\newcommand{\\GNUPLOTspecial}{%\n\
    \\@sanitize\\catcode`\\%=14\\relax\\special}%\n\
  \\setlength{\\unitlength}{0.1bp}%\n", gpoutfile);
    } else {

	/* write plain TeX header */

	fputs("\
% GNUPLOT: plain TeX with Postscript\n\
\\begingroup\n\
  \\catcode`\\@=11\\relax\n\
  \\def\\GNUPLOTspecial{%\n\
    \\def\\do##1{\\catcode`##1=12\\relax}\\dospecials\n\
    \\catcode`\\{=1\\catcode`\\}=2\\catcode\\%=14\\relax\\special}%\n\
%\n\
\\expandafter\\ifx\\csname GNUPLOTpicture\\endcsname\\relax\n\
  \\csname newdimen\\endcsname\\GNUPLOTunit\n\
  \\gdef\\GNUPLOTpicture(#1,#2){\\vbox to#2\\GNUPLOTunit\\bgroup\n\
    \\def\\put(##1,##2)##3{\\unskip\\raise##2\\GNUPLOTunit\n\
      \\hbox to0pt{\\kern##1\\GNUPLOTunit ##3\\hss}\\ignorespaces}%\n\
    \\def\\ljust##1{\\vbox to0pt{\\vss\\hbox to0pt{##1\\hss}\\vss}}%\n\
    \\def\\cjust##1{\\vbox to0pt{\\vss\\hbox to0pt{\\hss ##1\\hss}\\vss}}%\n\
    \\def\\rjust##1{\\vbox to0pt{\\vss\\hbox to0pt{\\hss ##1}\\vss}}%\n\
    \\def\\stack##1{\\let\\\\=\\cr\\tabskip=0pt\\halign{\\hfil ####\\hfil\\cr ##1\\crcr}}%\n\
    \\def\\lstack##1{\\hbox to0pt{\\vbox to0pt{\\vss\\stack{##1}}\\hss}}%\n\
    \\def\\cstack##1{\\hbox to0pt{\\hss\\vbox to0pt{\\vss\\stack{##1}}\\hss}}%\n\
    \\def\\rstack##1{\\hbox to0pt{\\vbox to0pt{\\stack{##1}\\vss}\\hss}}%\n\
    \\vss\\hbox to#1\\GNUPLOTunit\\bgroup\\ignorespaces}%\n\
  \\gdef\\endGNUPLOTpicture{\\hss\\egroup\\egroup}%\n\
\\fi\n\
\\GNUPLOTunit=0.1bp\n", gpoutfile);
    }

    {
	unsigned int xmin_t = xoffset * PSLATEX_XMAX / PS_SC;
	unsigned int xmax_t = (xoffset + xsize) * PSLATEX_XMAX / PS_SC;
	unsigned int ymin_t = yoffset * PSLATEX_YMAX / PS_SC;
	unsigned int ymax_t = (yoffset + ysize) * PSLATEX_YMAX / PS_SC;

	if (PSLATEX_auxFile) {
	    FILE *tmp = gpoutfile;
	    gpoutfile = PSLATEX_auxFile;
	    PS_common_init(0, 1, 0, 0, 0, 
			   xmin_t, ymin_t, xmax_t, ymax_t, NULL);
	    gpoutfile = tmp;
	} else {
	    fputs("{\\GNUPLOTspecial{!\n", gpoutfile);
	    PS_common_init(0, 1, 0, 0, 0,
			   xmin_t, ymin_t, xmax_t, ymax_t, NULL);
	    fputs("}}%\n", gpoutfile);
	}
    }

    PSLATEX_angle = 0;
    PSLATEX_justify = 0;
    PSLATEX_labels = 0;
}

TERM_PUBLIC void PSLATEX_graphics()
{
    struct termentry *t = term;

    if (PSLATEX_output)
	fprintf(gpoutfile, "\\begin{picture}(%d,%d)(0,0)%%\n",
		(int) (xsize * t->xmax), (int) (ysize * t->ymax));
    else
	fprintf(gpoutfile, "\\GNUPLOTpicture(%d,%d)\n",
		(int) (xsize * t->xmax), (int) (ysize * t->ymax));

    if (PSLATEX_auxFile) {
	FILE *tmp;
	/* these are taken from the post.trm file computation
	 * of the bounding box, but without the X_OFF and Y_OFF */
	int urx = (int) (xsize * (PSLATEX_XMAX) / PS_SC + 0.5);
	int ury = (int) (ysize * (PSLATEX_YMAX) / PS_SC + 0.5);
	/* moved this code here from beginning of the function
	 * PSLATEX_psfile is only != NULL with the `auxfile' option */
	char *psfile_basename = strrchr(PSLATEX_psfile, DIRSEP1);

	if (psfile_basename)
	    psfile_basename++;
	else {
	    if (DIRSEP2 != NUL) {
		psfile_basename = strrchr(PSLATEX_psfile, DIRSEP2);
		if (psfile_basename)
		    psfile_basename++;
		else
		    psfile_basename = PSLATEX_psfile;
	    } else
		psfile_basename = PSLATEX_psfile;
	}

	/* generate special which xdvi and dvips can handle */
	fprintf(gpoutfile,
		"\\special{psfile=%s llx=0 lly=0 urx=%d ury=%d rwi=%d}\n",
		psfile_basename, urx, ury, 10 * urx);
	tmp = gpoutfile;
	gpoutfile = PSLATEX_auxFile;
	PS_graphics();
	gpoutfile = tmp;
    } else {
	fputs("{\\GNUPLOTspecial{\"\n", gpoutfile);
	PS_graphics();
    }

    PSLATEX_labels = (struct text_command *) NULL;
}

TERM_PUBLIC void PSLATEX_put_text(x, y, str)
unsigned int x, y;
char str[];
{
    struct text_command *tc;

    /* ignore empty strings */
    if (str[0] == NUL)
	return;

    tc = (struct text_command *) gp_alloc(sizeof(struct text_command), term->name);
    tc->x = x;
    tc->y = y;
    tc->label = (char *) gp_alloc(strlen(str) + 1, term->name);
    strcpy(tc->label, str);
    tc->justify = PSLATEX_justify;
    tc->angle = PSLATEX_angle;

    tc->next = PSLATEX_labels;
    PSLATEX_labels = tc;
}

TERM_PUBLIC int PSLATEX_justify_text(mode)
enum JUSTIFY mode;
{
    PSLATEX_justify = mode;
    return TRUE;
}

TERM_PUBLIC int PSLATEX_text_angle(ang)
int ang;
{
    /* rotated text is put in a short stack, and optionally uses 
     * postscript specials depending on PSLATEX_rotate */
    PSLATEX_angle = ang;
    return TRUE;
}


TERM_PUBLIC void PSLATEX_reset()
{
    if (PSLATEX_auxFile) {
	fclose(PSLATEX_auxFile);
	PSLATEX_auxFile = NULL;
    }
    if (PSLATEX_psfile) {
	free(PSLATEX_psfile);
	PSLATEX_psfile = NULL;
    }
}

TERM_PUBLIC void PSLATEX_text()
{
    struct text_command *tc;

    if (PSLATEX_auxFile) {
	FILE *tmp = gpoutfile;
	gpoutfile = PSLATEX_auxFile;
	PS_text();
	gpoutfile = tmp;
    } else {
	PS_text();
	fputs("}}%\n", gpoutfile);
    }

    if (PSLATEX_fontsize) {
      if (PSLATEX_output)
	fprintf(gpoutfile, "\\fontsize{%d}{\\baselineskip}\\selectfont\n",
		PSLATEX_fontsize);
      /* Should have an else clause here to handle pstex equivalent */
    }

    for (tc = PSLATEX_labels; tc != (struct text_command *) NULL; tc = tc->next) {
	fprintf(gpoutfile, "\\put(%d,%d){", tc->x, tc->y);
	if (PSLATEX_output &&
	    ((tc->label[0] == '{') || (tc->label[0] == '['))) {
	    fprintf(gpoutfile, "\\makebox(0,0)%s", tc->label);
	} else
	    switch (tc->angle) {
	    case 0:
		switch (tc->justify) {
		case LEFT:
		    fprintf(gpoutfile, (PSLATEX_output
					? "\\makebox(0,0)[l]{%s}"
					: "\\ljust{%s}"), tc->label);
		    break;
		case CENTRE:
		    fprintf(gpoutfile, (PSLATEX_output
					? "\\makebox(0,0){%s}"
					: "\\cjust{%s}"), tc->label);
		    break;
		case RIGHT:
		    fprintf(gpoutfile, (PSLATEX_output
					? "\\makebox(0,0)[r]{%s}"
					: "\\rjust{%s}"), tc->label);
		    break;
		}
		break;
	    case 1:		/* put text in a short stack */
		if (PSLATEX_rotate) {
		    fputs("\
%\n\\special{ps: gsave currentpoint currentpoint translate\n\
270 rotate neg exch neg exch translate}%\n", gpoutfile);
		}
		switch (tc->justify) {
		case LEFT:
		    fprintf(gpoutfile, (PSLATEX_output
					? "\\makebox(0,0)[lb]{\\shortstack{%s}}"
					: "\\lstack{%s}"),
			    tc->label);
		    break;
		case CENTRE:
		    fprintf(gpoutfile, (PSLATEX_output
					? "\\makebox(0,0)[b]{\\shortstack{%s}}"
					: "\\cstack{%s}"),
			    tc->label);
		    break;
		case RIGHT:
		    fprintf(gpoutfile, (PSLATEX_output
					? "\\makebox(0,0)[lt]{\\shortstack{%s}}"
					: "\\rstack{%s}"),
			    tc->label);
		    break;
		}
		if (PSLATEX_rotate) {
		    fputs("%\n\\special{ps: currentpoint grestore moveto}%\n", gpoutfile);
		}
	    }
	fputs("}%\n", gpoutfile);
    }

    while (PSLATEX_labels) {
	tc = PSLATEX_labels->next;
	free(PSLATEX_labels->label);
	free(PSLATEX_labels);
	PSLATEX_labels = tc;
    }

    if (PSLATEX_output) {
	fputs("\
\\end{picture}%\n\
\\endgroup\n\
\\endinput\n", gpoutfile);
    } else {
	fputs("\
\\endGNUPLOTpicture\n\
\\endgroup\n\
\\endinput\n", gpoutfile);
    }
}

TERM_PUBLIC void PSLATEX_move(x, y)
unsigned int x, y;
{
    if (PSLATEX_auxFile) {
	FILE *tmp = gpoutfile;
	gpoutfile = PSLATEX_auxFile;
	PS_move(x, y);
	gpoutfile = tmp;
    } else {
	PS_move(x, y);
    }
}


TERM_PUBLIC void PSLATEX_vector(x, y)
unsigned int x, y;
{

    if (PSLATEX_auxFile) {
	FILE *tmp = gpoutfile;
	gpoutfile = PSLATEX_auxFile;
	PS_vector(x, y);
	gpoutfile = tmp;
    } else {
	PS_vector(x, y);
    }
}


TERM_PUBLIC void PSLATEX_linetype(lt)
int lt;
{
    if (PSLATEX_auxFile) {
	FILE *tmp = gpoutfile;
	gpoutfile = PSLATEX_auxFile;
	PS_linetype(lt);
	gpoutfile = tmp;
    } else {
	PS_linetype(lt);
    }
}

TERM_PUBLIC void PSLATEX_point(x, y, number)
unsigned int x, y;
int number;
{
    if (PSLATEX_auxFile) {
	FILE *tmp = gpoutfile;
	gpoutfile = PSLATEX_auxFile;
	PS_point(x, y, number);
	gpoutfile = tmp;
    } else
	PS_point(x, y, number);
}


TERM_PUBLIC void PSLATEX_pointsize(ps)
double ps;
{
    if (PSLATEX_auxFile) {
	FILE *tmp = gpoutfile;
	gpoutfile = PSLATEX_auxFile;
	PS_pointsize(ps);
	gpoutfile = tmp;
    } else
	PS_pointsize(ps);
}


TERM_PUBLIC void PSLATEX_linewidth(ps)
double ps;
{
    if (PSLATEX_auxFile) {
	FILE *tmp = gpoutfile;
	gpoutfile = PSLATEX_auxFile;
	PS_linewidth(ps);
	gpoutfile = tmp;
    } else
	PS_linewidth(ps);
}

#endif /* TERM_BODY */

#ifdef TERM_TABLE

#ifndef GOT_POST_PROTO
#define TERM_PROTO_ONLY
#include "post.trm"
#undef TERM_PROTO_ONLY
#endif

TERM_TABLE_START(pslatex_driver)
    "pslatex", "LaTeX picture environment with PostScript \\specials",
    PSLATEX_XMAX, PSLATEX_YMAX, PSLATEX_VCHAR, PSLATEX_HCHAR,
    PS_VTIC, PS_HTIC, PSLATEX_options, PSLATEX_init, PSLATEX_reset,
    PSLATEX_text, null_scale, PSLATEX_graphics, PSLATEX_move,
    PSLATEX_vector, PSLATEX_linetype, PSLATEX_put_text, PSLATEX_text_angle,
    PSLATEX_justify_text, PSLATEX_point, do_arrow, set_font_null,
    PSLATEX_pointsize, 0 /*flags */ , 0 /*suspend */
    , 0 /*resume */ , 0 /*fillbox */ ,
    PSLATEX_linewidth
TERM_TABLE_END(pslatex_driver)
#undef LAST_TERM
#define LAST_TERM pslatex_driver

TERM_TABLE_START(pstex_driver)
    "pstex", "plain TeX with PostScript \\specials",
    PSLATEX_XMAX, PSLATEX_YMAX, PSLATEX_VCHAR, PSLATEX_HCHAR,
    PS_VTIC, PS_HTIC, PSLATEX_options, PSLATEX_init, PSLATEX_reset,
    PSLATEX_text, null_scale, PSLATEX_graphics, PSLATEX_move,
    PSLATEX_vector, PSLATEX_linetype, PSLATEX_put_text, PSLATEX_text_angle,
    PSLATEX_justify_text, PSLATEX_point, do_arrow, set_font_null,
    PSLATEX_pointsize, 0 /*flags */ , 0 /*suspend */
    , 0 /*resume */ , 0 /*fillbox */ ,
    PSLATEX_linewidth
TERM_TABLE_END(pstex_driver)
#undef LAST_TERM
#define LAST_TERM pstex_driver

#endif /* TERM_TABLE */
#endif /* TERM_PROTO_ONLY */


#ifdef TERM_HELP
START_HELP(pslatex)
"1 pslatex and pstex",
"?commands set terminal pslatex",
"?set terminal pslatex",
"?set term pslatex",
"?terminal pslatex",
"?term pslatex",
"?pslatex",
"?commands set terminal pstex",
"?set terminal pstex",
"?set term pstex",
"?terminal pstex",
"?term pstex",
"?pstex",
" The `pslatex` and `pstex` drivers generate output for further processing by",
" LaTeX and TeX, respectively.  Figures generated by `pstex` can be included",
" in any plain-based format (including LaTeX).",
"",
" Syntax:",
"       set terminal pslatex | |pstex {<color>} {<dashed>} {<rotate>}",
"                                     {auxfile} {<font_size>}",
"",
" <color> is either `color` or `monochrome`.  <rotate> is either `rotate` or",
" `norotate` and determines if the y-axis label is rotated.  <font_size> is",
" the size (in pts) of the desired font.",
"",
" If `auxfile` is specified, it directs the driver to put the PostScript",
" commands into an auxiliary file instead of directly into the LaTeX file.",
" This is useful if your pictures are large enough that dvips cannot handle",
" them.  The name of the auxiliary PostScript file is derived from the name of",
" the TeX file given on the `set output` command; it is determined by replacing",
" the trailing `.tex` (actually just the final extent in the file name) with",
" `.ps` in the output file name, or, if the TeX file has no extension, `.ps`",
" is appended.  Remember to close the file before leaving `gnuplot`.",
"",
" All drivers for LaTeX offer a special way of controlling text positioning:",
" If any text string begins with '{', you also need to include a '}' at the",
" end of the text, and the whole text will be centered both horizontally",
" and vertically by LaTeX. --- If the text string begins with '[', you need",
" to continue it with: a position specification (up to two out of t,b,l,r),",
" ']{', the text itself, and finally, '}'. The text itself may be anything",
" LaTeX can typeset as an LR-box. \\rule{}{}'s may help for best positioning.",
"",
" Examples:",
"       set term pslatex monochrome dashed rotate       # set to defaults",
" To write the PostScript commands into the file \"foo.ps\":",
"       set term pslatex auxfile",
"       set output \"foo.tex\"; plot ...: set output",
" About label positioning:",
" Use gnuplot defaults (mostly sensible, but sometimes not really best):",
"        set title '\\LaTeX\\ -- $ \\gamma $'",
" Force centering both horizontally and vertically:",
"        set label '{\\LaTeX\\ -- $ \\gamma $}' at 0,0",
" Specify own positioning (top here):",
"        set xlabel '[t]{\\LaTeX\\ -- $ \\gamma $}'",
" The other label -- account for long ticlabels:",
"        set ylabel '[r]{\\LaTeX\\ -- $ \\gamma $\\rule{7mm}{0pt}'",
"",
" Linewidths and pointsizes may be changed with `set linestyle`."
END_HELP(pslatex)
#endif /* TERM_HELP */