I tried to pirate this method so it doesn’t throw but it is ignored and throws an error. What is wrong?
Julia 1.7.1, PrettyTables master
[08abe8d2] PrettyTables v1.3.1 `https://github.com/ronisbr/PrettyTables.jl.git#master
using PrettyTables
# Pirate this function to allow arbitrary alignment specifiers.
function PrettyTables._latex_alignment(s::Symbol)
if (s == :l) || (s == :L)
return "l"
elseif (s == :c) || (s == :C)
return "c"
elseif (s == :r) || (s == :R)
return "r"
else
# Allow arbitrary alignments.
return String(s)
end
end
function maketable(d)
pretty_table(d; tf=LatexTableFormat(), alignment=[:r,Symbol("d{5.5}")])
end
maketable((;a=[1,2,3], b=[10.1,20.2,30.3]))
#=
ERROR: Invalid LaTeX alignment symbol: d{5.5}.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] _latex_alignment
@ ~/.julia/packages/PrettyTables/gNyx5/src/backends/latex/private.jl:58 [inlined]
[3] |>
@ ./operators.jl:966 [inlined]
[4] _latex_table_description(ptable::PrettyTables.ProcessedTable, vlines::Symbol, left_vline::String, mid_vline::String, right_vline::String, hidden_columns_at_end::Bool)
@ PrettyTables ~/.julia/packages/PrettyTables/gNyx5/src/backends/latex/private.jl:79
[5] _pt_latex(io::IOContext{Base.TTY}, pinfo::PrettyTables.PrintInfo; tf::LatexTableFormat, body_hlines::Vector{Int64}, highlighters::Tuple{}, hlines::Nothing, label::String, longtable_footer::Nothing, sortkeys::Bool, table_type::Nothing, vlines::Nothing, wrap_table::Bool, wrap_table_environment::Nothing)
@ PrettyTables ~/.julia/packages/PrettyTables/gNyx5/src/backends/latex/print.jl:109
[6] _pt(io::IO, data::PrettyTables.ColumnTable; alignment::Vector{Symbol}, backend::Val{:auto}, cell_alignment::Nothing, cell_first_line_only::Bool, compact_printing::Bool, formatters::Nothing, header::Tuple{Vector{Symbol}, Vector{String}}, header_alignment::Symbol, header_cell_alignment::Nothing, limit_printing::Bool, max_num_of_columns::Int64, max_num_of_rows::Int64, renderer::Symbol, row_names::Nothing, row_name_alignment::Symbol, row_name_column_title::String, row_number_alignment::Symbol, row_number_column_title::String, show_header::Bool, show_row_number::Bool, show_subheader::Bool, title::String, title_alignment::Symbol, kwargs::Base.Pairs{Symbol, LatexTableFormat, Tuple{Symbol}, NamedTuple{(:tf,), Tuple{LatexTableFormat}}})
@ PrettyTables ~/.julia/packages/PrettyTables/gNyx5/src/private.jl:411
[7] #_pretty_table#61
@ ~/.julia/packages/PrettyTables/gNyx5/src/private.jl:275 [inlined]
[8] #pretty_table#53
@ ~/.julia/packages/PrettyTables/gNyx5/src/print.jl:694 [inlined]
[9] maketable(d::NamedTuple{(:a, :b), Tuple{Vector{Int64}, Vector{Float64}}}) =#