print layout

Robert Helling helling at lmu.de
Thu Oct 17 07:04:54 UTC 2013


On 16.10.2013, at 17:59, Dirk Hohndel <dirk at hohndel.org> wrote:

Hi everyone,

> I can look into it myself if I find time, but my todo list is rather long right now...

Regarding print templates:

I know you said this will not happen for version 4.x but I think I had some revelation this morning under the shower.

Our problem was that we cannot quite have html templates as the qt routines don't treat proper html and anything else would require us to write some non-trivial parser.

Well, there is a perfectly fine way to to describe page layouts for print in professional typesetting quality. It's called TeX. And of course we do not want to bundle subsurface with the myriad of files that a proper TeX system requires, so we don't want to use TeX for printing. 

But what we could to is export dives in TeX format (since that's a simple text file). So this could be used by the many users that already have a TeX system running (I consider it like divelogs.de or the webapp: to make use of this feature you need additional things like a divelogs.de account or an android smartphone).

Here are two patch files for a proof of concept: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Basic-TeX-export.patch
Type: application/octet-stream
Size: 5103 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20131017/78eaf271/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-include-profile-picture-in-TeX.patch
Type: application/octet-stream
Size: 1464 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20131017/78eaf271/attachment-0001.obj>
-------------- next part --------------


This adds an entry to the dive list context menu to export a dive as TeX. Right now it always exports to a file named dive.tex in the pwd (as well as writing the profile picture to profile.png).

If the user has a TeX system installed she can then run 

pdftex dive

to obtain a nice (I know, tastes differ?) printable file dive.pdf.

The cute thing is that this is realized as a template: In dive.tex the data only goes into a number of macro definitions, and then logbook style.tex is imported. The latter contains the actual layout. So we could have several such template files (according to personal taste) and this export works with each of them.

Obviously, this is only a proof of concept and far from complete (things like hard coded file names and only some of the fields of struct dive are represented since I stole this form my old dive log software). But please let me know what you think.

If you want:
Signed-off-by: Robert C. Helling <helling at atdotde.de>

Best
Robert

-- 
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics
                      Scientific Coordinator
                      Ludwig Maximilians Universitaet Muenchen, Dept. Physik
                      Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339
                      http://www.atdotde.de

Enhance your privacy, use cryptography! My PGP keys have fingerprints
A9D1 A01D 13A5 31FA 6515  BB44 0820 367C 36BC 0C1D    and
DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20131017/78eaf271/attachment.sig>


More information about the subsurface mailing list