Crates.io | bintex |
lib.rs | bintex |
version | 0.1.0 |
source | src |
created_at | 2024-02-11 23:00:29.458162 |
updated_at | 2024-02-11 23:00:29.458162 |
description | Create bitfield LaTeX diagrams with the use of the deku library |
homepage | |
repository | https://github.com/wcampbell0x2a/bintex |
max_upload_size | |
id | 1136166 |
size | 55,795 |
Create LaTeX bytefield diagrams with the use of rust proc-macros and the deku library.
run $ cargo doc --open
See bintex::attribute
for Attribute details and examples.
Run $ cargo run && pdflatex sample.tex
to create the following illustration from code:
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,
}