[BACK]Return to pslatex.trm CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gnuplot / term

Annotation of OpenXM_contrib/gnuplot/term/pslatex.trm, Revision 1.1

1.1     ! maekawa     1: /*
        !             2:  * $Id: pslatex.trm,v 1.35 1998/06/18 14:59:24 ddenholm Exp $
        !             3:  */
        !             4:
        !             5: /* GNUPLOT - pslatex.trm */
        !             6:
        !             7: /*[
        !             8:  * Copyright 1990 - 1993, 1998
        !             9:  *
        !            10:  * Permission to use, copy, and distribute this software and its
        !            11:  * documentation for any purpose with or without fee is hereby granted,
        !            12:  * provided that the above copyright notice appear in all copies and
        !            13:  * that both that copyright notice and this permission notice appear
        !            14:  * in supporting documentation.
        !            15:  *
        !            16:  * Permission to modify the software is granted, but not the right to
        !            17:  * distribute the complete modified source code.  Modifications are to
        !            18:  * be distributed as patches to the released version.  Permission to
        !            19:  * distribute binaries produced by compiling modified sources is granted,
        !            20:  * provided you
        !            21:  *   1. distribute the corresponding source modifications from the
        !            22:  *    released version in the form of a patch file along with the binaries,
        !            23:  *   2. add special version identification to distinguish your version
        !            24:  *    in addition to the base release version number,
        !            25:  *   3. provide your name and address as the primary contact for the
        !            26:  *    support of your modified version, and
        !            27:  *   4. retain our contact information in regard to use of the base
        !            28:  *    software.
        !            29:  * Permission to distribute the released version of the source code along
        !            30:  * with corresponding source modifications in the form of a patch file is
        !            31:  * granted with same provisions 2 through 4 for binary distributions.
        !            32:  *
        !            33:  * This software is provided "as is" without express or implied warranty
        !            34:  * to the extent permitted by applicable law.
        !            35: ]*/
        !            36:
        !            37: /*
        !            38:  * This file is included by ../term.c.
        !            39:  *
        !            40:  * This file supplies the terminal drivers:
        !            41:  *     pslatex --latex with embedded postscript
        !            42:  *     pstex   --plain TeX with embedded postscript
        !            43:  *
        !            44:  * AUTHORS
        !            45:  *  George Phillips
        !            46:  *  Russell Lang
        !            47:  *  David Kotz
        !            48:  *
        !            49:  * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
        !            50:  */
        !            51:
        !            52: #include "driver.h"
        !            53:
        !            54: #ifdef TERM_REGISTER
        !            55: register_term(pslatex)
        !            56: register_term(pstex)
        !            57: #endif
        !            58:
        !            59: #ifdef TERM_PROTO
        !            60: TERM_PUBLIC void PSLATEX_options __PROTO((void));
        !            61: TERM_PUBLIC void PSLATEX_init __PROTO((void));
        !            62: TERM_PUBLIC void PSLATEX_graphics __PROTO((void));
        !            63: TERM_PUBLIC void PSLATEX_put_text __PROTO((unsigned int x, unsigned int y, char str[]));
        !            64: TERM_PUBLIC int PSLATEX_justify_text __PROTO((enum JUSTIFY mode));
        !            65: TERM_PUBLIC int PSLATEX_text_angle __PROTO((int ang));
        !            66: TERM_PUBLIC void PSLATEX_reset __PROTO((void));
        !            67: TERM_PUBLIC void PSLATEX_text __PROTO((void));
        !            68: TERM_PUBLIC void PSLATEX_move __PROTO((unsigned int x, unsigned int y));
        !            69: TERM_PUBLIC void PSLATEX_vector __PROTO((unsigned int x, unsigned int y));
        !            70: TERM_PUBLIC void PSLATEX_linetype __PROTO((int lt));
        !            71: TERM_PUBLIC void PSLATEX_point __PROTO((unsigned int x, unsigned int y, int number));
        !            72: TERM_PUBLIC void PSLATEX_pointsize __PROTO((double size));
        !            73: TERM_PUBLIC void PSLATEX_linewidth __PROTO((double width));
        !            74:
        !            75: #define PSLATEX_XMAX (5*720)
        !            76: #define PSLATEX_YMAX (3*720)
        !            77:
        !            78: /* 10 pt char is about 10 pts high (say) */
        !            79: #define PSLATEX_VCHAR (100)
        !            80: /* 10 pt char is about 6 pts wide (say) */
        !            81: /* I find about 5 points (output from test) - div */
        !            82: #define PSLATEX_HCHAR (50)
        !            83: #define GOT_PSLATEX_PROTO
        !            84: #endif
        !            85:
        !            86: #ifndef TERM_PROTO_ONLY
        !            87:
        !            88: #ifdef TERM_BODY
        !            89: static int PSLATEX_angle;
        !            90: static int PSLATEX_justify;
        !            91: static int PSLATEX_rotate = TRUE;
        !            92: static char *PSLATEX_psfile = NULL;
        !            93: static TBOOLEAN PSLATEX_useAuxFile = FALSE;    /* do we write two files? */
        !            94: static FILE *PSLATEX_auxFile;
        !            95: static TBOOLEAN PSLATEX_output = TRUE; /* do we write LaTeX? */
        !            96:
        !            97: struct text_command {
        !            98:     int x, y, angle, justify;
        !            99:     char *label;
        !           100:     struct text_command *next;
        !           101: };
        !           102:
        !           103: static struct text_command *PSLATEX_labels;
        !           104:
        !           105: TERM_PUBLIC void PSLATEX_options()
        !           106: {
        !           107:     if (!END_OF_COMMAND) {
        !           108:        if (almost_equals(c_token, "d$efault")) {
        !           109:            ps_color = FALSE;
        !           110:            ps_solid = FALSE;
        !           111:            PSLATEX_rotate = TRUE;
        !           112:            PSLATEX_useAuxFile = FALSE;
        !           113:            c_token++;
        !           114:        }
        !           115:     }
        !           116:     if (!END_OF_COMMAND) {
        !           117:        if (almost_equals(c_token, "c$olor")
        !           118:            || almost_equals(c_token, "c$olour")) {
        !           119:            ps_color = TRUE;
        !           120:            c_token++;
        !           121:        }
        !           122:     }
        !           123:     if (!END_OF_COMMAND) {
        !           124:        if (almost_equals(c_token, "m$onochrome")) {
        !           125:            ps_color = FALSE;
        !           126:            c_token++;
        !           127:        }
        !           128:     }
        !           129:     if (!END_OF_COMMAND) {
        !           130:        if (almost_equals(c_token, "so$lid")) {
        !           131:            ps_solid = TRUE;
        !           132:            c_token++;
        !           133:        } else if (almost_equals(c_token, "da$shed")) {
        !           134:            ps_solid = FALSE;
        !           135:            c_token++;
        !           136:        }
        !           137:     }
        !           138:     if (!END_OF_COMMAND) {
        !           139:        if (almost_equals(c_token, "r$otate")) {
        !           140:            PSLATEX_rotate = TRUE;
        !           141:            c_token++;
        !           142:        }
        !           143:     }
        !           144:     if (!END_OF_COMMAND) {
        !           145:        if (almost_equals(c_token, "n$orotate")) {
        !           146:            PSLATEX_rotate = FALSE;
        !           147:            c_token++;
        !           148:        }
        !           149:     }
        !           150:     if (!END_OF_COMMAND) {
        !           151:        if (almost_equals(c_token, "a$uxfile")) {
        !           152:            PSLATEX_useAuxFile = TRUE;
        !           153:            c_token++;
        !           154:        }
        !           155:     }
        !           156:     if (!END_OF_COMMAND) {
        !           157:        /* We have font size specified */
        !           158:        struct value a;
        !           159:        int ps_fontsize = (int) real(const_express(&a));
        !           160:        term->v_char = (unsigned int) (ps_fontsize * PS_SC);
        !           161:        term->h_char = (unsigned int) (ps_fontsize * PS_SC / 2);
        !           162:     }
        !           163:     /* be sure to generate an options string that PSLATEX_init understands */
        !           164:
        !           165:     sprintf(term_options, "%s %s %s%s",
        !           166:            ps_color ? "color" : "monochrome",
        !           167:            ps_solid ? "solid" : "dashed",
        !           168:            PSLATEX_rotate ? "rotate" : "norotate",
        !           169:            PSLATEX_useAuxFile ? " auxfile" : "");
        !           170: }
        !           171:
        !           172: TERM_PUBLIC void PSLATEX_init()
        !           173: {
        !           174:     char *dotIndex;
        !           175:
        !           176:     if (strcmp(term->name, "pstex") == 0)
        !           177:        PSLATEX_output = FALSE;
        !           178:
        !           179:     PSLATEX_auxFile = NULL;    /* until we know otherwise */
        !           180:     /* dont tweak PSLATEX_useAuxFile if we decide we cannot comply
        !           181:      * since this affects subsequent plots even after a set out
        !           182:      * Instead, we will use PSLATEX_auxFile != NULL to indicate
        !           183:      * use of an aux file
        !           184:      */
        !           185:
        !           186:     /* try to open the auxiliary file for the postscript parts. */
        !           187:     if (outstr && PSLATEX_useAuxFile == TRUE &&
        !           188:        (dotIndex = strrchr(outstr, '.'))) {
        !           189:
        !           190:        /* assume file name is ending in ".tex" */
        !           191:        if (PSLATEX_psfile)
        !           192:            free(PSLATEX_psfile);
        !           193:        PSLATEX_psfile = gp_alloc(dotIndex - outstr + 3, "pslatex aux filename");
        !           194:        if (PSLATEX_psfile) {
        !           195:        /* including . */
        !           196:            safe_strncpy(PSLATEX_psfile, outstr, dotIndex - outstr + 1);
        !           197:            strcpy(PSLATEX_psfile + (dotIndex - outstr) + 1, "ps");
        !           198:            if ((PSLATEX_auxFile = fopen(PSLATEX_psfile, "w")) == (FILE *) NULL) {
        !           199:                fprintf(stderr, "Cannot open aux file %s for output\n",
        !           200:                        PSLATEX_psfile);
        !           201:            }
        !           202:        } else {
        !           203:            fprintf(stderr, "\
        !           204: Cannot make PostScript file name from %s\n\
        !           205: Turning off auxfile option\n", outstr);
        !           206:            PSLATEX_auxFile = NULL;
        !           207:        }
        !           208:     }
        !           209:     if (PSLATEX_output) {
        !           210:        fputs("\
        !           211: % GNUPLOT: LaTeX picture with Postscript\n\
        !           212: \\begingroup%\n\
        !           213:   \\makeatletter%\n\
        !           214:   \\newcommand{\\GNUPLOTspecial}{%\n\
        !           215:     \\@sanitize\\catcode`\\%=14\\relax\\special}%\n\
        !           216:   \\setlength{\\unitlength}{0.1bp}%\n", gpoutfile);
        !           217:     } else {
        !           218:
        !           219:        /* write plain TeX header */
        !           220:
        !           221:        fputs("\
        !           222: % GNUPLOT: plain TeX with Postscript\n\
        !           223: \\begingroup\n\
        !           224:   \\catcode`\\@=11\\relax\n\
        !           225:   \\def\\GNUPLOTspecial{%\n\
        !           226:     \\def\\do##1{\\catcode`##1=12\\relax}\\dospecials\n\
        !           227:     \\catcode`\\{=1\\catcode`\\}=2\\catcode\\%=14\\relax\\special}%\n\
        !           228: %\n\
        !           229: \\expandafter\\ifx\\csname GNUPLOTpicture\\endcsname\\relax\n\
        !           230:   \\csname newdimen\\endcsname\\GNUPLOTunit\n\
        !           231:   \\gdef\\GNUPLOTpicture(#1,#2){\\vbox to#2\\GNUPLOTunit\\bgroup\n\
        !           232:     \\def\\put(##1,##2)##3{\\unskip\\raise##2\\GNUPLOTunit\n\
        !           233:       \\hbox to0pt{\\kern##1\\GNUPLOTunit ##3\\hss}\\ignorespaces}%\n\
        !           234:     \\def\\ljust##1{\\vbox to0pt{\\vss\\hbox to0pt{##1\\hss}\\vss}}%\n\
        !           235:     \\def\\cjust##1{\\vbox to0pt{\\vss\\hbox to0pt{\\hss ##1\\hss}\\vss}}%\n\
        !           236:     \\def\\rjust##1{\\vbox to0pt{\\vss\\hbox to0pt{\\hss ##1}\\vss}}%\n\
        !           237:     \\def\\stack##1{\\let\\\\=\\cr\\tabskip=0pt\\halign{\\hfil ####\\hfil\\cr ##1\\crcr}}%\n\
        !           238:     \\def\\lstack##1{\\hbox to0pt{\\vbox to0pt{\\vss\\stack{##1}}\\hss}}%\n\
        !           239:     \\def\\cstack##1{\\hbox to0pt{\\hss\\vbox to0pt{\\vss\\stack{##1}}\\hss}}%\n\
        !           240:     \\def\\rstack##1{\\hbox to0pt{\\vbox to0pt{\\stack{##1}\\vss}\\hss}}%\n\
        !           241:     \\vss\\hbox to#1\\GNUPLOTunit\\bgroup\\ignorespaces}%\n\
        !           242:   \\gdef\\endGNUPLOTpicture{\\hss\\egroup\\egroup}%\n\
        !           243: \\fi\n\
        !           244: \\GNUPLOTunit=0.1bp\n", gpoutfile);
        !           245:     }
        !           246:
        !           247:     {
        !           248:        unsigned int xmin_t = xoffset * PSLATEX_XMAX / PS_SC;
        !           249:        unsigned int xmax_t = (xoffset + xsize) * PSLATEX_XMAX / PS_SC;
        !           250:        unsigned int ymin_t = yoffset * PSLATEX_YMAX / PS_SC;
        !           251:        unsigned int ymax_t = (yoffset + ysize) * PSLATEX_YMAX / PS_SC;
        !           252:
        !           253:        if (PSLATEX_auxFile) {
        !           254:            FILE *tmp = gpoutfile;
        !           255:            gpoutfile = PSLATEX_auxFile;
        !           256:            PS_common_init(1, 1, 0, 0, 0, xmin_t, ymin_t, xmax_t, ymax_t, NULL);
        !           257:            gpoutfile = tmp;
        !           258:        } else {
        !           259:            fputs("{\\GNUPLOTspecial{!\n", gpoutfile);
        !           260:            PS_common_init(1, 1, 0, 0, 0, xmin_t, ymin_t, xmax_t, ymax_t, NULL);
        !           261:            fputs("}}%\n", gpoutfile);
        !           262:        }
        !           263:     }
        !           264:
        !           265:     PSLATEX_angle = 0;
        !           266:     PSLATEX_justify = 0;
        !           267:     PSLATEX_labels = 0;
        !           268: }
        !           269:
        !           270: TERM_PUBLIC void PSLATEX_graphics()
        !           271: {
        !           272:     struct termentry *t = term;
        !           273:
        !           274:     if (PSLATEX_output)
        !           275:        fprintf(gpoutfile, "\\begin{picture}(%d,%d)(0,0)%%\n", (int) (xsize * t->xmax), (int)
        !           276:                (ysize * t->ymax));
        !           277:     else
        !           278:        fprintf(gpoutfile, "\\GNUPLOTpicture(%d,%d)\n", (int) (xsize * t->xmax), (int) (ysize * t->ymax));
        !           279:
        !           280:     if (PSLATEX_auxFile) {
        !           281:        FILE *tmp;
        !           282:        /*
        !           283:         * these are taken from the post.trm file computation
        !           284:         * of the bounding box, but without the X_OFF and Y_OFF
        !           285:         */
        !           286:        int urx = (int) (xsize * (PS_XMAX) / PS_SC + 0.5), ury = (int) (ysize * (PS_YMAX) / PS_SC
        !           287:                                                                        + 0.5);
        !           288:
        !           289:        /* generate special which xdvi and dvips can handle */
        !           290:        fprintf(gpoutfile,
        !           291:                "\\special{psfile=%s llx=0 lly=0 urx=%d ury=%d rwi=%d}\n",
        !           292:                PSLATEX_psfile, urx, ury, 10 * urx);
        !           293:        tmp = gpoutfile;
        !           294:        gpoutfile = PSLATEX_auxFile;
        !           295:        PS_graphics();
        !           296:        gpoutfile = tmp;
        !           297:     } else {
        !           298:        fputs("{\\GNUPLOTspecial{\"\n", gpoutfile);
        !           299:        PS_graphics();
        !           300:     }
        !           301:
        !           302:     PSLATEX_labels = (struct text_command *) NULL;
        !           303: }
        !           304:
        !           305: TERM_PUBLIC void PSLATEX_put_text(x, y, str)
        !           306: unsigned int x, y;
        !           307: char str[];
        !           308: {
        !           309:     struct text_command *tc;
        !           310:
        !           311:     /* ignore empty strings */
        !           312:     if (str[0] == NUL)
        !           313:        return;
        !           314:
        !           315:     tc = (struct text_command *) gp_alloc(sizeof(struct text_command), term->name);
        !           316:     tc->x = x;
        !           317:     tc->y = y;
        !           318:     tc->label = (char *) gp_alloc(strlen(str) + 1, term->name);
        !           319:     strcpy(tc->label, str);
        !           320:     tc->justify = PSLATEX_justify;
        !           321:     tc->angle = PSLATEX_angle;
        !           322:
        !           323:     tc->next = PSLATEX_labels;
        !           324:     PSLATEX_labels = tc;
        !           325: }
        !           326:
        !           327: TERM_PUBLIC int PSLATEX_justify_text(mode)
        !           328: enum JUSTIFY mode;
        !           329: {
        !           330:     PSLATEX_justify = mode;
        !           331:     return TRUE;
        !           332: }
        !           333:
        !           334: TERM_PUBLIC int PSLATEX_text_angle(ang)
        !           335: int ang;
        !           336: {
        !           337:     /* rotated text is put in a short stack, and optionally uses
        !           338:      * postscript specials depending on PSLATEX_rotate */
        !           339:     PSLATEX_angle = ang;
        !           340:     return TRUE;
        !           341: }
        !           342:
        !           343:
        !           344: TERM_PUBLIC void PSLATEX_reset()
        !           345: {
        !           346:     if (PSLATEX_auxFile) {
        !           347:        fclose(PSLATEX_auxFile);
        !           348:        PSLATEX_auxFile = NULL;
        !           349:     }
        !           350:     if (PSLATEX_psfile) {
        !           351:        free(PSLATEX_psfile);
        !           352:        PSLATEX_psfile = NULL;
        !           353:     }
        !           354: }
        !           355:
        !           356: TERM_PUBLIC void PSLATEX_text()
        !           357: {
        !           358:     struct text_command *tc;
        !           359:
        !           360:     if (PSLATEX_auxFile) {
        !           361:        FILE *tmp = gpoutfile;
        !           362:        gpoutfile = PSLATEX_auxFile;
        !           363:        PS_text();
        !           364:        gpoutfile = tmp;
        !           365:     } else {
        !           366:        PS_text();
        !           367:        fputs("}}%\n", gpoutfile);
        !           368:     }
        !           369:
        !           370:     for (tc = PSLATEX_labels; tc != (struct text_command *) NULL; tc = tc->next) {
        !           371:        fprintf(gpoutfile, "\\put(%d,%d){", tc->x, tc->y);
        !           372:        if (PSLATEX_output &&
        !           373:            ((tc->label[0] == '{') || (tc->label[0] == '['))) {
        !           374:            fprintf(gpoutfile, "\\makebox(0,0)%s", tc->label);
        !           375:        } else
        !           376:            switch (tc->angle) {
        !           377:            case 0:
        !           378:                switch (tc->justify) {
        !           379:                case LEFT:
        !           380:                    fprintf(gpoutfile, (PSLATEX_output
        !           381:                                        ? "\\makebox(0,0)[l]{%s}"
        !           382:                                        : "\\ljust{%s}"), tc->label);
        !           383:                    break;
        !           384:                case CENTRE:
        !           385:                    fprintf(gpoutfile, (PSLATEX_output
        !           386:                                        ? "\\makebox(0,0){%s}"
        !           387:                                        : "\\cjust{%s}"), tc->label);
        !           388:                    break;
        !           389:                case RIGHT:
        !           390:                    fprintf(gpoutfile, (PSLATEX_output
        !           391:                                        ? "\\makebox(0,0)[r]{%s}"
        !           392:                                        : "\\rjust{%s}"), tc->label);
        !           393:                    break;
        !           394:                }
        !           395:                break;
        !           396:            case 1:             /* put text in a short stack */
        !           397:                if (PSLATEX_rotate) {
        !           398:                    fputs("\
        !           399: %\n\\special{ps: gsave currentpoint currentpoint translate\n\
        !           400: 270 rotate neg exch neg exch translate}%\n", gpoutfile);
        !           401:                }
        !           402:                switch (tc->justify) {
        !           403:                case LEFT:
        !           404:                    fprintf(gpoutfile, (PSLATEX_output
        !           405:                                        ? "\\makebox(0,0)[lb]{\\shortstack{%s}}"
        !           406:                                        : "\\lstack{%s}"),
        !           407:                            tc->label);
        !           408:                    break;
        !           409:                case CENTRE:
        !           410:                    fprintf(gpoutfile, (PSLATEX_output
        !           411:                                        ? "\\makebox(0,0)[b]{\\shortstack{%s}}"
        !           412:                                        : "\\cstack{%s}"),
        !           413:                            tc->label);
        !           414:                    break;
        !           415:                case RIGHT:
        !           416:                    fprintf(gpoutfile, (PSLATEX_output
        !           417:                                        ? "\\makebox(0,0)[lt]{\\shortstack{%s}}"
        !           418:                                        : "\\rstack{%s}"),
        !           419:                            tc->label);
        !           420:                    break;
        !           421:                }
        !           422:                if (PSLATEX_rotate) {
        !           423:                    fputs("%\n\\special{ps: currentpoint grestore moveto}%\n", gpoutfile);
        !           424:                }
        !           425:            }
        !           426:        fputs("}%\n", gpoutfile);
        !           427:     }
        !           428:
        !           429:     while (PSLATEX_labels) {
        !           430:        tc = PSLATEX_labels->next;
        !           431:        free(PSLATEX_labels->label);
        !           432:        free(PSLATEX_labels);
        !           433:        PSLATEX_labels = tc;
        !           434:     }
        !           435:
        !           436:     if (PSLATEX_output) {
        !           437:        fputs("\
        !           438: \\end{picture}%\n\
        !           439: \\endgroup\n\
        !           440: \\endinput\n", gpoutfile);
        !           441:     } else {
        !           442:        fputs("\
        !           443: \\endGNUPLOTpicture\n\
        !           444: \\endgroup\n\
        !           445: \\endinput\n", gpoutfile);
        !           446:     }
        !           447: }
        !           448:
        !           449: TERM_PUBLIC void PSLATEX_move(x, y)
        !           450: unsigned int x, y;
        !           451: {
        !           452:     if (PSLATEX_auxFile) {
        !           453:        FILE *tmp = gpoutfile;
        !           454:        gpoutfile = PSLATEX_auxFile;
        !           455:        PS_move(x, y);
        !           456:        gpoutfile = tmp;
        !           457:     } else {
        !           458:        PS_move(x, y);
        !           459:     }
        !           460: }
        !           461:
        !           462:
        !           463: TERM_PUBLIC void PSLATEX_vector(x, y)
        !           464: unsigned int x, y;
        !           465: {
        !           466:
        !           467:     if (PSLATEX_auxFile) {
        !           468:        FILE *tmp = gpoutfile;
        !           469:        gpoutfile = PSLATEX_auxFile;
        !           470:        PS_vector(x, y);
        !           471:        gpoutfile = tmp;
        !           472:     } else {
        !           473:        PS_vector(x, y);
        !           474:     }
        !           475: }
        !           476:
        !           477:
        !           478: TERM_PUBLIC void PSLATEX_linetype(lt)
        !           479: int lt;
        !           480: {
        !           481:     if (PSLATEX_auxFile) {
        !           482:        FILE *tmp = gpoutfile;
        !           483:        gpoutfile = PSLATEX_auxFile;
        !           484:        PS_linetype(lt);
        !           485:        gpoutfile = tmp;
        !           486:     } else {
        !           487:        PS_linetype(lt);
        !           488:     }
        !           489: }
        !           490:
        !           491: TERM_PUBLIC void PSLATEX_point(x, y, number)
        !           492: unsigned int x, y;
        !           493: int number;
        !           494: {
        !           495:     if (PSLATEX_auxFile) {
        !           496:        FILE *tmp = gpoutfile;
        !           497:        gpoutfile = PSLATEX_auxFile;
        !           498:        PS_point(x, y, number);
        !           499:        gpoutfile = tmp;
        !           500:     } else
        !           501:        PS_point(x, y, number);
        !           502: }
        !           503:
        !           504:
        !           505: TERM_PUBLIC void PSLATEX_pointsize(ps)
        !           506: double ps;
        !           507: {
        !           508:     if (PSLATEX_auxFile) {
        !           509:        FILE *tmp = gpoutfile;
        !           510:        gpoutfile = PSLATEX_auxFile;
        !           511:        PS_pointsize(ps);
        !           512:        gpoutfile = tmp;
        !           513:     } else
        !           514:        PS_pointsize(ps);
        !           515: }
        !           516:
        !           517:
        !           518: TERM_PUBLIC void PSLATEX_linewidth(ps)
        !           519: double ps;
        !           520: {
        !           521:     if (PSLATEX_auxFile) {
        !           522:        FILE *tmp = gpoutfile;
        !           523:        gpoutfile = PSLATEX_auxFile;
        !           524:        PS_linewidth(ps);
        !           525:        gpoutfile = tmp;
        !           526:     } else
        !           527:        PS_linewidth(ps);
        !           528: }
        !           529:
        !           530: #endif /* TERM_BODY */
        !           531:
        !           532: #ifdef TERM_TABLE
        !           533:
        !           534: #ifndef GOT_POST_PROTO
        !           535: #define TERM_PROTO_ONLY
        !           536: #include "post.trm"
        !           537: #undef TERM_PROTO_ONLY
        !           538: #endif
        !           539:
        !           540: TERM_TABLE_START(pslatex_driver)
        !           541:     "pslatex", "LaTeX picture environment with PostScript \\specials",
        !           542:     PSLATEX_XMAX, PSLATEX_YMAX, PSLATEX_VCHAR, PSLATEX_HCHAR,
        !           543:     PS_VTIC, PS_HTIC, PSLATEX_options, PSLATEX_init, PSLATEX_reset,
        !           544:     PSLATEX_text, null_scale, PSLATEX_graphics, PSLATEX_move,
        !           545:     PSLATEX_vector, PSLATEX_linetype, PSLATEX_put_text, PSLATEX_text_angle,
        !           546:     PSLATEX_justify_text, PSLATEX_point, do_arrow, set_font_null,
        !           547:     PSLATEX_pointsize, 0 /*flags */ , 0 /*suspend */
        !           548:     , 0 /*resume */ , 0 /*fillbox */ ,
        !           549:     PSLATEX_linewidth
        !           550: TERM_TABLE_END(pslatex_driver)
        !           551: #undef LAST_TERM
        !           552: #define LAST_TERM pslatex_driver
        !           553:
        !           554: TERM_TABLE_START(pstex_driver)
        !           555:     "pstex", "plain TeX with PostScript \\specials",
        !           556:     PSLATEX_XMAX, PSLATEX_YMAX, PSLATEX_VCHAR, PSLATEX_HCHAR,
        !           557:     PS_VTIC, PS_HTIC, PSLATEX_options, PSLATEX_init, PSLATEX_reset,
        !           558:     PSLATEX_text, null_scale, PSLATEX_graphics, PSLATEX_move,
        !           559:     PSLATEX_vector, PSLATEX_linetype, PSLATEX_put_text, PSLATEX_text_angle,
        !           560:     PSLATEX_justify_text, PSLATEX_point, do_arrow, set_font_null,
        !           561:     PSLATEX_pointsize, 0 /*flags */ , 0 /*suspend */
        !           562:     , 0 /*resume */ , 0 /*fillbox */ ,
        !           563:     PSLATEX_linewidth
        !           564: TERM_TABLE_END(pstex_driver)
        !           565: #undef LAST_TERM
        !           566: #define LAST_TERM pstex_driver
        !           567:
        !           568: #endif /* TERM_TABLE */
        !           569: #endif /* TERM_PROTO_ONLY */
        !           570:
        !           571:
        !           572: #ifdef TERM_HELP
        !           573: START_HELP(pslatex)
        !           574: "1 pslatex and pstex",
        !           575: "?commands set terminal pslatex",
        !           576: "?set terminal pslatex",
        !           577: "?set term pslatex",
        !           578: "?terminal pslatex",
        !           579: "?term pslatex",
        !           580: "?pslatex",
        !           581: "?commands set terminal pstex",
        !           582: "?set terminal pstex",
        !           583: "?set term pstex",
        !           584: "?terminal pstex",
        !           585: "?term pstex",
        !           586: "?pstex",
        !           587: " The `pslatex` and `pstex` drivers generate output for further processing by",
        !           588: " LaTeX and TeX, respectively.  Figures generated by `pstex` can be included",
        !           589: " in any plain-based format (including LaTeX).",
        !           590: "",
        !           591: " Syntax:",
        !           592: "       set terminal pslatex | |pstex {<color>} {<dashed>} {<rotate>}",
        !           593: "                                     {auxfile} {<font_size>}",
        !           594: "",
        !           595: " <color> is either `color` or `monochrome`.  <rotate> is either `rotate` or",
        !           596: " `norotate` and determines if the y-axis label is rotated.  <font_size> is",
        !           597: " used to scale the font from its usual size.",
        !           598: "",
        !           599: " If `auxfile` is specified, it directs the driver to put the PostScript",
        !           600: " commands into an auxiliary file instead of directly into the LaTeX file.",
        !           601: " This is useful if your pictures are large enough that dvips cannot handle",
        !           602: " them.  The name of the auxiliary PostScript file is derived from the name of",
        !           603: " the TeX file given on the `set output` command; it is determined by replacing",
        !           604: " the trailing `.tex` (actually just the final extent in the file name---and",
        !           605: " the option will be turned off if there is no extent) with `.ps` in the output",
        !           606: " file name.  Remember to close the file before leaving `gnuplot`.",
        !           607: "",
        !           608: " All drivers for LaTeX offer a special way of controlling text positioning:",
        !           609: " If any text string begins with '{', you also need to include a '}' at the",
        !           610: " end of the text, and the whole text will be centered both horizontally",
        !           611: " and vertically by LaTeX. --- If the text string begins with '[', you need",
        !           612: " to continue it with: a position specification (up to two out of t,b,l,r),",
        !           613: " ']{', the text itself, and finally, '}'. The text itself may be anything",
        !           614: " LaTeX can typeset as an LR-box. \\rule{}{}'s may help for best positioning.",
        !           615: "",
        !           616: " Examples:",
        !           617: "       set term pslatex monochrome dashed rotate       # set to defaults",
        !           618: " To write the PostScript commands into the file \"foo.ps\":",
        !           619: "       set term pslatex auxfile",
        !           620: "       set output \"foo.tex\"; plot ...: set output",
        !           621: " About label positioning:",
        !           622: " Use gnuplot defaults (mostly sensible, but sometimes not really best):",
        !           623: "        set title '\\LaTeX\\ -- $ \\gamma $'",
        !           624: " Force centering both horizontally and vertically:",
        !           625: "        set label '{\\LaTeX\\ -- $ \\gamma $}' at 0,0",
        !           626: " Specify own positioning (top here):",
        !           627: "        set xlabel '[t]{\\LaTeX\\ -- $ \\gamma $}'",
        !           628: " The other label -- account for long ticlabels:",
        !           629: "        set ylabel '[r]{\\LaTeX\\ -- $ \\gamma $\\rule{7mm}{0pt}'",
        !           630: "",
        !           631: " Linewidths and pointsizes may be changed with `set linestyle`."
        !           632: END_HELP(pslatex)
        !           633: #endif /* TERM_HELP */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>