3

I need to write below latex algorithm using windows words, How I can do that?

\documentclass{article}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}% http://ctan.org/pkg/algorithm2e
\DontPrintSemicolon
\begin{document}

\begin{algorithm}
\KwIn{$a$, $b$, $c$, $d$}
\KwOut{$e$, $r$}
Calculate~$x$ and~$y$\;
\lIf{$k \geq n$}{$m_2$}\;
\lIf{$h \geq j$}{$m_1$}\;
\Else{%
\Repeat{$|a(i+1)-a(i)| < \epsilon$}{%
  Initialisation: $g(0) = nj$\;\label{stepA}
  $i=0$\;
  Compute~$n_2$
  \[
    n(i) = \frac{a}{b(i)\sqrt{3v}}
  \]
  \nl Update~$b$
  \[
    b(i+1) = (-\frac{1}{2(g(i)/D} + 1)
  \]
  \nl $i = i + 1$\;
  }
 }
 \caption{My algorithm}
\label{algo:b}
\end{algorithm}

\end{document}

enter image description here

4
  • 1
    Why not using LaTeX and if you want to use MS work just copy-paste the pictures of it? Commented Jun 16, 2014 at 7:02
  • @RomainPicot it is not acceptable becasue the picture is not clear
    – Harry
    Commented Jun 16, 2014 at 7:03
  • I'm not a MSword user so would be difficult for me to help you for the conversion. But you know what I'll do. Cleared the result to paste it. Anyway someone else could have a better solution. Commented Jun 16, 2014 at 7:06
  • Maybe tex4ht could be configured to support algorhitm package, but don't expect to preserve exact formatting and appearance as in pdf
    – michal.h21
    Commented Jun 16, 2014 at 8:37

0

Browse other questions tagged .