Code covered by the BSD License
- addSectionAt( generatedFi...
- analyzeCellLines( cellLin...% Purpose : This function analyses a cell from the m file to determine the
- charArray2cells( stringAr...% Purpose : Convert a character array to a cell array
- convertCellLines( cellLin...
- epscombine( eps1 , eps2 ,...
- figure2eps(H,fileName, ma...
- generateLatex( fObjPOL )
% Purpose : Give the object defining the necessary files, this procedure
- imagefigure( imageIn, map...
- mFileCells( fileLines )
% Purpose : This function identified the segments the .m file which
- prepareMCode( codeLines )
% Purpose : This function modifies the m code to be execture to ensure that
- printFigure(H,FileName,Fo...% Description: Function to print a figure to disk
- publishFigureFormat
- readInTextFile( filePath,...
- removeLatexMarker( line )
% Purpose : Remove the comment marker form a line
- runLatex( fObj )
% Purpose : This file runs the latex environment to generate all the files
- siamFigure;
% Special Settings for normal figures
- siamFigureSmall
% Special Settings for normal figures
- writeOutFile( fileLines, ...% Purpose : Give a cell array of file lines, this function writes out the
- RequiredFilesClass
- HarkerOleary.m
- Introduction.m
- convert.m
- dopHeader.m
- publish2latex.m
- publishTemplate.m
-
View all files
from
publish2latex
by Matthew Harker, Paul O'Leary,
Using full Latex markup in m-files to generate high quality documentation.
Version 1.3
|
| analyzeCellLines( cellLines )
|
function [preCodeLatex, codeLines, postCodeLatex] = analyzeCellLines( cellLines )
%
% Purpose : This function analyses a cell from the m file to determine the
% pre-m-code text, the m-code and the post-m-code text.
%
% Use (syntax):
%
% Input Parameters :
% cellLines
%
% Return Parameters :
% preCodeLatex
% codeLines
% postCodeLatex
%
% Author : Matther Harker and Paul O'Leary
% Date : 29. Jan 2013
% Version : 1.0
%
% (c) 2013 Matther Harker and Paul O'Leary
% url: www.harkeroleary.org
% email: office@harkeroleary.org
%
% History:
% Date: Comment:
%
noLines = length( cellLines );
allLines = 1:noLines;
%
% the first non-comment is the start of code
%
at = 1;
line = cellLines{at};
while (strcmp( line(1) , '%' )) && (at < noLines );
at = at + 1;
line = cellLines{at};
end;
%
if strcmp( line(1) , '%' )
preCodeLatex = [1:at];
else
preCodeLatex = [1:at-1];
end
%
% Start from the bottom and work back to the first non comment line
%
bot = noLines;
line = cellLines{bot};
if (strcmp( line(1), '%')&&(bot > at))
while (strcmp( line(1) , '%' )) && (bot > 1 );
bot = bot - 1;
line = cellLines{bot};
end;
postCodeLatex = [bot+1:noLines];
else
postCodeLatex = [];
end;
%
nonCodeLines = unique(union(preCodeLatex,postCodeLatex));
codeLines = setdiff( allLines, nonCodeLines );
%
preCodeLatex = setdiff(preCodeLatex,1)';
codeLines = codeLines';
postCodeLatex = postCodeLatex';
|
|
Contact us