Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/examples/dynamic/mk_collage_from_clqs.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function mk_collage_from_clqs(dir, cliques) | |
2 | |
3 % For use with mk_ps_from_clqs. | |
4 % This generates a latex file that glues all the .ps files | |
5 % into one big figure. | |
6 | |
7 cd(dir) | |
8 C = length(cliques); | |
9 | |
10 ncols = 4; | |
11 width = 1.5; | |
12 fid = fopen('collage.tex', 'w'); | |
13 fprintf(fid, '\\documentclass{article}\n'); | |
14 fprintf(fid, '\\usepackage{psfig}\n'); | |
15 fprintf(fid, '\\begin{document}\n'); | |
16 fprintf(fid, '\\centerline{\n'); | |
17 fprintf(fid, '\\begin{tabular}{'); | |
18 for col=1:ncols, fprintf(fid, 'c'); end | |
19 fprintf(fid, '}\n'); | |
20 c = 1; | |
21 for row = 1:floor(C/ncols) | |
22 for col=1:ncols-1 | |
23 fname = sprintf('%s/clq%d.ps', dir, c); | |
24 fprintf(fid, '\\psfig{file=%s,width=%3fin} & \n', fname, width); | |
25 c = c + 1; | |
26 end | |
27 fname = sprintf('%s/clq%d.ps', dir, c); | |
28 fprintf(fid, '\\psfig{file=%s,width=%3fin} \\\\ \n', fname, width); | |
29 c = c + 1; | |
30 end | |
31 % last row | |
32 while (c <= C) | |
33 fname = sprintf('%s/clq%d.ps', dir, c); | |
34 fprintf(fid, '\\psfig{file=%s,width=%3fin} & \n', fname, width); | |
35 c = c + 1; | |
36 end | |
37 fprintf(fid, '\\end{tabular}\n'); | |
38 fprintf(fid, '}\n'); | |
39 fprintf(fid, '\\end{document}'); | |
40 fclose(fid); | |
41 | |
42 !latex collage.tex & | |
43 !dvips -o collage.ps collage.dvi & | |
44 !ghostview collage.ps & |