Skip to content

Commit

Permalink
Fix LaTeX table formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Rucknium committed Jul 11, 2022
1 parent 6c9d458 commit 4ee1dca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 30 deletions.
8 changes: 4 additions & 4 deletions R/OSPEAD-dry-run.R
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ colnames(hux.run.iters.results) <- c("Loss function", "Loss function parameter",

hux.run.iters.results <- huxtable::as_hux(hux.run.iters.results)
hux.run.iters.results <- t(hux.run.iters.results)
hux.run.iters.results <- huxtable::set_bottom_border(hux.run.iters.results, row = 2)
hux.run.iters.results <- huxtable::set_align(hux.run.iters.results, col = 1, value = "left")
hux.run.iters.results <- huxtable::set_bottom_border(hux.run.iters.results, row = 2, col = huxtable::everywhere)
hux.run.iters.results <- huxtable::set_align(hux.run.iters.results, row = huxtable::everywhere, col = 1, value = "left")
hux.run.iters.results <- huxtable::set_number_format(hux.run.iters.results, row = 3:9, col = 2:5, value = 4)

YlGn.colors <- rev(RColorBrewer::brewer.pal(7, "YlGn"))
Expand All @@ -383,7 +383,7 @@ width(hux.run.iters.results) <- 1

hux.run.iters.results <- huxtable::set_col_width(hux.run.iters.results, col = 2:6, value = (1/ncol(hux.run.iters.results)) * 0.8)

cat(huxtable::to_latex(hux.run.iters.results), file = "tables/dry-run/performance.tex")
cat(huxtable::to_latex(hux.run.iters.results, tabular_only = TRUE), file = "tables/dry-run/performance.tex")



Expand Down Expand Up @@ -449,7 +449,7 @@ hux.minimizer.params <- huxtable::add_footnote(hux.minimizer.params,
text = "Mixture distributions are omitted from this table.")


cat(huxtable::to_latex(hux.minimizer.params), file = "tables/dry-run/minimizer-params.tex")
cat(huxtable::to_latex(hux.minimizer.params, tabular_only = TRUE), file = "tables/dry-run/minimizer-params.tex")



Expand Down
10 changes: 1 addition & 9 deletions tables/dry-run/minimizer-params.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
\providecommand{\huxvb}[2]{\color[RGB]{#1}\vrule width #2pt}
\providecommand{\huxtpad}[1]{\rule{0pt}{#1}}
\providecommand{\huxbpad}[1]{\rule[-#1]{0pt}{#1}}

\begin{table}[ht]
\begin{centerbox}
\begin{threeparttable}
\setlength{\tabcolsep}{0pt}
\begin{tabularx}{0.95\textwidth}{p{0.158333333333333\textwidth} p{0.158333333333333\textwidth} p{0.158333333333333\textwidth} p{0.158333333333333\textwidth} p{0.158333333333333\textwidth} p{0.158333333333333\textwidth}}


Expand Down Expand Up @@ -274,7 +269,4 @@

\hhline{}
\arrayrulecolor{black}
\end{tabularx}
\end{threeparttable}\par\end{centerbox}

\end{table}
\end{tabularx}
26 changes: 9 additions & 17 deletions tables/dry-run/performance.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
\providecommand{\huxvb}[2]{\color[RGB]{#1}\vrule width #2pt}
\providecommand{\huxtpad}[1]{\rule{0pt}{#1}}
\providecommand{\huxbpad}[1]{\rule[-#1]{0pt}{#1}}

\begin{table}[ht]
\begin{centerbox}
\begin{threeparttable}
\setlength{\tabcolsep}{0pt}
\begin{tabularx}{1\textwidth}{p{0.166666666666667\textwidth} p{0.133333333333333\textwidth} p{0.133333333333333\textwidth} p{0.133333333333333\textwidth} p{0.133333333333333\textwidth} p{0.133333333333333\textwidth}}


Expand All @@ -22,7 +17,7 @@
\multicolumn{1}{p{0.133333333333333\textwidth}!{\huxvb{0, 0, 0}{0}}}{\hspace{6pt}\parbox[b]{0.133333333333333\textwidth-6pt-6pt}{\huxtpad{6pt + 1em}\raggedright L\_MLE\huxbpad{6pt}}} \tabularnewline[-0.5pt]


\hhline{>{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}-}
\hhline{}
\arrayrulecolor{black}

\multicolumn{1}{!{\huxvb{0, 0, 0}{0}}l!{\huxvb{0, 0, 0}{0}}}{\huxtpad{6pt + 1em}\raggedright \hspace{6pt} Loss function parameter \hspace{6pt}\huxbpad{6pt}} &
Expand All @@ -33,7 +28,7 @@
\multicolumn{1}{p{0.133333333333333\textwidth}!{\huxvb{0, 0, 0}{0}}}{\hspace{6pt}\parbox[b]{0.133333333333333\textwidth-6pt-6pt}{\huxtpad{6pt + 1em}\raggedleft \hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\huxbpad{6pt}}} \tabularnewline[-0.5pt]


\hhline{>{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}-}
\hhline{>{\huxb{0, 0, 0}{0.4}}->{\huxb{0, 0, 0}{0.4}}->{\huxb{0, 0, 0}{0.4}}->{\huxb{0, 0, 0}{0.4}}->{\huxb{0, 0, 0}{0.4}}->{\huxb{0, 0, 0}{0.4}}-}
\arrayrulecolor{black}

\multicolumn{1}{!{\huxvb{0, 0, 0}{0}}l!{\huxvb{0, 0, 0}{0}}}{\huxtpad{6pt + 1em}\raggedright \hspace{6pt} Log-gamma \hspace{6pt}\huxbpad{6pt}} &
Expand All @@ -44,7 +39,7 @@
\multicolumn{1}{p{0.133333333333333\textwidth}!{\huxvb{0, 0, 0}{0}}}{\cellcolor[RGB]{0, 90, 50}\hspace{6pt}\parbox[b]{0.133333333333333\textwidth-6pt-6pt}{\huxtpad{6pt + 1em}\raggedleft 7.65e+07\huxbpad{6pt}}} \tabularnewline[-0.5pt]


\hhline{>{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}-}
\hhline{}
\arrayrulecolor{black}

\multicolumn{1}{!{\huxvb{0, 0, 0}{0}}l!{\huxvb{0, 0, 0}{0}}}{\huxtpad{6pt + 1em}\raggedright \hspace{6pt} F \hspace{6pt}\huxbpad{6pt}} &
Expand All @@ -55,7 +50,7 @@
\multicolumn{1}{p{0.133333333333333\textwidth}!{\huxvb{0, 0, 0}{0}}}{\cellcolor[RGB]{65, 171, 93}\hspace{6pt}\parbox[b]{0.133333333333333\textwidth-6pt-6pt}{\huxtpad{6pt + 1em}\raggedleft 7.67e+07\huxbpad{6pt}}} \tabularnewline[-0.5pt]


\hhline{>{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}-}
\hhline{}
\arrayrulecolor{black}

\multicolumn{1}{!{\huxvb{0, 0, 0}{0}}l!{\huxvb{0, 0, 0}{0}}}{\huxtpad{6pt + 1em}\raggedright \hspace{6pt} Right-Pareto Log-normal \hspace{6pt}\huxbpad{6pt}} &
Expand All @@ -66,7 +61,7 @@
\multicolumn{1}{p{0.133333333333333\textwidth}!{\huxvb{0, 0, 0}{0}}}{\cellcolor[RGB]{35, 132, 67}\hspace{6pt}\parbox[b]{0.133333333333333\textwidth-6pt-6pt}{\huxtpad{6pt + 1em}\raggedleft 7.66e+07\huxbpad{6pt}}} \tabularnewline[-0.5pt]


\hhline{>{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}-}
\hhline{}
\arrayrulecolor{black}

\multicolumn{1}{!{\huxvb{0, 0, 0}{0}}l!{\huxvb{0, 0, 0}{0}}}{\huxtpad{6pt + 1em}\raggedright \hspace{6pt} Generalized Extreme Value \hspace{6pt}\huxbpad{6pt}} &
Expand All @@ -77,7 +72,7 @@
\multicolumn{1}{p{0.133333333333333\textwidth}!{\huxvb{0, 0, 0}{0}}}{\cellcolor[RGB]{120, 198, 121}\hspace{6pt}\parbox[b]{0.133333333333333\textwidth-6pt-6pt}{\huxtpad{6pt + 1em}\raggedleft 7.76e+07\huxbpad{6pt}}} \tabularnewline[-0.5pt]


\hhline{>{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}-}
\hhline{}
\arrayrulecolor{black}

\multicolumn{1}{!{\huxvb{0, 0, 0}{0}}l!{\huxvb{0, 0, 0}{0}}}{\huxtpad{6pt + 1em}\raggedright \hspace{6pt} Log-gamma + F mix \hspace{6pt}\huxbpad{6pt}} &
Expand All @@ -88,7 +83,7 @@
\multicolumn{1}{p{0.133333333333333\textwidth}!{\huxvb{0, 0, 0}{0}}}{\hspace{6pt}\parbox[b]{0.133333333333333\textwidth-6pt-6pt}{\huxtpad{6pt + 1em}\raggedleft \hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\huxbpad{6pt}}} \tabularnewline[-0.5pt]


\hhline{>{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}-}
\hhline{}
\arrayrulecolor{black}

\multicolumn{1}{!{\huxvb{0, 0, 0}{0}}l!{\huxvb{0, 0, 0}{0}}}{\huxtpad{6pt + 1em}\raggedright \hspace{6pt} Log-gamma + GEV mix \hspace{6pt}\huxbpad{6pt}} &
Expand All @@ -99,7 +94,7 @@
\multicolumn{1}{p{0.133333333333333\textwidth}!{\huxvb{0, 0, 0}{0}}}{\hspace{6pt}\parbox[b]{0.133333333333333\textwidth-6pt-6pt}{\huxtpad{6pt + 1em}\raggedleft \hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\hphantom{0}\huxbpad{6pt}}} \tabularnewline[-0.5pt]


\hhline{>{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}->{\huxb{0, 0, 0}{2}}-}
\hhline{}
\arrayrulecolor{black}

\multicolumn{1}{!{\huxvb{0, 0, 0}{0}}l!{\huxvb{0, 0, 0}{0}}}{\huxtpad{6pt + 1em}\raggedright \hspace{6pt} Log-gamma + Laplace Periodic \hspace{6pt}\huxbpad{6pt}} &
Expand All @@ -118,7 +113,4 @@

\hhline{}
\arrayrulecolor{black}
\end{tabularx}
\end{threeparttable}\par\end{centerbox}

\end{table}
\end{tabularx}

0 comments on commit 4ee1dca

Please sign in to comment.