Scribble: how to center a tabular?

222 Views Asked by At

I'm writing a technical paper with Scribble. The paper contains a table. I'm making the table with tabular. So far so good.

I want to center the table, but wrapping my tabular with centered has no effect. Help!

1

There are 1 best solutions below

0
On BEST ANSWER

You should wrap your table in a centered and also supply 'block as a style argument:

#lang scribble/acmart
@title{Centered Table Below}

@centered[
  @tabular[
    #:sep (hspace 2)
    #:style 'block
    '(("hello" "world"))]]

Why?

  • By default, a tabular makes a table that can contain page breaks
  • The 'block style prevents page breaks (documentation)
  • And un-breakable tables happen to be implemented with a LaTeX macro that can be centered