Code covered by the BSD License  

Highlights from
publish2latex

image thumbnail

publish2latex

by

 

09 Apr 2013 (Updated )

Using full Latex markup in m-files to generate high quality documentation. Version 1.3

publish2latex.m
%
% This is a simpel menue program to run the publish2latex tools
%
% (C) Paul O'Leary and Matthew Harker 2012
%
close all;
clear all;
%
stop = false;
fileDefined = false;
latexGenerated = false;
TOCRequired = true;
%
% Start the menu
%
while ~stop
    choice = menu( 'P2L Version 1.0', ...
        'Generate Latex file','Publish to PDF','Tidy up files','Exit');
    switch choice
        case {1}
            %
            % generate the .tex file
            %
            if ~fileDefined
                fObj = RequiredFilesClass();
                fileDefined = true;
            end;
            %
            fObj.TOCRequired = TOCRequired ;
            generateLatex( fObj );
            latexGenerated = true;
            %
        case {2}
            %
            % run the complete process including generating the pdf
            %
            if ~fileDefined
                fObj = RequiredFilesClass();
                fileDefined = true;
            end;
            %
            if ~latexGenerated
                fObj.TOCRequired = TOCRequired ;
                generateLatex( fObj );
                latexGenerated = true;
            end;
            %
            if latexGenerated
                runLatex( fObj );
            end;
            fileDefined = false;
            %
        case {3}
            %
            % tidy up the directory
            %
            if latexGenerated
                tempDir = cd;
                cd(fObj.mPath);
                cd
                delete( [fObj.publishName, '.aux'] );
                delete( [fObj.publishName, '.bbl'] );
                delete( [fObj.publishName, '.blg'] );
                delete( [fObj.publishName, '.dvi'] );
                delete( [fObj.publishName, '.log'] );
                delete( [fObj.publishName, '.tex'] );
                delete( [fObj.publishName, '.toc'] );
                delete( [fObj.publishName, '.ps'] );
                rmdir( [fObj.publishName, 'Figures'],'s');
                cd( tempDir );
                fileDefined = false;
            end;
        case {4}
            return;
    end;
end;

Contact us