2

I have looked up packages such as datatool, but I am not quite sure if they would be able to perform this function. The basic idea is that I would like to have a database similar to a bibtex file, something in which I can put entries like this:

entry{bread
calories=78
frenchname=pain}

entry{egg
calories=79
frenchname=oeuf}

and somewhere in the tex file I am using I could have some function like:

\extract{dataset}{entryname}{data}

such that if I put in

\extract{mydata}{bread}{frenchname}

the resulting file would come up with "pain".

I don't know if there is an easy solution for this, the packages I've looked at list certain ways of expressing data but not in a way that seems intuitive in-text. Is there a way to do this/a direction or package I should look at? I would also be fine working with a comma separated list, but I'd still want to be able to input the name of the value type (e.g. frenchname) in order to get the resulting datapoint (e.g. pain).

  • 1
    Would you be open to a LuaLaTeX solution? Unrelated: French for egg is 'oeuf'. – Marijn Jul 16 at 11:04
  • I would be open to a LuaLaTeX solution, as long as it would work with a document that was otherwise written for LaTeX! And thanks, just edited it to oeuf. – Jackirab Jul 16 at 11:20
  • If I had time, I would look into ctan.org/pkg/csvsimple . – Keks Dose Jul 16 at 11:30
  • Does the database need to be bibtexish, or would csv work? – Teepeemm Jul 16 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.