Skip to content

Commit

Permalink
Merge pull request #324 from gustaphe/customhead
Browse files Browse the repository at this point in the history
Fix dataframe 'head' argument
  • Loading branch information
gustaphe authored Dec 15, 2024
2 parents ad0ab40 + 22d4dab commit 927c39e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/DataFramesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ isdefined(Base, :get_extension) ? (using DataFrames) : (using ..DataFrames)

@latexrecipe function f(d::DataFrame)
env --> :mdtable
head := propertynames(d)
head --> propertynames(d)
if kwargs[:env] == :array
return vcat(permutedims(propertynames(d)), Matrix(d))
end
Expand Down
8 changes: 8 additions & 0 deletions test/plugins/DataFrames_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,11 @@ y & 1//2\\
z & 8\\
\end{tabular}
", "\r\n"=>"\n")

@test latexify(df; head=["x", "y"]) ==
Markdown.md"| x | y |
| ---:| ----------------------:|
| $x$ | $\frac{\alpha}{\beta}$ |
| $y$ | $\frac{1}{2}$ |
| $z$ | $8$ |
"

0 comments on commit 927c39e

Please sign in to comment.