Beispiel #1
0
void TeXDisplay::initialMatter() {
  const char * font = "normalsize";
  int columns = 1;
  StringAccumulator baselineskip;
  if(strcmp(font,"normalsize")==0) {
    baselineskip.add("12pt");
  } else if(strcmp(font,"small")==0) {
    baselineskip.add("9pt");
  } else {
    GBStream << "FontSize " << font << " not supported.";
    DBG();
//    font = "normalsize";
    baselineskip.add("12pt");
  };
  if(columns==2) {
    d_sink.put("\\documentclass[proc]{article}\n");
    d_sink.put("\\textheight      25.0000cm\n");
    d_sink.put("\\textwidth         17.27cm\n");
    d_sink.put("\\topmargin       -3.0000cm\n");
    d_sink.put("\\oddsidemargin   -0.3462cm\n");
    d_sink.put("\\evensidemargin  -0.3462cm\n");
    d_sink.put("\\arraycolsep        2.5pt\n");
   } else {
    //d_sink << "\\documentclass[rep10,leqno]{report}\n"
    d_sink.put("\\documentclass[leqno]{report}\n");
    d_sink.put("\\voffset = -1in\n");
    d_sink.put("\\evensidemargin 0.1in\n");
    d_sink.put("\\oddsidemargin 0.1in\n");
    d_sink.put("\\textheight 9in\n");
    d_sink.put("\\textwidth 6in\n");
  };
};
Beispiel #2
0
void _CppTeXTheFile(Source & so,Sink & si) {
  stringGB format;
  so >> format;
  StringAccumulator x;
  x.add(PlatformSpecific::s_latex_command());
  x.add(format.value().chars());
  so.shouldBeEnd();
  si.noOutput();
  system(x.chars());
};
Beispiel #3
0
void _ShowTeX(Source & so,Sink & si) {
  stringGB format;
  so >> format;
  StringAccumulator x;
  x.add(PlatformSpecific::s_dvi_viewer());
  x.add(format.value().chars());
  x.add(PlatformSpecific::s_background());
  so.shouldBeEnd();
  si.noOutput();
  system(x.chars());
};
Beispiel #4
0
void IISource::get(Variable& x) {
  int type = getType();
  if(type==GBInputNumbers::s_IOSYMBOL) {
    symbolGB y;
    ((ISource *)this)->get(y);
    x.assign(y.value().chars());
  } else if(type==GBInputNumbers::s_IOFUNCTION) {
    StringAccumulator acc; 
    getAnything(acc);
    x.assign(acc.chars());
  } else DBG();
};
Beispiel #5
0
void IISource::getAnything(StringAccumulator & acc) {
  int type = getType();
  symbolGB y;
  if(type==GBInputNumbers::s_IOSYMBOL) {
    get(y);
    acc.add(y.value().chars());
  } else {
    Alias<ISource> iso(inputFunction(y));
    acc.add(y.value().chars());
    bool first = true;
    while(!iso().eoi()) {
      if(!first) acc.add(',');
      ((IISource &)iso.access()).getAnything(acc);
    };
  };
};