7 |
% 2 add a figure plus caption (see myFig) |
% 2 add a figure plus caption (see myFig) |
8 |
% 3 add a paragraph |
% 3 add a paragraph |
9 |
% 4 finish file |
% 4 finish file |
10 |
% 5 compile and remove temporary files (incl. *fig*.ps) |
% 5 compile (latex x 2 then dvipdf) |
11 |
% -5 compile solely |
% 6 remove temporary files (incl. *fig*.ps) |
12 |
%optional myText is a cell array of text lines (for myStep=1 to 2) |
%optional myText is a cell array of text lines (for myStep=1 to 2) |
13 |
% myLev is the title level (for myStep=1) |
% myLev is the title level (for myStep=1) |
14 |
% 1=section, 2=subsection (not yet implemented) |
% 1=section, 2=subsection (not yet implemented) |
25 |
end; |
end; |
26 |
|
|
27 |
|
|
28 |
myText=[]; myLev=[]; myFig=[]; |
myText=[]; myLev=[]; myFig=[]; myRdm=[]; |
29 |
if myStep<4; myText=varargin{1}; end; |
if myStep<4; myText=varargin{1}; end; |
30 |
if myStep==1; myLev=varargin{2}; |
if myStep==0; myRdm=varargin{2}; |
31 |
|
elseif myStep==1; myLev=varargin{2}; |
32 |
elseif myStep==2; myFig=varargin{2}; |
elseif myStep==2; myFig=varargin{2}; |
33 |
end; |
end; |
34 |
|
|
48 |
fprintf(fid,'\\documentclass[12pt]{beamer}\n'); |
fprintf(fid,'\\documentclass[12pt]{beamer}\n'); |
49 |
fprintf(fid,'%%a nice series of examples for the beamer class:\n'); |
fprintf(fid,'%%a nice series of examples for the beamer class:\n'); |
50 |
fprintf(fid,'%%http://www.informatik.uni-freiburg.de/~frank/ENG/beamer/example/beamer-class-example-en-5.html\n'); |
fprintf(fid,'%%http://www.informatik.uni-freiburg.de/~frank/ENG/beamer/example/beamer-class-example-en-5.html\n'); |
51 |
|
fprintf(fid,'\\usepackage{multicol}\n'); |
52 |
|
|
53 |
|
fprintf(fid,'\n'); |
54 |
|
fprintf(fid,'\\newcommand\\Fontvi{\\fontsize{6}{7.2}\\selectfont}\n'); |
55 |
|
fprintf(fid,'\n'); |
56 |
|
|
57 |
fprintf(fid,'\\begin{document} \n\n'); |
fprintf(fid,'\\begin{document} \n\n'); |
58 |
|
|
59 |
fprintf(fid,'\\title{\n'); |
fprintf(fid,'\\title{\n'); |
62 |
fprintf(fid,'\\date{\\today}\n\n'); |
fprintf(fid,'\\date{\\today}\n\n'); |
63 |
fprintf(fid,'\\frame{\\titlepage}\n\n'); |
fprintf(fid,'\\frame{\\titlepage}\n\n'); |
64 |
|
|
65 |
fprintf(fid,'\\frame{'); |
fprintf(fid,'\\frame{\n'); |
66 |
fprintf(fid,'\\frametitle{Table of contents}'); |
fprintf(fid,'\\frametitle{Table of contents}\n'); |
67 |
fprintf(fid,'\\tableofcontents'); |
fprintf(fid,'\\begin{multicols}{2}\n'); |
68 |
|
fprintf(fid,'\\Fontvi\n'); |
69 |
|
fprintf(fid,'\\tableofcontents\n'); |
70 |
|
fprintf(fid,'\\end{multicols}\n'); |
71 |
fprintf(fid,'} \n\n'); |
fprintf(fid,'} \n\n'); |
72 |
|
|
73 |
|
if ~isempty(myRdm); |
74 |
|
fprintf(fid,'\\frame{\n'); |
75 |
|
fprintf(fid,'\\section{README}\n'); |
76 |
|
fprintf(fid,'\\Fontvi\n'); |
77 |
|
for pp=1:length(myRdm); |
78 |
|
fprintf(fid,[myRdm{pp} '\n\n']); |
79 |
|
end; |
80 |
|
fprintf(fid,'} \n\n'); |
81 |
|
end; |
82 |
|
|
83 |
fclose(fid); |
fclose(fid); |
84 |
end; |
end; |
85 |
myFigNumTex=0; |
myFigNumTex=0; |
106 |
figure(myFig); |
figure(myFig); |
107 |
drawnow; |
drawnow; |
108 |
myFigNumTex=myFigNumTex+1; |
myFigNumTex=myFigNumTex+1; |
109 |
nn=strfind(myFile,'/'); |
nn=strfind(myFile,filesep); |
110 |
if ~isempty(nn); |
if ~isempty(nn); |
111 |
dirTex=myFile(1:nn(end)); fileTex=myFile(nn(end)+1:end-4); |
dirTex=myFile(1:nn(end)); fileTex=myFile(nn(end)+1:end-4); |
112 |
else; |
else; |
144 |
eval(['save ' myFile(1:end-4) '.mat myFigNumTex mySection;']); |
eval(['save ' myFile(1:end-4) '.mat myFigNumTex mySection;']); |
145 |
|
|
146 |
%compile |
%compile |
147 |
if myStep==5|myStep==-5; |
if myStep==5; |
148 |
dirOrig=pwd; |
dirOrig=pwd; |
149 |
nn=strfind(myFile,'/'); |
nn=strfind(myFile,filesep); |
150 |
if ~isempty(nn); |
if ~isempty(nn); |
151 |
cd(myFile(1:nn)); fileTex=myFile(nn+1:end-4); |
cd(myFile(1:nn(end))); fileTex=myFile(nn(end)+1:end-4); |
152 |
else; |
else; |
153 |
fileTex=myFile(1:end-4); |
fileTex=myFile(1:end-4); |
154 |
end; |
end; |
155 |
eval(['!latex ' fileTex]); |
system(['latex ' fileTex]); |
156 |
eval(['!latex ' fileTex]); |
system(['latex ' fileTex]); |
157 |
eval(['!dvipdf ' fileTex]); |
system(['dvipdf ' fileTex]); |
158 |
cd(dirOrig); |
cd(dirOrig); |
159 |
end; |
end; |
160 |
|
|
161 |
|
|
162 |
%compile |
%compile |
163 |
if myStep==5; |
if myStep==6&ispc; |
164 |
|
fprintf('warning : compiling tex to pdf is bypassed on PCs\n'); |
165 |
|
end; |
166 |
|
|
167 |
|
if myStep==6&~ispc; |
168 |
dirOrig=pwd; |
dirOrig=pwd; |
169 |
nn=strfind(myFile,'/'); |
nn=strfind(myFile,filesep); |
170 |
if ~isempty(nn); |
if ~isempty(nn); |
171 |
cd(myFile(1:nn)); fileTex=myFile(nn+1:end-4); |
cd(myFile(1:nn(end))); fileTex=myFile(nn(end)+1:end-4); |
172 |
else; |
else; |
173 |
fileTex=myFile(1:end-4); |
fileTex=myFile(1:end-4); |
174 |
end; |
end; |
175 |
eval(['!\rm -f ' fileTex '.fig*']); |
delete([fileTex '.fig*']); |
176 |
eval(['!\rm -f ' fileTex '.aux']); |
delete([fileTex '.aux']); |
177 |
eval(['!\rm -f ' fileTex '.log']); |
delete([fileTex '.log']); |
178 |
eval(['!\rm -f ' fileTex '.out']); |
delete([fileTex '.out']); |
179 |
eval(['!\rm -f ' fileTex '.dvi']); |
delete([fileTex '.dvi']); |
180 |
cd(dirOrig); |
cd(dirOrig); |
181 |
end; |
end; |