Skip to content

Commit

Permalink
Allow Writing a Single Column Table
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobadenbaum committed Nov 2, 2021
1 parent 02e2598 commit b2c8fe9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Printing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ function TablePrinter(t::TexTable; kwargs...)
return TablePrinter(table, params, col_schema, row_schema)
end



########################################################################
#################### Index Schemas #####################################
########################################################################
Expand Down Expand Up @@ -813,13 +815,13 @@ show(t::IndexedTable; kwargs...) = print(t; kwargs...)
#################### String Output Methods #############################
########################################################################

function to_ascii(t::IndexedTable; kwargs...)
function to_ascii(t::TexTable; kwargs...)
any(size(t) .== 0) && throw(error("Can't export empty table"))
p= TablePrinter(t; table_type = :ascii, kwargs...)
return head(p)*body(p)*foot(p)
end

function to_tex(t::IndexedTable; kwargs...)
function to_tex(t::TexTable; kwargs...)
any(size(t) .== 0) && throw(error("Can't export empty table"))
p = TablePrinter(t; table_type = :latex, kwargs...)
return head(p)*body(p)*foot(p)
Expand All @@ -829,7 +831,7 @@ end
#################### Latex Table Output ################################
########################################################################

function write_tex(outfile, t::IndexedTable)
function write_tex(outfile, t::TexTable)
open(outfile, "w") do f
write(f, to_tex(t))
end
Expand Down

2 comments on commit b2c8fe9

@jacobadenbaum
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while trying to register: "Tag with name v0.2.4 already exists and points to a different commit"

Please sign in to comment.