-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Reduce space between rendered rules of a judgement form #264
Comments
The best way I have found to handle placement of individual rules in a
judgment form is to make them each into independent picts and then put them
manually into a larger pict with the precise layout to fit the page well.
That said, I could add more parameters to control some of the spaces you're
seeing below (later on).
Robby
…On Thu, Jun 29, 2023 at 8:00 AM o6po5fcs ***@***.***> wrote:
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.
#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.
[image: annotated-space]
<https://user-images.githubusercontent.com/115168139/249812038-6dfdd514-f612-4e99-a96d-cc70e4d78a8b.jpg>
—
Reply to this email directly, view it on GitHub
<#264>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADBNMDMAZWOEPZ7QX7RXILXNWJ65ANCNFSM6AAAAAAZYUPY4U>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Alright, thank you for the quick response! I had hoped to (as much as possible) make the figures easy to reproduce in code, but in this specific instance it is probably much faster to edit the pdf in Adobe Illustrator to reposition the rules. For my part the issue can be closed, but I will keep it open for now in case the |
The disadvantage to using adobe is that you'll have to redo that work when the rules change and it can be easy to forget to do. If you're using scribble to write the document itself, you can just drop picts in anywhere (eg in a figure) and then building the paper will always just use the latest version of the redex code. Here's how you can eliminate the blank space between the clauses, for example.
|
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?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.The text was updated successfully, but these errors were encountered: