Daniel@0: function mk_collage_from_clqs(dir, cliques) Daniel@0: Daniel@0: % For use with mk_ps_from_clqs. Daniel@0: % This generates a latex file that glues all the .ps files Daniel@0: % into one big figure. Daniel@0: Daniel@0: cd(dir) Daniel@0: C = length(cliques); Daniel@0: Daniel@0: ncols = 4; Daniel@0: width = 1.5; Daniel@0: fid = fopen('collage.tex', 'w'); Daniel@0: fprintf(fid, '\\documentclass{article}\n'); Daniel@0: fprintf(fid, '\\usepackage{psfig}\n'); Daniel@0: fprintf(fid, '\\begin{document}\n'); Daniel@0: fprintf(fid, '\\centerline{\n'); Daniel@0: fprintf(fid, '\\begin{tabular}{'); Daniel@0: for col=1:ncols, fprintf(fid, 'c'); end Daniel@0: fprintf(fid, '}\n'); Daniel@0: c = 1; Daniel@0: for row = 1:floor(C/ncols) Daniel@0: for col=1:ncols-1 Daniel@0: fname = sprintf('%s/clq%d.ps', dir, c); Daniel@0: fprintf(fid, '\\psfig{file=%s,width=%3fin} & \n', fname, width); Daniel@0: c = c + 1; Daniel@0: end Daniel@0: fname = sprintf('%s/clq%d.ps', dir, c); Daniel@0: fprintf(fid, '\\psfig{file=%s,width=%3fin} \\\\ \n', fname, width); Daniel@0: c = c + 1; Daniel@0: end Daniel@0: % last row Daniel@0: while (c <= C) Daniel@0: fname = sprintf('%s/clq%d.ps', dir, c); Daniel@0: fprintf(fid, '\\psfig{file=%s,width=%3fin} & \n', fname, width); Daniel@0: c = c + 1; Daniel@0: end Daniel@0: fprintf(fid, '\\end{tabular}\n'); Daniel@0: fprintf(fid, '}\n'); Daniel@0: fprintf(fid, '\\end{document}'); Daniel@0: fclose(fid); Daniel@0: Daniel@0: !latex collage.tex & Daniel@0: !dvips -o collage.ps collage.dvi & Daniel@0: !ghostview collage.ps &