Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wcampbell0x2a/bintex
Create bytefield latex digrams with the use of rust proc-macros and deku
https://github.com/wcampbell0x2a/bintex
latex proc-macro rust
Last synced: 3 months ago
JSON representation
Create bytefield latex digrams with the use of rust proc-macros and deku
- Host: GitHub
- URL: https://github.com/wcampbell0x2a/bintex
- Owner: wcampbell0x2a
- License: apache-2.0
- Created: 2021-05-29T03:51:29.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-08-23T08:25:30.000Z (5 months ago)
- Last Synced: 2024-09-29T05:03:58.826Z (3 months ago)
- Topics: latex, proc-macro, rust
- Language: Rust
- Homepage:
- Size: 88.9 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# bintex
[](https://github.com/wcampbell0x2a/bintex)
[](https://crates.io/crates/bintex)
[](https://docs.rs/bintex)
[](https://github.com/wcampbell0x2a/bintex/actions?query=branch%3Amaster)Create LaTeX [bytefield](https://www.ctan.org/pkg/bytefield) diagrams with the
use of rust proc-macros and the [deku](https://github.com/sharksforarms/deku) library.# docs
run `$ cargo doc --open`See `bintex::attribute` for Attribute details and examples.
# example
Run `$ cargo run && pdflatex sample.tex` to create the following illustration from code:
```rust
use bintex::{BinTex, BinTexOutput};
use deku::prelude::*;#[derive(BinTex)]
#[bintex(bit_width = 32)]
struct Ipv6 {
#[deku(bits = "4")]
version: u8,
#[deku(bits = "6")]
ds: u8,
#[deku(bits = "2")]
ecn: u8,
#[deku(bits = "20")]
label: u32,
length: u16,
next_header: u8,
hop_limit: u8,
src: u32,
dst: u32,
}
```
![Result](/media/ipv6.png)