tex2csv 0.2.0

Utility to convert a LaTeX Table to a csv file.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//* Utiltily  program to parse a tex table into a csv file.
use std::fs::File; 
use std::io::BufReader;
use tex2csv::file_parser::parse_file;
use tex2csv::cli::get_input_output_file_names;
fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Assuming that tex file is passed first. Need to generalize this.
    let (tex_name, csv_name, environment) = get_input_output_file_names();
    // Open the LaTeX file for reading
    let tex_file = File::open(tex_name)?;
    let tex_reader = BufReader::new(tex_file);
    // Open a CSV file for writing
    let csv_file = File::create(csv_name)?;
    parse_file(tex_reader, csv_file, &environment)?;
    println!("Conversion successful");
    Ok(())
}