Albert Rapp Profile picture
Nov 1 16 tweets 6 min read
There are hundreds of online resources for learning how to code.

But there are much fewer online resources for math.

Maybe that's because LaTeX (the premier math writing tool) isn't good at creating them.

#QuartoPub can do both. So, is it a worthy alternative?🧵 #mathematics
What is Quarto?

Short answer: It's a tool that can create many output formats all from one interface.

That means you can create classical PDF math papers as well as online math books with Quarto.
You may be sceptical about the online part. Maybe you have only seen math in PDF format.

But I assure you that it's a real thing. And it's powerful.

For example, every day hundreds of mathematicians on MathOverflow talk about research-level math online. mathoverflow.net
And the best part about Quarto is that it is really easy to learn.

The formulas themselves use the LaTeX syntax you already know.

And the other parts are not that much different from LaTeX. If anything, they're simpler in Quarto.

Here's a little cheatsheet. Image
Equipped with this cheatsheet we can already understand most of the following Quarto code.

Notice the first few lines. These are like the header in LaTeX and contain the metadata of the document. Image
The header implies that we can create a pdf- and html-file from this. Here's how they look.

Pretty similar, right?

That's the power of Quarto.

One Interface, many Outputs. ImageImage
Alright, you get the idea.

Now, let me show you that Quarto can do all the tricks of the LaTeX trade.

I hope that once you accept that, you are less hesitant to adopt Quarto.

Once you're at that point, maybe making your beautiful math accessible online isn't so hard anymore.
So, how can we customize our pdf?

Luckily, you can still use all of your LaTeX knowledge to style your output.

In the Quarto header you can overwrite the default style with your own latex commands.

Let's use that to make the theorem and definition numbering better. Image
Don't worry if you don't understand all the changes right away.

This isn't a full-blown Quarto tutorial after all.

But I'll show you how to try out Quarto yourself at the end.
This requires two changes in the header:

1. Enable section numbering
2. Add a latex file that reformats the standard def/thm environments (using a dummy environment) ImageImageImage
Notice that the changes in our header affect ONLY the pdf-output.

This means that we get the freedom to style each output separately.
But what if we need a very specific PDF output? Like for a journal?

In that case we have 2 options:

1. Check if there is already a Quarto template for your journal.

2. Download the journal LaTeX template and use it as template in the Quarto header
Option 1: Quarto template

The list of journal-specific templates is currently short. After all, Quarto is quite new.

But the list is growing. You can find a current list here
github.com/mcanouil/aweso…
Option 2: Use a LaTeX template

You can declare a LaTeX template in the header. For example, here's a pdf generated from the Wiley template.

The mechanics are a bit tricky to describe in 280 characters. But the Quarto docs explain it very well at quarto.org/docs/journals/… Image
Finally, let me address maybe one last concern:

What about the tex-code? At some point you will need tex-code for the journal or someone else.

But that's no problem at all. You can simply set "keep-tex" to true in the header and you will have both the pdf- and the tex-file.
Alright, that's a wrap.

I hope that you enjoyed this thread. If so, don't forget to spread the word.

Are you curious about Quarto now? You can find resources to get started at

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Albert Rapp

Albert Rapp Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @rappa753

Nov 2
I have 10+ years of university-level education.

But no lecture taught me how to create good visualizations.

These things are crucial for communication but are often not part of the training.

So, let's have a crash course on visualization guidelines anyone can implement. 🧵
1. Know your audience

You can't use the same visualization for every audience.

A plot that works in a scientific journal may bore (or confuse) non-scientists.
2. Know your takeaways

Forget the dream of putting ALL of your great insights into one powerful plot.

This. does. not. work.

If anything, this dream is a gateway to using too many chart types all at once.

Visualize only your most important insights (maybe in separate plots).
Read 17 tweets
Oct 23
Paired bar charts suck at comparing values.

Still, they're used all the time because they are easy to make.

But there are better alternatives that are just as easy.

Here's how to create 4 alternatives with #rstats. 🧵
0 // Where's the code?

The code for all plots can be found at albert-rapp.de/posts/ggplot2-…

This thread walks you through the code quickly.
1 // Dot plot

Instead of using bars next to each other, why not points on the same line?

Makes comparison suuper easy.

And it takes only a geom_point() layer. Dead-simple, right?

I think it's even easier to create than a paired bar chart.
Read 17 tweets
Oct 7
Powerful functions can improve your coding experience.

They will save you time and nerves.

Want to learn how to write better functions?

Let me walk you through two advanced #rstats concepts. 🧵
Imagine that you want to count variables in your data set.

I'll use the Palmerpenguins data for demo purposes here.

Check out how your code could look.
Notice how the logic is always the same and only the variable changes?

Let's pour that logic into a function.

Be careful, though. It's not as easy as it looks.
Read 12 tweets
Sep 30
BEFORE
- Standard bar chart
- No clue what the message is

AFTER
- Bar chart with nuanced color use
- Informs your reader about key insights & actions

The latter is actually pretty easy to pull off.

At the end of this step-by-step guide, you can do that too. #rstats #dataviz Image
Here's our starting point.

All code is available at albert-rapp.de/posts/ggplot2-…

Note that this tutorial is a ggplot2 recreation of Image
// Labels on y-axis

First, move the names to the y-axis.

This is important when the labels are real names instead of IDs.

No one likes to tilt their head for reading. Image
Read 20 tweets
Sep 19
I hate it when I can't customize each part of my ggplot. Usually, that happens when an aesthetic is not vectorized.

Luckily, there's an easy workaround. Here's how. 🧵 #rstats
Take a look at these two curved lines. Currently, both have the same curvature.

But what happens if I want different curvatures? Image
Unfortunately, I can't just pass 2 numbers to curvature. This will give me an error 😢 💔 Image
Read 9 tweets
Aug 19
With #rstats, it's dead-simple to implement logistic regression or Poisson regressions. Or any other kind of generalized linear model.

Here's how you can do that with {stats} or with {tidymodels}. 🧵
#Statistics #MachineLearning
Need to brush up on the math behind these models before we get started?

My most popular thread may help you.
One more hint before we start:

All of my code examples can be copied from my newest blog post.

The data that I use here comes from {palmerpenguins}. And we're going to classify a penguin's sex based on its weight, species and bill length. 🐧 🐧

albert-rapp.de/posts/14_glms/…
Read 18 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(