tmpl(tex): format table,pic,allpics
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-07-18 01:05:17 +02:00
parent efbc963875
commit 9435f81fa2
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
3 changed files with 20 additions and 22 deletions

@ -6,12 +6,13 @@
% This file is a part of the math-optim project.
% project homepage: https://git.dotya.ml/wanderer/math-optim/
\section{Plot comparisons}
{{ range $i, $v := .AllPics.TexFiles }}
\section{Algo: {{ $v.Algo -}} }
\subsection{ {{- $v.Algo -}} }
{{- range $j, $u := $v.FilePaths }}
\input{ {{- $u -}} }
\input{ {{- printf "{%s}" $u -}} }
\newpage
{{- end }}
{{ end -}}
{{ end }}
% vim: ft=gotexttmpl.tex ts=2 sts=2 sw=2 bs=2 expandtab

@ -7,14 +7,14 @@
% This file is a part of the math-optim project.
% project homepage: https://git.dotya.ml/wanderer/math-optim/
\subsection{ {{- printf "%s - %s" .Algo .Bench -}} }
\subsubsection{ {{- printf "%s - %s" .Algo .Bench -}} }
{{- range $i, $v := .Pics }}
\subsubsection{ {{- $v.Caption -}} }
\begin{figure}[!hbt]
\includesvg[width=0.30\textwidth]{ {{- printf "{%s}" $v.FilePath -}} }
\centering
\includesvg[width=0.65\textwidth]{ {{- $v.FilePath -}} }
\caption{ {{- $v.Caption -}} }
\end{figure}

@ -10,22 +10,19 @@
\subsection{ {{- .Algo -}} }
\begin{table}[!htb]
\resizebox{\columnwidth}{!}{\begin{tabular}[t]{r||{{- range $i, $v := .ColLayout }}{{$v}}| {{- end -}} }
\textbf{params} & {{ range $i, $v := .ColNames }}{{ printf "\\textbf{%s}" $v }} & {{ end}}\\
{{- range $j, $v := .Rs }}
{{ printf "%s & " $v.Title }}
{{- range $k, $val := $v.Values }}
{{- printf "%f & " $val }}
{{- end}}\\
{{- end }}
\end{tabular}}
\footnotesize
\centering
% \begin{tabular}[t]{ |l|{{- range $i, $v := .ColLayout }}{{$v}}| {{- end}} }
\begin{tabular}[t]{ ||l||{{- range $i, $v := .ColLayout }}{{$v}}| {{- end -}}| }
\toprule
& {{ range $i, $v := .ColNames }}{{$v }} & {{ end}}\\
{{- range $j, $v := .Rs }}
{{ printf "%s & " $v.Title }}
{{- range $k, $val := $v.Values }}
{{- printf "%f & " $val }}
{{- end}}\\
{{- end }}
\bottomrule
\end{tabular}
\caption{\label{table: {{ .Algo }} algo statistics}}
\caption{ {{- .Algo }} algo statistics}
\end{table}
% vim: ft=gotexttmpl ts=2 sts=2 sw=2 bs=2 expandtab