Exemplo n.º 1
0
static void set_tab_compilation_settings(GuPrefsGui* prefs)
{
  /* Setting available typesetters and the active one */
  /* TODO: iterate the available typesetter list and gtk_builder the objects
   * maybe.. or not.. */


  if (pdflatex_detected()) {
    if (pdflatex_active())
      gtk_toggle_button_set_active(prefs->typ_pdflatex, TRUE);
    gtk_widget_set_sensitive(GTK_WIDGET(prefs->typ_pdflatex), TRUE);
    gtk_widget_set_tooltip_text(GTK_WIDGET(prefs->typ_pdflatex), "");
  }

  if (xelatex_detected()) {
    if (xelatex_active())
      gtk_toggle_button_set_active(prefs->typ_xelatex, TRUE);
    gtk_widget_set_sensitive(GTK_WIDGET(prefs->typ_xelatex), TRUE);
    gtk_widget_set_tooltip_text(GTK_WIDGET(prefs->typ_xelatex), "");
  }

  if (rubber_detected()) {
    if (rubber_active())
      gtk_toggle_button_set_active(prefs->typ_rubber, TRUE);
    gtk_widget_set_sensitive(GTK_WIDGET(prefs->typ_rubber), TRUE);
    gtk_widget_set_tooltip_text(GTK_WIDGET(prefs->typ_rubber), "");
  }

  if (latexmk_detected()) {
    if (latexmk_active())
      gtk_toggle_button_set_active(prefs->typ_latexmk, TRUE);
    gtk_widget_set_sensitive(GTK_WIDGET(prefs->typ_latexmk), TRUE);
    gtk_widget_set_tooltip_text(GTK_WIDGET(prefs->typ_latexmk), "");
  }

  if (latex_method_active("texpdf")) {
    gtk_toggle_button_set_active(prefs->method_texpdf, TRUE);
  } else if (latex_method_active("texdvipdf")) {
    gtk_toggle_button_set_active(prefs->method_texdvipdf, TRUE);
  } else if (latex_method_active("texdvipspdf")) {
    gtk_toggle_button_set_active(prefs->method_texdvipspdf, TRUE);
  }

  if (!latex_use_shellescaping())
    gtk_toggle_button_set_active(prefs->opt_shellescape, FALSE);
  else {
    gtk_toggle_button_set_active(prefs->opt_shellescape, TRUE);
  }

  if (latex_can_synctex()) {
    if (config_get_value("synctex")) {
      gtk_toggle_button_set_active(prefs->opt_synctex, TRUE);
    } else {
      gtk_toggle_button_set_active(prefs->opt_synctex, FALSE);
    }
  }
}
Exemplo n.º 2
0
Arquivo: texlive.c Projeto: sygi/gummi
gchar* texlive_get_command (const gchar* method, gchar* workfile, gchar* basename) {
    slog(L_INFO, "texlive_get_command. workfile: %s, basename: %s\n", workfile, basename);
    const gchar* outdir = g_strdup_printf("-output-directory=\"%s\"", C_TMPDIR);


    gchar *typesetter = NULL;
    gchar *texcmd = NULL;

    if (pdflatex_active()) typesetter = C_PDFLATEX;
    else typesetter = C_XELATEX;

    gchar *flags = texlive_get_flags("texpdf");

    gchar *dviname = g_strdup_printf("%s.dvi", g_path_get_basename (basename));
    gchar *psname = g_strdup_printf("%s.ps", g_path_get_basename (basename));

    #ifdef WIN32
    gchar *script = g_build_filename (GUMMI_LIBS, "latex_dvi.cmd", NULL);
    #else
    gchar *script = g_build_filename (GUMMI_LIBS, "latex_dvi.sh", NULL);
    #endif

    if (STR_EQU (method, "texpdf")) {
        slog(L_INFO, "texpdf method\n");
        texcmd = g_strdup_printf("%s %s %s \"%s-new\"", typesetter,
                                                flags,
                                                outdir,
                                                workfile);
    } else if (STR_EQU (method, "texdvipdf")) {
        texcmd = g_strdup_printf("%s pdf "
                "\"%s\" \"%s\" \"%s\" \"%s\" \"%s\"", script,
                flags, outdir, workfile, C_TMPDIR, dviname);
    } else {
        texcmd = g_strdup_printf("%s ps "
                "\"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"", script,
                flags, outdir, workfile, C_TMPDIR, dviname, psname);
    }

    g_free(script);
    g_free(dviname);
    g_free(psname);

    slog(L_INFO, "Command: %s\n", texcmd);

    return texcmd;
}
Exemplo n.º 3
0
Arquivo: texlive.c Projeto: sygi/gummi
gboolean texlive_active (void) {
    if (pdflatex_active() || xelatex_active()) {
        return TRUE;
    }
    return FALSE;
}