diff options
author | Robert C. Helling <helling@atdotde.de> | 2019-01-04 22:44:10 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-01-26 07:10:29 -0800 |
commit | dece8d1ba4447ce0de8f29948358320f4932ce65 (patch) | |
tree | b45bfe39e4fdfd43acc15fb03b7caa978697fa95 /desktop-widgets/divelogexportdialog.cpp | |
parent | d85877eb6701038e98027361c094b0d12a64720f (diff) | |
download | subsurface-dece8d1ba4447ce0de8f29948358320f4932ce65.tar.gz |
Allow LaTeX export of several dives
This makes it more like the plain TeX export, the main change
is in the structure of the template file (not included here).
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'desktop-widgets/divelogexportdialog.cpp')
-rw-r--r-- | desktop-widgets/divelogexportdialog.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp index 769f086b2..0df71f7ba 100644 --- a/desktop-widgets/divelogexportdialog.cpp +++ b/desktop-widgets/divelogexportdialog.cpp @@ -249,6 +249,7 @@ void DiveLogExportDialog::export_TeX(const char *filename, const bool selected_o put_format(&buf, "%% You will also need a subsurfacetemplate.tex in the current directory.\n"); } else { ssrf = "ssrf"; + put_format(&buf, "\\input subsurfacelatextemplate\n"); put_format(&buf, "%% This is a plain LaTeX file. Compile with pdflatex, not pdftex!\n"); put_format(&buf, "%% You will also need a subsurfacelatextemplate.tex in the current directory.\n"); } @@ -315,9 +316,13 @@ void DiveLogExportDialog::export_TeX(const char *filename, const bool selected_o int qty_weight; double total_weight; - if (need_pagebreak && plain) - put_format(&buf, "\\vfill\\eject\n"); + if (need_pagebreak) { + if (plain) + put_format(&buf, "\\vfill\\eject\n"); + else + put_format(&buf, "\\newpage\n"); + } need_pagebreak = true; put_format(&buf, "\n%% Time, Date, and location:\n"); put_format(&buf, "\\def\\%sdate{%04u-%02u-%02u}\n", ssrf, @@ -405,14 +410,14 @@ void DiveLogExportDialog::export_TeX(const char *filename, const bool selected_o put_format(&buf, "\\def\\%splace{%s}\n", ssrf, site ? site->name : ""); dive->maxdepth.mm ? put_format(&buf, "\\def\\%sdepth{%.1f\\%sdepthunit}\n", ssrf, get_depth_units(dive->maxdepth.mm, NULL, &unit), ssrf) : put_format(&buf, "\\def\\%sdepth{}\n", ssrf); - if (plain) - put_format(&buf, "\\%spage\n", ssrf); + put_format(&buf, "\\%spage\n", ssrf); + } if (plain) put_format(&buf, "\\bye\n"); else - put_format(&buf, "\\input subsurfacelatextemplate\n"); + put_format(&buf, "\\end{document}\n"); f = subsurface_fopen(filename, "w+"); if (!f) { |