I want to put text on the header of my document (I'm using fancyhdr), but if the text surpass certain length it overlaps with other elements. For example, if I want to put "A very long text to fit in the header", then the desired output will be "A very long text...". Of course this output depends on a given length.
In this question there is a method to obtain the length of given text. But I cannot figure out how to display just a few words of the text.
Sorry if I don't have a MWE, but I don't know how to start. I've tried \clip the text using TikZbut it cuts words, something like: "A very lon..."
Thanks in advance
truncatethat is able to cut a text after a certain width – daleif Aug 03 '20 at 14:18