Annotation of researchv10no/cmd/eqn/tuning.c, revision 1.1.1.1

1.1       root        1: #include "e.h"
                      2: 
                      3: /*
                      4: 
                      5: This file contains parameter values for many of the
                      6: tuning parameters in eqn.  Names are defined words.
                      7: 
                      8: Strings are plugged in verbatim.
                      9: Floats are usually in ems.
                     10: 
                     11: */
                     12: 
                     13: /* In main.c: */
                     14: 
                     15: double BeforeSub = 1.2;        /* line space before a subscript */
                     16: double AfterSub  = 0.2;        /* line space after a subscript */
                     17: 
                     18: /* diacrit.c: */
                     19: 
                     20: double Dvshift = 0.25;         /* vertical shift for diacriticals on tall letters */
                     21: double Dhshift = 0.025;        /* horizontal shift for tall letters */
                     22: double Dh2shift = 0.05;        /* horizontal shift for small letters */
                     23: double Dheight = 0.25;         /* increment to height for diacriticals */
                     24: double Barv    = 0.68;         /* vertical shift for bar */
                     25: double Barh    = 0.05;         /* 1/2 horizontal shrink for bar */
                     26: double Ubarv   = 0.1;          /* shift underbar up this much ems */
                     27: 
                     28: /* Also:
                     29:        Vec, Dyad, Hat, Tilde, Dot, Dotdot, Utilde */
                     30: 
                     31: /* eqnbox.c: */
                     32: 
                     33: char   *IRspace = "\\^";       /* space between italic & roman boxes */
                     34: 
                     35: /* fat.c: */
                     36: 
                     37: double Fatshift = 0.05;        /* fattening shifts by Fatshift ems */
                     38: 
                     39: /* funny.c: */
                     40: 
                     41: int    Funnyps = 5;            /* point size change (== 5 above) */
                     42: double Funnyht = 0.2;          /* height correction */
                     43: double Funnybase = 0.3;        /* base correction */
                     44: 
                     45: /* integral.c: */
                     46: 
                     47: int    Intps   = 4;            /* point size change for integral (== 4 above) */
                     48: double Intht   = 1.15;         /* ht of integral in ems */
                     49: double Intbase = 0.3;          /* base in ems */
                     50: double Int1h   = 0.4;          /* lower limit left */
                     51: double Int1v   = 0.2;          /* lower limit down */
                     52: double Int2h   = 0.05;         /* upper limit right was 8 */
                     53: double Int2v   = 0.1;          /* upper limit up */
                     54: 
                     55: /* matrix.c: */
                     56: 
                     57: char   *Matspace = "\\ \\ ";   /* space between matrix columns */
                     58: 
                     59: /* over.c: */
                     60: 
                     61: double Overgap = 0.3;          /* gap between num and denom */
                     62: double Overwid = 0.5;          /* extra width of box */
                     63: double Overline = 0.1;         /* extra length of fraction bar */
                     64: 
                     65: /* paren.c* */
                     66: 
                     67: double Parenbase = 0.4;        /* shift of base for even count */
                     68: double Parenshift = 0.13;      /* how much to shift parens down in left ... */
                     69:                                /* ignored unless postscript */
                     70: double Parenheight = 0.3;      /* extra height above builtups */
                     71: 
                     72: /* pile.c: */
                     73: 
                     74: double Pilegap = 0.4;          /* gap between pile elems */
                     75: double Pilebase = 0.5;         /* shift base of even # of piled elems */
                     76: 
                     77: /* shift.c: */
                     78: 
                     79: double Subbase = 0.2;          /* subscript base belowe main base */
                     80: double Supshift = 0.4;         /* superscript .4 up main box */
                     81: char   *Sub1space = "\\|";     /* italic sub roman space */
                     82: char   *Sup1space = "\\|";     /* italic sup roman space */
                     83: char   *Sub2space = "\\^";     /* space after subscripted thing */
                     84: char   *SS1space = "\\^";      /* space before sub in x sub i sup j */
                     85: char   *SS2space = "\\^";      /* space before sup */
                     86: 
                     87: /* sqrt.c: */
                     88:        /* sqrt is hard!  punt for now. */
                     89:        /* part of the problem is that every typesetter does it differently */
                     90:        /* and we have several typesetters to run. */
                     91: 
                     92: /* text.c: */
                     93:        /* ought to be done by a table */
                     94: 
                     95: struct tune {
                     96:        char    *name;
                     97:        char    *cval;
                     98: } tune[]       ={
                     99:   /* diacrit.c */
                    100:        "vec_def",      "\\f1\\v'-.5m'\\s-3\\(->\\s0\\v'.5m'\\fP",      /* was \s-2 & .45m */
                    101:        "dyad_def",     "\\f1\\v'-.5m'\\s-3\\z\\(<-\\|\\(->\\s0\\v'.5m'\\fP",
                    102:        "hat_def",      "\\f1\\v'-.05m'\\s+1^\\s0\\v'.05m'\\fP",        /* was .1 */
                    103:        "tilde_def",    "\\f1\\v'-.05m'\\s+1~\\s0\\v'.05m'\\fP",
                    104:        "dot_def",      "\\f1\\v'-.67m'.\\v'.67m'\\fP",
                    105:        "dotdot_def",   "\\f1\\v'-.67m'..\\v'.67m'\\fP",
                    106:        "utilde_def",   "\\f1\\v'1.0m'\\s+2~\\s-2\\v'-1.0m'\\fP",
                    107:   /* funny.c */
                    108:        "sum_def",      "\\|\\v'.3m'\\s+5\\(*S\\s-5\\v'-.3m'\\|",
                    109:        "union_def",    "\\|\\v'.3m'\\s+5\\(cu\\s-5\\v'-.3m'\\|",
                    110:        "inter_def",    "\\|\\v'.3m'\\s+5\\(ca\\s-5\\v'-.3m'\\|",
                    111:        "prod_def",     "\\|\\v'.3m'\\s+5\\(*P\\s-5\\v'-.3m'\\|",
                    112:   /* integral.c */
                    113:        "int_def",      "\\v'.1m'\\s+4\\(is\\s-4\\v'-.1m'",
                    114:        0, 0
                    115: };
                    116: 
                    117: tbl    *ftunetbl[TBLSIZE];     /* user-defined names */
                    118: 
                    119: char *ftunes[] ={      /* this table intentionally left small */
                    120:        "Subbase",
                    121:        "Supshift",
                    122:        0
                    123: };
                    124: 
                    125: void init_tune(void)
                    126: {
                    127:        int i;
                    128: 
                    129:        for (i = 0; tune[i].name != NULL; i++)
                    130:                install(deftbl, tune[i].name, tune[i].cval, 0);
                    131:        for (i = 0; ftunes[i] != NULL; i++)
                    132:                install(ftunetbl, ftunes[i], (char *) 0, 0);
                    133: }
                    134: 
                    135: #define eq(s, t) (strcmp(s,t) == 0)
                    136: 
                    137: void ftune(char *s, char *t)   /* brute force for now */
                    138: {
                    139:        double f = atof(t);
                    140:        double *target;
                    141: 
                    142:        while (*t == ' ' || *t == '\t')
                    143:                t++;
                    144:        if (eq(s, "Subbase"))
                    145:                target = &Subbase;
                    146:        else if (eq(s, "Supshift"))
                    147:                target = &Supshift;
                    148:        if (t[0] == '+' || t[0] == '-')
                    149:                *target += f;
                    150:        else
                    151:                *target = f;
                    152: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.