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

Provide more options for nice table formatting. #81

Open
korsbo opened this issue Oct 30, 2019 · 2 comments
Open

Provide more options for nice table formatting. #81

korsbo opened this issue Oct 30, 2019 · 2 comments

Comments

@korsbo
Copy link
Owner

korsbo commented Oct 30, 2019

This has never been an issue for me since formatting is easily added after copying latex code to a document but that approach is not automated and does not work with for example Weave.jl. It would, therefore, be nice to have better customizability of final table formatting.

@number-crunch
Copy link

Hello, I would like to know how to remove $..$ surrounding tabular elements that are not to be expressed in LaTeX math mode. I have tables that use Strings as descriptions and then separate numbers. When I "latexify( )" my matrix of items all elements get $..$ surrounding them.

How can I suppress this $ $ for certain tabular elements?

Thank you in advance.

@korsbo
Copy link
Owner Author

korsbo commented Feb 11, 2020

Hi @number-crunch,
I have not implemented any specific support for this but it is still possible to achieve.

By passing the keyword argument latex = false, you stop surrounding the elements with $$. From there, you can add formatting using the fmt = keyword. fmt could be just about any function that takes a single input and returns a single output.

If you, for example, want to keep latexification of only numbers, you could do

using Latexify
a = ["hello" "hi"; 1.2 4.1243534e4]
latexify(a; env=:table, latex=false, fmt = x -> x isa Number ? latexify(x) : x)

This could become a bit verbose, but it does give you a lot of freedom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants