Topic: Formatted documents in FORTRAN output.

To all:

A RECOMMENDATION

You probably send output to results files in plain text, using caps, lower case, indenting and underlining for your page layout and formatting.

I've done that for years. 
I went a. Little further, by setting page widths and lengths in characters and lines, then keeping track of e print head position, so I could centre things, and print page numbers in the output.
This was an improvement but it is still a hell of a palaver to print an output file as a document, with page breaks and line widths matching the Win Doze printer settings or the M$Word line width Nd typeface/font size settings.

Eureka!

Use RTF in your results files.

It is very easy to 'program' RTF layout code in a text file.
You just need about two or three lines of header info to define type faces etc..
You can then use typically 3 to 4 character codes to switch on on off things like boldface, italics, underlining, to switch between mono pitch and proportional fonts, to throw a page, to print a page footer, etc..  It is even very easy to draw vector graphic diagrams in RTF by using simple pen up, pen down, line width etc commands, all with simple text codes, which the FORTRAN code can send to the output file.

RTF codes can be found on the web.
One of us should prepare an RTF module, with all the basic codes inside it, which FORTRAN can then emit to output files using standard functions.  I'd do it myself if I could only find the time. But alas I can't.   Anyway, it's an idea.    And very, very easy.
----
John

Re: Formatted documents in FORTRAN output.

Has anyone turned Johns' 'very easy' idea into code we could all use? I remember the techniques John describes well from the past and they are easy to use.

Re: Formatted documents in FORTRAN output.

The way I did it was very inelegant, because I was both learning the basics of RTF and formulating the idea of how I could use RTF at the same time as coding my Fortran program.  That is, it was not a planned and efficiently implemented process, it was a bit of a lash-up, with bits bolted on ad hoc to make do what I wanted.  But it worked very well, for both text and page layout/formatting, and vector graphics. 

My output files can thus be opened directly in M$Word, and edited with M$Word.

I still don't have time to take this on as a project - to write an RTF library - but what I'll try to do in the next few days is post the applicable code from my program.  I would love to see someone do a proper job with it and create a library that is well planned, with just the exact functions most often needed, and efficient to to use in Fortran applications.
---
John