Skip to content

Reduce space between rendered rules of a judgement form #264

Description

@o6po5fcs

I have quite a large judgment form to be rendered for a paper, and I would like to somewhat compact it by reducing the space between the different rules. A standalone excerpt of the judgment form can be found below. To demonstrate, I set all of the "spacing" parameters that I could find to 0, even when they do not affect the rendering of judgment forms.

As a sidenote, I have noticed that, in some cases, the parameter horizontal-bar-spacing reduces only the space above a horizontal bar, and not below. In the screenshot below the code I highlighted one such instance with a red arrow. Possibly related to the inclusion of a unicode union character in the bottom line?

#lang racket

(require redex
         redex/pict)
(define-language CommonLang
  (k ::= number i)
  (p ::= (k ...)) 
  (p-exp ::= k * [script-op (~ k ...)] [script-op k] [⋃ k ...]))

(define-judgment-form
  CommonLang
  #:mode     (matches-in-env I I I)
  #:contract (matches-in-env ps p env)
  
  [--------------------------------- "empty-selector"
   (matches-in-env () () env)]
  [(matches-in-env (p-exp ...) (k_2 ...) env)
   --------------------------------- "literal-key"
   (matches-in-env (k_1 p-exp ...) (k_1 k_2 ...) env)]
  [(matches-in-env (k_1 p-exp ...) (k_2 ...) env)
   --------------------------------- "union-first"
   (matches-in-env ([⋃ k_1 k_3 ...] p-exp ...) (k_2 ...) env)])

(define (render-matches-in-env . filepath)
  (arrow-space 0)
  (label-space 0)
  (reduction-relation-rule-separation 0) 
  (reduction-relation-rule-extra-separation 0)
  (reduction-relation-rule-line-separation 0)
  (horizontal-bar-spacing 0)
  (metafunction-gap-space 0)
  (metafunction-rule-gap-space 0)
  (metafunction-line-gap-space 0)

  (if (empty? filepath)
      (render-judgment-form matches-in-env)
      (render-judgment-form matches-in-env (car filepath))))

The space that I wish to somewhat reduce highlighted with a red bar, and an instance of horizontal-bar-spacing not respecting being set to 0 is highlighted with a red arrow.

annotated-space

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions