Closed briochemc closed 5 years ago
Thats too much code for me to read :)
Isn't there a package that does latex tables??
I would concentrate on getting metadata into a dataframe then use some tool made for that. And keep the whole process generalised.
FieldMetadata is just a generic way of attaching metadata to arbitrary structures. Flatten converts arbitrary structures to generic flat structures like vectors. Vectors are easily converted to the generic tabular data like dataframes. Then insert a general way of creating your latex table from a dataframe.
I imagine it should only be 10 lines of code total, not including the metadata on the structs.
I think I understand what you are saying, but
I would concentrate on getting metadata into a dataframe
is precisely what I do not know how to do, so I went with putting everything in the LaTeX table directly...
So easy!
My announcment post is an example of doing exactly that: https://discourse.julialang.org/t/ann-metafields-jl-and-flatten-jl-packages-for-writing-composable-models/12849
But the syntax has probably changed a little.
So you mentioned I could do this using FieldMetadata.jl (and Defaults.jl?) but I do not know if I did this the way you intended. Could you have a look at the example below and tell me what you think? Any comments welcome.
Currently this is my parameters:
where I have needed to create a few "tags" and a unit for years:
My solution to printing a LaTeX table works like this:
where the
print_LaTeX_table
function is defined bywhich uses my
latexify
function: