Monday, May 18, 2015

Strikethrough package in Latex

\documentclass[a4paper]{article}
% package for strike through
\usepackage{ulem}
\usepackage{xcolor}
\definecolor{darkgreen}{rgb}{0,0.4,0}

\begin{document}

...

\textcolor{red}{\sout{something has to be struck out}}

\textcolor{blue}{something has been added}

\textcolor{darkgreen}{something has been updated}

...


\end{document}
Read more ...

Monday, May 4, 2015

Convert MATLAB history.m to History.xml

Link.


fid = fopen('history.m');

% Create the document node and the root element, 'history'
docNode = com.mathworks.xml.XMLUtils.createDocument('history');
% Get the history node
history = docNode.getDocumentElement;
% Read the first line of the old history.m file
line = fgetl(fid);

% Loop through every line of the old history.m file while there are lines
while ischar(line)
% Add a command element for each command
command = docNode.createElement('command');
% Add the command itself as the child text node
command.appendChild(docNode.createTextNode(line));
% Add the command node back as a child of the command node
history.appendChild(command);
% Get the next line of the old history.m file
line = fgetl(fid);
end

% Close the file
fclose(fid);

% Write the XML file
xmlwrite('History.xml',docNode);
Read more ...