mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Move the decision how to typeset unit to TeX-style file
This way, the user can adopt those once and for all for all her dives. This includes the space between number and unit symbol. Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
0c426c37b2
commit
d5d97870c3
2 changed files with 27 additions and 30 deletions
|
@ -270,29 +270,12 @@ void DiveLogExportDialog::export_TeX(const char *filename, const bool selected_o
|
|||
put_format(&buf, "%% respectively. If you wish to display the original values, you may edit this\n");
|
||||
put_format(&buf, "%% list and all calls to those units will be updated in your document.\n");
|
||||
|
||||
tmp = get_depth_units(1, NULL, &unit);
|
||||
put_format(&buf, "\\def\\depthunit{%s}\n", unit);
|
||||
tmp = get_weight_units(1, NULL, &unit);
|
||||
put_format(&buf, "\\def\\weightunit{%s}\n", unit);
|
||||
tmp = get_pressure_units(1, &unit);
|
||||
put_format(&buf, "\\def\\pressureunit{%s}\n", unit);
|
||||
tmp = get_temp_units(1, &unit);
|
||||
put_format(&buf, "\\def\\temperatureunit{%s}\n", unit);
|
||||
tmp = get_volume_units(1, NULL, &unit);
|
||||
if (strcmp(unit, "ℓ") == 0)
|
||||
{
|
||||
put_format(&buf, "\\def\\volumeunit{L}\n");
|
||||
}
|
||||
else if (strcmp(unit, "cuft") == 0)
|
||||
{
|
||||
put_format(&buf, "\\def\\volumeunit{ft$^{3}$}\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
put_format(&buf, "\\def\\volumeunit{%s}\n", unit);
|
||||
}
|
||||
tmp = get_vertical_speed_units(1, NULL, &unit);
|
||||
put_format(&buf, "\\def\\verticalspeedunit{%s}\n", unit);
|
||||
put_format(&buf, "\\def\\depthunit{\\unit%s}", units->length == units::METERS ? "meter" : "ft");
|
||||
put_format(&buf, "\\def\\weightunit{\\unit%s}", units->weight == units::KG ? "kg" : "lb");
|
||||
put_format(&buf, "\\def\\pressureunit{\\unit%s}", units->pressure == units::BAR ? "bar" : "psi");
|
||||
put_format(&buf, "\\def\\temperatureunit{\\unit%s}", units->temperature == units::CELSIUS ? "celsius" : "fahrenheit");
|
||||
put_format(&buf, "\\def\\volumeunit{\\unit%s}", units->volume == units::LITER ? "liter" : "cuft");
|
||||
put_format(&buf, "\\def\\verticalspeedunit{\\unit%s}", units->length == units::METERS ? "meterpermin" : "ftpermin");
|
||||
|
||||
put_format(&buf, "\n%%%%%%%%%% Begin Dive Data: %%%%%%%%%%\n");
|
||||
|
||||
|
|
|
@ -9,6 +9,20 @@
|
|||
\parindent=1cm
|
||||
%\offinterlineskip
|
||||
\long\def\page{
|
||||
%% Unit symbols, add spaces in front if you prefer
|
||||
\def\unitmeter{m}
|
||||
\def\unitft{ft}
|
||||
\def\unitkg{kg}
|
||||
\def\unitlb{lb}
|
||||
\def\unitbar{bar}
|
||||
\def\unitpsi{psi}
|
||||
\def\unitcentigrate{${}^\circ$C}
|
||||
\def\unitfahrenheit{${}^\circ$F}
|
||||
\def\unitliter{$\ell$}
|
||||
\def\unitcuft{cuft}
|
||||
\def\unitmeterpermin{m/min}
|
||||
\def\unitftpermin{ft/min}
|
||||
%
|
||||
$$\vbox{\hrule % upper cutting line
|
||||
\vskip 2.0cm % upper whitespace
|
||||
\vrule % left cutting line
|
||||
|
|
Loading…
Reference in a new issue