~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to src/Data/Convert/Tex/fromtex.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2008-04-06 15:11:41 UTC
  • mfrom: (1.1.7 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080406151141-w0sg20jnv86mlt6f
Tags: 1:1.0.6.14-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* 01_american.dpatch is updated
* Since thread support in guile-1.8 is now disabled, the segmentation faults
  should not arise anymore. More info at #439923. (Closes: #450499, #458685)
[kohda]
* This version fixed menu problem.  (Closes: #447083)
* Reverted orig.tar.gz to the upstream tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
#define t2e parsed_text_to_tree
70
70
#define m2e latex_modifier_to_tree
71
71
#define var_m2e var_latex_modifier_to_tree
 
72
#define v2e latex_verbarg_to_string
72
73
tree l2e (tree);
73
74
tree latex_command_to_tree (tree t);
74
75
 
377
378
               tree (RESET, copy (var)));
378
379
}
379
380
 
380
 
tree
381
 
latex_verbarg_to_tree (tree t) {
382
 
  t= l2e (t);
383
 
  if (is_concat (t)) {
384
 
    string s;
385
 
    int i, n= N(t);
386
 
    for (i=0; i<n; i++)
387
 
      if (is_atomic (t[i])) s << t[i]->label;
388
 
      else if (is_func (t[i], RSUB, 1) && is_atomic (t[i][0]))
389
 
        s << "_" << t[i][0]->label;
390
 
    return s;
391
 
  }
392
 
  else return "";
 
381
string
 
382
v2e (tree t) {
 
383
  return string_arg (t2e (t, false));
393
384
}
394
385
 
395
386
static bool
639
630
  }
640
631
  if (is_tuple (t, "\\cite", 1) || is_tuple (t, "\\nocite", 1)) {
641
632
    string cite_type= t[0]->label (1, N(t[0]->label));
642
 
    string s= string_arg (t2e(t[1]));
 
633
    string s= v2e (t[1]);
643
634
    return latex_cite_to_tree (cite_type, s);
644
635
  }
645
636
  if (is_tuple (t, "\\cite*", 2)) {
646
637
    tree   ot= t2e(t[1])->label;
647
 
    string s = string_arg (t2e(t[2]));
 
638
    string s = v2e (t[2]);
648
639
    tree   ct= latex_cite_to_tree ("cite", s);
649
640
    if (N(ct) == 2) return compound ("cite-detail", ct[1], ot);
650
641
    return tree (CONCAT, ct, " (", ot, ")");
665
656
      if (cite_type == "citep") cite_type= "cite-parenthesized" * star;
666
657
      if (cite_type == "citealt") cite_type= "cite-raw" * star;
667
658
      if (cite_type == "citealp") cite_type= "cite-raw" * star;
668
 
      string s= string_arg (t2e(t[1]));
 
659
      string s= v2e (t[1]);
669
660
      return latex_cite_to_tree (cite_type, s);
670
661
    }
671
662
  if (is_tuple (t, "\\citetext", 1))
676
667
    textm_natbib= true; return compound ("cite-author*-link", t2e (t[1])); }
677
668
  if (is_tuple (t, "\\citeyear", 1)) {
678
669
    textm_natbib= true; return compound ("cite-year-link", t2e (t[1])); }
 
670
  if (is_tuple (t, "\\bibitem", 1))
 
671
    return compound ("bibitem", v2e (t[1]));
 
672
  if (is_tuple (t, "\\bibitem*", 2))
 
673
    return compound ("bibitem*", v2e (t[1]), v2e (t[2]));
679
674
  if (is_tuple (t, "\\index", 1)) {
680
 
    string s= string_arg (t2e (t[1]));
 
675
    string s= v2e (t[1]);
681
676
    return latex_index_to_tree (s);
682
677
  }
683
678
  if (is_tuple (t, "\\displaylines", 1)) {
692
687
    return r;
693
688
  }
694
689
  if (is_tuple (t, "\\includegraphics", 1)) {
695
 
    tree name= latex_verbarg_to_tree (t[1]);
 
690
    tree name= v2e (t[1]);
696
691
    if (name == "") return "";
697
692
    else {
698
693
      tree g (POSTSCRIPT, 7);