=================================================================== RCS file: /home/cvs/OpenXM_contrib/gnuplot/term/Attic/pslatex.trm,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.3 diff -u -p -r1.1.1.2 -r1.1.1.3 --- OpenXM_contrib/gnuplot/term/Attic/pslatex.trm 2000/01/22 14:16:28 1.1.1.2 +++ OpenXM_contrib/gnuplot/term/Attic/pslatex.trm 2003/09/15 07:09:38 1.1.1.3 @@ -1,5 +1,5 @@ /* - * $Id: pslatex.trm,v 1.1.1.2 2000/01/22 14:16:28 maekawa Exp $ + * $Id: pslatex.trm,v 1.1.1.3 2003/09/15 07:09:38 ohara Exp $ */ /* GNUPLOT - pslatex.trm */ @@ -93,6 +93,7 @@ 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; @@ -156,9 +157,14 @@ TERM_PUBLIC void PSLATEX_options() if (!END_OF_COMMAND) { /* We have font size specified */ struct value a; - int ps_fontsize = (int) real(const_express(&a)); - term->v_char = (unsigned int) (ps_fontsize * PS_SC); - term->h_char = (unsigned int) (ps_fontsize * PS_SC / 2); + /* 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 */ @@ -167,6 +173,11 @@ TERM_PUBLIC void PSLATEX_options() 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() @@ -186,7 +197,7 @@ TERM_PUBLIC void PSLATEX_init() */ /* if there's no extension, append ".ps" */ - if ((dotIndex = strrchr(outstr, '.')) == NULL) + if (outstr && (dotIndex = strrchr(outstr, '.')) == NULL) dotIndex = strchr(outstr, NUL); /* try to open the auxiliary file for the postscript parts. */ @@ -260,11 +271,13 @@ Turning off auxfile option\n", outstr); if (PSLATEX_auxFile) { FILE *tmp = gpoutfile; gpoutfile = PSLATEX_auxFile; - PS_common_init(1, 1, 0, 0, 0, xmin_t, ymin_t, xmax_t, ymax_t, NULL); + 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(1, 1, 0, 0, 0, xmin_t, ymin_t, xmax_t, ymax_t, NULL); + PS_common_init(0, 1, 0, 0, 0, + xmin_t, ymin_t, xmax_t, ymax_t, NULL); fputs("}}%\n", gpoutfile); } } @@ -289,8 +302,8 @@ TERM_PUBLIC void PSLATEX_graphics() 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 * (PS_XMAX) / PS_SC + 0.5); - int ury = (int) (ysize * (PS_YMAX) / PS_SC + 0.5); + 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); @@ -389,6 +402,13 @@ TERM_PUBLIC void PSLATEX_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 && @@ -616,7 +636,7 @@ START_HELP(pslatex) "", " is either `color` or `monochrome`. is either `rotate` or", " `norotate` and determines if the y-axis label is rotated. is", -" used to scale the font from its usual size.", +" 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.", @@ -648,7 +668,7 @@ START_HELP(pslatex) " 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}'", +" set ylabel '[r]{\\LaTeX\\ -- $ \\gamma $\\rule{7mm}{0pt}}'", "", " Linewidths and pointsizes may be changed with `set linestyle`." END_HELP(pslatex)