The original algorithm environment in TeXmacs and Mogan (A distribution of TeXmacs) does not provide a proper numbered line. For example, the lines of conditional commands such as
This package provides a simple modification of the TeXmacs/Mogan algorithm environment to achieve proper numbered line.
We provide a template
In Unix-Like System, run the following command on Bash/Zsh:
cd ~/.TeXmacs/packages/ && git clone git@github.com:JackYansongLi/algorithm2e-texmacs.git
If you are using Mogan instead of TeXmacs, run the following command instead
cd ~/.Xmacs/Library/Application Support/XmacsLabs/packages/ && git clone git@github.com:JackYansongLi/algorithm2e-texmacs.git
In Windows, drag the .ts file to the
To activate this package, select the following command in taskbar:
Once the package is activated, The following macros are provided:
$\texttt{algo2e-input}$ $\texttt{algo2e-output}$
The above two macros can be put anywhere inside the
$\texttt{algo2e-while}$ $\texttt{algo2e-for}$ $\texttt{algo2e-if}$ $\texttt{algo2e-else}$ $\texttt{algo2e-else-if}$ $\texttt{algo2e-end-if}$
To use the macro, simply type \ followed by the name of the macro and hit
If the above procedure confuses you, simply copy and paste the part you needed in