mirror of
https://github.com/Brandon-Rozek/website.git
synced 2024-12-22 22:20:51 +00:00
New Post
This commit is contained in:
parent
de55c56209
commit
b20ac5208b
2 changed files with 26 additions and 0 deletions
26
content/blog/algorithmiclatex.md
Normal file
26
content/blog/algorithmiclatex.md
Normal file
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
title: "Algorithms in LaTex"
|
||||
date: 2020-05-14T21:31:28-04:00
|
||||
draft: false
|
||||
tags: []
|
||||
---
|
||||
|
||||
There's a great package in LaTex called [`algorithm`](https://ctan.org/pkg/algorithms?lang=en) to help format psuedo-code algorithms for scientific papers. Here's a simple example of its usage:
|
||||
|
||||
```
|
||||
\usepackage{algorithm}
|
||||
\usepackage[noend]{algpseudocode}
|
||||
\begin{algorithm}
|
||||
\caption{Even Numbers}
|
||||
\begin{algorithmic}[1]
|
||||
\State Set variable $evens$ to an empty list.
|
||||
\For {every integer $i$}
|
||||
\If {$i$ is divisible by $2$}
|
||||
\State Add $i$ to $events$ list.
|
||||
\EndIf
|
||||
\EndFor
|
||||
\end{algorithmic}
|
||||
\end{algorithm}
|
||||
```
|
||||
|
||||
![image-20200514225618784](/files/images/20200514225618784.png)
|
BIN
static/files/images/20200514225618784.png
Normal file
BIN
static/files/images/20200514225618784.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
Loading…
Reference in a new issue