A case study to learn TeXmacs


I’m learning TeXmacs and want to do it the right way.

I would like to submit a cover-letter template on tm-forge and found nice inspiration from awesome-cv latex templates.

I’ve made a very rough document without defining any macro or style file expect the section I think. You can find the document here and a preview in the following screenshot.

I’d like to learn how to make a style file which can define the position and formatting of elements like:

Just to show that I really know nothing in the footer the sender’s name is not a macro substitution, but it’s done “by hand”. I’ll like for example be able to define a macro with arguments to build the sender’s links info line.

I think that this post and its progress could be a good case study for beginners like me.

Any pointers, help will be welcome.
Have a nice day.

1 Like

Nice work! In tm-forge you find some cv examples which have a style file and some macros for formatting. This could help you structure yours. In particular https://github.com/texmacs/tm-forge/tree/main/examples/kjh-vita has some structuring macros for the metadata. Feel free to ask precise questions. I’m very interested in making nice CV templates. Another example https://github.com/texmacs/tm-forge/tree/main/examples/resume-template has also the possibility to export to HTML a nicely formatted CV.

@mgubi many thanks for giving me some food to make my teeth … I’ll look at the examples you’ve mentioned.

I’ve made a small step by defining some macros for the formatting and discover that you can extract a style or package file automatically within the preamble of the TeXmacs document via Source > Extract style file : very sweet …

My work in progress for the style package file is here on github.

The next step for me is to correctly structure the style package file by positioning the fields where I want.

Let me know if you need help. Also we need to design a standard set of tags for metadata and a way for the user to enter them conveniently. In my styles I’ve also put the awesome icons in the style file. Maybe we can construct a style file which defines some of the awesome icons to be used in documents, like: twitter, email, www, GitHub, etc…

@mgubi in the spirit of what you suggest you’ll find a link of “academic” icons/fonts here: https://jpswalsh.github.io/academicons/

I’ve made some small steps forward by restyling some macro and introduced some parameters for the documents like firstname, email, etc in the preamble:

Parameters assignment
Don’t know if the best approach to do it like this.
@mgubi Are those kinds of information the metadata you’ve talked about ? I’ve also noticed in your template that some simple assignments use also a macro, what’s the benefit of this: to be able to modify it without going back to the preamble when editing the doc by “just” modifying the macro and to call them using the M icon in the mode toolbar ?


What’s more tricky for me now is to construct the layout of the document, like force a certain layout in the first table with the picture and sender’s info.

I’m not even sure if this is the recommended approach to building a style file: free or frozen layout for the user ? What is the strategy chosen here by the developers of Texmacs if any ?

I also looked at classic style files such as the title-base.ts for title or author blocks, but reading is still a bit tricky for me.

I’ve updated the template on github.