# \[ANN\] PrettyTables.jl v0.11

**URL:** <https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830>\
**Category:** Package Announcements\
**Created:** [January 23, 2021, 12:41pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830 "2021-01-23T12:41:49Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [January 23, 2021, 12:41pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/1 "2021-01-23T12:41:49Z")

</div>

Hi!

I just asked for registration of PrettyTables v0.11. There is some improvements and bug fixes in all backends. However, the major change in this release is the alignment system based on anchors for the text backend. Now, you can define regexes in columns that creates anchors to align the text. Hence, we can, for example, align floating points very easily:

 ![Captura de Tela 2021-01-23 às 09.40.11](https://global.discourse-cdn.com/julialang/original/3X/2/2/223bd1619a7a714934206b724f2186ac8b1c2f97.png)

Notice that the alignment with anchors also works with the global column alignment:

 ![Captura de Tela 2021-01-23 às 09.40.35](https://global.discourse-cdn.com/julialang/original/3X/d/2/d2acaa19c8efdb298a4adefdc00406a09bb4821a.png)

 ![Captura de Tela 2021-01-23 às 09.40.52](https://global.discourse-cdn.com/julialang/original/3X/9/c/9c0a6bcc58df13fbf15b3827a28428e3f8f36fbd.png)

 ![Captura de Tela 2021-01-23 às 09.41.16](https://global.discourse-cdn.com/julialang/original/3X/8/4/84d1f1472de4e28753f567967e1fefd2a7ab3ea2.png)

---

<div class="post-metadata">

**Author:** ![davide](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davide/32/52136_2.png) [@davide](https://discourse.julialang.org/u/davide)\
**Post date:** [January 23, 2021, 8:41pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/2 "2021-01-23T20:41:25Z")

</div>

Great. Thanks @Ronis_BR

---

<div class="post-metadata">

**Author:** ![briochemc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/briochemc/32/4209_2.png) [@briochemc](https://discourse.julialang.org/u/briochemc)\
**Post date:** [January 23, 2021, 11:23pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/3 "2021-01-23T23:23:28Z")

</div>

This is very neat! Kudos!

Is it possible and, if yes, are there plans to extend this alignment functionality to other output formats, like markdown and LaTeX?

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [January 24, 2021, 2:19pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/4 "2021-01-24T14:19:35Z")

</div>

> [@briochemc](#):
>
> Is it possible and, if yes, are there plans to extend this alignment functionality to other output formats, like markdown and LaTeX?

For markdown, certainly. I am planning to create a custom markdown backend based on a (very very) much simple version of Text backend. However, for LaTeX, I can do this as soon as someone tell me how it can be done 😃

---

<div class="post-metadata">

**Author:** ![Zach\_Christensen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zach_christensen/32/7220_2.png) [@Zach\_Christensen](https://discourse.julialang.org/u/Zach_Christensen)\
**Post date:** [January 24, 2021, 9:21pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/5 "2021-01-24T21:21:49Z")

</div>

It’s projects like this that make me think that being able to switch from rmarkdown is on the horizon for Julia users. Nice work

---

<div class="post-metadata">

**Author:** ![briochemc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/briochemc/32/4209_2.png) [@briochemc](https://discourse.julialang.org/u/briochemc)\
**Post date:** [January 24, 2021, 10:16pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/6 "2021-01-24T22:16:17Z")

</div>

This is great!

FWIW, I’ve done it before in a dirty way (by splitting columns in three and aligning integer and decimal parts left and right of the center column that was filled with dots)

Anyway, maybe one could instead do the same thing you have for the REPL right now and it’s just a matter of combining it with something like what [this Stackoverflow thread suggests?](https://tex.stackexchange.com/questions/309883/how-to-select-monospaced-numerals-for-tables-only-when-using-mathspec)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 25, 2021, 2:28am UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/7 "2021-01-25T02:28:34Z")

</div>

> [@briochemc](#):
>
> LaTeX?

Sounds like a good place to use Latexify?

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [January 25, 2021, 2:48am UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/8 "2021-01-25T02:48:47Z")

</div>

PrettyTables already has a super robust Latex backend, it’s just a matter of keeping feature parity between the 3 output formats

---

<div class="post-metadata">

**Author:** ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)\
**Post date:** [January 25, 2021, 4:05pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/9 "2021-01-25T16:05:56Z")

</div>

Note that PrettyTables v0.11.0 forces a downgrade of DataFrames,

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [January 25, 2021, 4:11pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/10 "2021-01-25T16:11:20Z")

</div>

I will patch it.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [January 25, 2021, 6:25pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/11 "2021-01-25T18:25:41Z")

</div>

Done [Release v0.22.4 · JuliaData/DataFrames.jl · GitHub](https://github.com/JuliaData/DataFrames.jl/releases/tag/v0.22.4)

---

<div class="post-metadata">

**Author:** ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)\
**Post date:** [January 25, 2021, 8:50pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/12 "2021-01-25T20:50:06Z")

</div>

Thank you very much Bogumil. Now the upgrade works nicely.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [January 25, 2021, 11:39pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-11/53830/13 "2021-01-25T23:39:26Z")

</div>

Hi!

I need help. I am cleaning the code so that we can reach v1.0 in which Text back-end will be declared stable. In this process I am correcting some terrible choices I did in the past. For example, I was creating two auxiliary tables, one with the strings and another with the cell lengths. My original idea was to save a lot of calls to `textwidth`. However, it turns out that `textwidth` is incredibly fast, way faster than allocating an array with the same size of the printed table.

Hence, I did a lot of modifications to `master` trying to clean everything I can. This reduced allocation, and improved the performance a little bit. The only minor drawback is when you have Markdown cells. In this case, I cannot use `textwidth` because those cells has ANSI escape characters. Thus, I need to remove them and then compute the width. Conclusion: printing cells with Markdown is a little slower (1 to 5% in my benchmarks).

Thus, I will appreciate if anyone can clone `master` and do a stress test to see if I missed something. Of course, all the tests are passing, but I could have overlooked something given the amount of configurations we have.
