Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add double line as default border #20

Closed
wants to merge 5 commits into from
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions src/Printing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ end
star::Bool = true
sep::String = default_sep(table_type)
align::String = "c"
TableParams(pad, table_type, se_pos, star, sep, align) = begin
border::Symbol = :double
TableParams(pad, table_type, se_pos, star, sep, align, border) = begin
# Argument Checking
return new(pad, table_type, se_pos, star, sep, align)
return new(pad, table_type, se_pos, star, sep, align, border)
end
end

Expand Down Expand Up @@ -399,7 +400,13 @@ function top_matter(printer::TablePrinter{N,M}) where {N,M}
align *= "c"^pair.second
end

return "\\begin{tabular}{$align}\n\\toprule\n"
if border == :double
return "\\begin{tabular}{$align}\n\\hline\\hline\n"
elseif border == :single
return "\\begin{tabular}{$align}\n\\toprule\n"
elseif border == :none
return "\\begin{tabular}{$align}\n\\toprule\n"
@warn("default border will change to double in future releases")
end
end

Expand Down Expand Up @@ -657,11 +664,17 @@ end
########################################################################
#################### Footer ############################################
########################################################################

# Footer edited to produce double horizontal
function foot(t::TablePrinter)
@unpack table_type = t.params
table_type == :ascii && return ""
table_type == :latex && return "\\bottomrule\n\\end{tabular}"
if border == :double
table_type == :latex && return "\\hline\\hline\n\\end{tabular}"
elseif border == :single
table_type == :latex && return "\\bottomrule\n\\end{tabular}"
elseif border == :none
table_type == :latex && return "\\bottomrule\n\\end{tabular}"
@warn("default border will change to double in future releases")
Copy link
Owner

Choose a reason for hiding this comment

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

You're missing an end statement here. That's why the travis builds are failing.

In general, you can catch some of these mistakes locally by running ] test TexTables on your machine. All of the tests should pass before we merge this pr.

Copy link
Author

Choose a reason for hiding this comment

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

I fixed the error and ran the build on my local machine as you suggested. The tests all passed locally.

end


Expand Down