Back to index

texmacs  1.0.7.15
struct2bullet.m
Go to the documentation of this file.
00001 function tmp=struct2bullet(n,c)
00002 
00003        if (c==1)
00004               tmp='(itemize-arrow (document ';
00005        else
00006               tmp='(itemize (document ';
00007        end
00008 
00009        FIELDS=fieldnames(n);
00010        for i=1:length(FIELDS)
00011               key=char(FIELDS(i));
00012               val=getfield(n,key);
00013               switch (typeinfo(val))
00014                      case ('struct')
00015                             tmp1=['(concat (item) (with "color" "', 'black', '" "', key, ' = ") ', struct2bullet(val,c+1),')'];
00016                      otherwise
00017                             tmp1=['(concat (item) (with "color" "', 'black', '" "', key, ' = ") ', obj2scm(val),')'];
00018               end
00019               tmp=[tmp,tmp1];
00020        end
00021        tmp=[tmp,'))'];