GithubHelp home page GithubHelp logo

jackyansongli / algorithm2e-texmacs Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 53 KB

A modified TeXmacs algorithm environment that can render the line number properly

Tcl 27.89% TypeScript 72.11%

algorithm2e-texmacs's Introduction

Algorithm2e-TeXmacs

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 $\texttt{if}$, $\texttt{while}$ are not numbered.

This package provides a simple modification of the TeXmacs/Mogan algorithm environment to achieve proper numbered line.

We provide a template $\texttt{algo2e-template.tm}$, the user can copy and modify the template.

Algorithm2e-TeXmacs

Installation

In Unix-Like System, run the following command on Bash/Zsh:

cd ~/.TeXmacs/packages/ && git clone [email protected]:JackYansongLi/algorithm2e-texmacs.git

If you are using Mogan instead of TeXmacs, run the following command instead

cd ~/.Xmacs/packages/ && git clone [email protected]:JackYansongLi/algorithm2e-texmacs.git

In Windows, drag the .ts file to the $\texttt{package}$ subfolder where the TeXmacs/Mogan is installed.

Usage

To activate this package, select the following command in taskbar: $\texttt{Document} \rightarrow \texttt{Style}\rightarrow \texttt{Add Package}\rightarrow \texttt{Algorithm-2e}\rightarrow \texttt{{algorithm-2e}}$.

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{Algorithm}$ environment. The following command must be put inside the $\texttt{numbered}$ sub-environment inside the $\texttt{Algorithm}$ environment. To activate the $\texttt{numbered}$ sub-environment, simply type $\texttt{\numbered}$ inside the Algorithm environment and hit $\texttt{Enter}$

  • $\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 $\texttt{Enter}$. Once the $\texttt{Enter}$ is hit, you will see something like $\texttt{<algo2e-if<|>>}$. Insert anything such as $\texttt{<algo2e-if<a|b>>}$ in the template and hit $\texttt{Enter}$ again, you will see the rendered text. When you see the rendered text, hit $\texttt{Enter}$ again to properly render the line number. The line number will not be properly rendered if you do not type this extra $\texttt{Enter}$.

If the above procedure confuses you, simply copy and paste the part you needed in $\texttt{algo2e-template.tm}$ to your own project. This is what WYSIWYG supposed to provide!

algorithm2e-texmacs's People

Contributors

jackyansongli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.