I would like to replace the paragraphs of a compiled document with framed boxes. Although I read the /tex/latex/base documentations I have no idea how to tackle this problem.
In detail I want to implement the following:
- Given an arbitrary .tex file as input.
- Output a compiled document where all paragraphs are replaced by framed boxes of their respective sizes and the actual sizes are written to a secondary file.
My questions/uncertainties would be
- As this system must not require user interaction to change the .tex input, I cannot rely on additional user commands. Forcing the user to add a command around each paragraph is not possible.
- Furthermore, there are no commands around paragraphs that I can substitute with a command redefinition. Thus I cannot use the method that the 'draft' options use.
- The box sizes depend on the actual output of the compilation and I am not sure if document classes even have the ability to access this information.
- Can someone give me hints on how to start tackling this problem?
Additional questions (which are not so important but related):
- Can the same be done for every line to output a document where each line is a framed box?
- In the end I would like to have the following: For an arbitrary .tex file as input I generate another .tex file where all paragraphs are substituted with box commands and the compiled output of both .tex files (when using the paragraph to box method) should look the same.