Monday, October 29, 2012

Algorithm package of LaTeX


\subsubsection{group 1 : rename/move}
\caption{Euclid's algorithm}\label{euclid}
\Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}
   \State $r\gets a\bmod b$
   \While{$r\not=0$}\Comment{We have the answer if r is 0}
      \State $a\gets b$
      \State $b\gets r$
      \State $r\gets a\bmod b$
   \State \textbf{return} $b$\Comment{The gcd is b}
Screen Shot 2012 10 29 at 10 02 37 PM

Algorithm2e package of LaTeX


 \KwData{this text}
 \KwResult{how to write algorithm with \LaTeX2e }
 \While{not at end of this document}{
  read current\;
   go to next section\;
   current section becomes this one\;
   go back to the beginning of current section\;
 \caption{How to write algorithms}
Screen Shot 2012 10 29 at 10 00 07 PM


  2. Algorithms in Latex

Adding local git repository to remote server

When you have a remote repository in bitbucket, you need to push the local repository for the first time.
You can use git remote add "BRANCH", to add the branch, and then push it.
git remote add origin ssh://
git push -u origin master   # to push changes for the first time

After this, you'll find that the config file in .git has the new section.
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
[remote "origin"]
	url = ssh://
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

Writing a paper with LaTeX

Writing a paper accompanies bibliography, and it makes the $latex:\LaTeX$ compilation process a little more complicated.
In short, one needs to three LaTeX compilation, and one bibtex compilation.
latex refvalidator.tex
bibtex refvalidator
latex refvalidator.tex
latex refvalidator.tex # resolve all the references
dvipdfmx refvalidator.dvi
You can use \cite{} for citation, and you can have the bibliography style and bibliography for correct referencing.
You don't need \section as it will be generated automatically.