Hi!
After a while, I finally added an initial version o LaTeX backend to PrettyTables.jl. It is not published yet. Thus you will have to use dev
.
I want some feedback about it. Unfortunately there is not a documentation yet, but you can see the functions pretty_tables
and _pt_latex
to see.
I also added a nice feature to automatically add tables to files. For example, let’s say you have this LaTeX file:
\documentclass{article}
\usepackage{xcolor}
\begin{document}
The table~\ref{tab:table} is a table "printed" with the Julia package PrettyTable.
\begin{table}[h]
\caption{A table.}
\centering
\label{tab:table}
% <PrettyTables Table 1>
% </PrettyTables>
\end{table}
\end{document}
Then, you can add a table using PrettyTables.jl to the marked location by:
julia> using PrettyTables
julia> using Statistics
julia> data = rand(15,3)*1e8;
julia> m = mean(data);
julia> hl1 = LatexHighlighter((data,i,j)->data[i,j] > m, "color{blue}");
julia> hl2 = LatexHighlighter((data,i,j)->data[i,j] < m, "color{red}");
julia> include_pt_in_file("example.tex", "Table 1", data, backend = :latex, formatter = ft_latex_sn(3), alignment = :l, highlighters = (hl1,hl2))
Leading to the following PDF if example.tex
is compiled: