Back to index

texmacs  1.0.7.15
Functions
tex_init.cpp File Reference
#include "boot.hpp"
#include "file.hpp"
#include "path.hpp"
#include "sys_utils.hpp"
#include "convert.hpp"
#include "tex_files.hpp"

Go to the source code of this file.

Functions

static void init_helper_binaries ()
static void search_sub_dirs_sub (url base, url u, url &tfm, url &pk, url &pfb, int status)
static void search_sub_dirs (url root, url &tfm, url &pk, url &pfb)
static void init_heuristic_tex_paths ()
void setup_tex ()
void init_tex ()

Function Documentation

static void init_helper_binaries ( ) [static]

Definition at line 24 of file tex_init.cpp.

                        {
  if (exists_in_path ("kpsepath")) {
    cerr << "TeXmacs] kpsepath works with your TeX distribution\n";
    set_setting ("KPSEPATH", "true");
  }
  else set_setting ("KPSEPATH", "false");

  if (exists_in_path ("kpsewhich")) {
    cerr << "TeXmacs] kpsewhich works with your TeX distribution\n";
    set_setting ("KPSEWHICH", "true");
  }
  else set_setting ("KPSEWHICH", "false");

  if (exists_in_path ("mktextfm")) {       
   cerr << "TeXmacs] mktextfm works with your TeX distribution\n";     
   set_setting ("MAKETFM", "mktextfm");    
  }     
  else if (exists_in_path ("MakeTeXTFM")) {       
    cerr << "TeXmacs] MakeTeXTFM works with your TeX distribution\n";         
    set_setting ("MAKETFM", "MakeTeXTFM");        
  }     
  else if (exists_in_path ("maketfm")){    
    cerr << "TeXmacs] maketfm works with your TeX distribution\n";     
    set_setting ("MAKETFM", "maketfm");    
  }     
  else set_setting ("MAKETFM", "false");
  
  if (exists_in_path ("mktexpk")) {        
    cerr << "TeXmacs] mktexpk works with your TeX distribution\n";     
    set_setting ("MAKEPK", "mktexpk");     
  }     
  else if (exists_in_path ("MakeTeXPK")) {        
    cerr << "TeXmacs] MakeTeXPK works with your TeX distribution\n";   
    set_setting ("MAKEPK", "MakeTeXPK");   
  }     
  else if (exists_in_path ("makepk")){     
    cerr << "TeXmacs] makepk works with your TeX distribution\n";      
    set_setting ("MAKEPK", "makepk");      
  }     
  else set_setting ("MAKEPK", "false");

  if (exists_in_path ("texhash")) {        
    cerr << "TeXmacs] texhash works with your TeX distribution\n";     
    set_setting ("TEXHASH", "true");       
  }     
  else set_setting ("TEXHASH", "false");
  
  set_setting ("DPI", "600");
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void init_heuristic_tex_paths ( ) [static]

Definition at line 113 of file tex_init.cpp.

                            {
  url tfm= url_none (), pk= url_none (), pfb= url_none ();

  // Try some 'standard' directories
#ifdef OS_WIN32
  tfm= search_sub_dirs ("$TEX_HOME/fonts/tfm");
  pk = search_sub_dirs ("$TEX_HOME/fonts/pk");
  pfb= search_sub_dirs ("$TEX_HOME/fonts/type1");
#else
  search_sub_dirs ("/opt/local/share/texmf-texlive-dist/fonts", tfm, pk, pfb);
  search_sub_dirs ("/usr/lib/tetex/fonts", tfm, pk, pfb);
  search_sub_dirs ("/usr/lib/texmf/fonts", tfm, pk, pfb);
  search_sub_dirs ("/usr/local/lib/texmf/fonts", tfm, pk, pfb);
  search_sub_dirs ("/usr/share/texmf/fonts", tfm, pk, pfb);
  search_sub_dirs ("/usr/TeX/lib/texmf/fonts", tfm, pk, pfb);
  search_sub_dirs ("/var/texfonts", tfm, pk, pfb);
  search_sub_dirs ("/var/tmp/texfonts", tfm, pk, pfb);
#endif

#ifdef OS_WIN32
  set_setting ("TFM", as_string (tfm));
  set_setting ("PK" , as_string (pk ));
  set_setting ("PFB", as_string (pfb));
#else
  set_setting ("TFM", as_string (expand (factor (tfm))));
  set_setting ("PK" , as_string (expand (factor (pk ))));
  set_setting ("PFB", as_string (expand (factor (pfb))));
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void init_tex ( )

Definition at line 155 of file tex_init.cpp.

            {
  reset_tfm_path (false);
  reset_pk_path (false);
  reset_pfb_path ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void search_sub_dirs ( url  root,
url tfm,
url pk,
url pfb 
) [static]

Definition at line 96 of file tex_init.cpp.

                                                        {
  url dirs= complete (root * url_wildcard (), "dr");
  if (!is_none (dirs)) {
    cerr << "TeXmacs] found TeX directory " << root << "\n";
    search_sub_dirs_sub (url_here (), dirs, tfm, pk, pfb, 0);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void search_sub_dirs_sub ( url  base,
url  u,
url tfm,
url pk,
url pfb,
int  status 
) [static]

Definition at line 79 of file tex_init.cpp.

                                                                               {
  if (is_concat (u)) {
    if (u[1] == "tfm") status= 1;
    if (u[1] == "pk" ) status= 2;
    if (u[1] == "pfb" || u[1] == "type1") status= 3;
    search_sub_dirs_sub (base * u[1], u[2], tfm, pk, pfb, status);
  }
  if (is_or (u)) {
    search_sub_dirs_sub (base, u[2], tfm, pk, pfb, status);
    search_sub_dirs_sub (base, u[1], tfm, pk, pfb, status);
  }
  if ((status == 1) || (u == "tfm")) tfm= (base * u) | tfm;
  if ((status == 2) || (u == "pk" )) pk = (base * u) | pk;
  if ((status == 3) || (u == "pfb") || (u == "pfb")) pfb = (base * u) | pfb;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void setup_tex ( )

Definition at line 148 of file tex_init.cpp.

             {
  remove ("$TEXMACS_HOME_PATH/fonts/font-index.scm");
  init_helper_binaries ();
  init_heuristic_tex_paths ();
}

Here is the call graph for this function:

Here is the caller graph for this function: