0

LuaLateX is able to run custom code and attach it to callback, in particular it could discover line break, receiving a list of hlist that compose a line of text. I'm not an expert at all, but I was thinking, it is possible to collect the informations on the line break position done from tex, and use it to format the text in a editor, so the text in the editor respect the same flow in the pdf?

  • 1
    possibly, although in some scripts mapping back from the glyphs in the output to the characters in the input is highly non trivial. But why would you want this? It would be very weird to have the text re-format as you are writing into the editor wouldn't it? – David Carlisle May 17 '20 at 18:42
  • What you are thinking of exists already and is called SyncTeX. – Henri Menke May 18 '20 at 03:24
  • I know about synctex, and for the other comment, I don't think that 'reformatting' the latex code such that the line are approximatelly breaked as in the pdf would be a bad idea. I know that latex has the opposite philosophy than WYSIWYG program, but I like the idea of reflowing the code such that it adapt to the pdf rendering. But of course this is just an idea. – Antonio Caruso May 18 '20 at 13:54

0 Answers0