gfngfn / SATySFi

A statically-typed, functional typesetting system
GNU Lesser General Public License v3.0
1.17k stars 83 forks source link

a space with 0pt glue #201

Open abenori opened 4 years ago

abenori commented 4 years ago

With the following code, after replacing the second \myp{ああああ} with \mypvar{ああああ}, you will get the shorter space between the first line and the second line.

@require: stdja
let-block ctx +myp i = line-break true true ctx ((read-inline ctx i) ++ inline-fil)
let-block ctx +mypvar i = line-break true true (set-paragraph-margin 0pt 0pt ctx) ((read-inline ctx i) ++ inline-fil)
in
document (|title={};author={};show-title=false;show-toc=false;|)'<
  +myp{ああああ}
  +myp{ああああ}% shorter space after -> \mypvar{ああああ}
  +myp{ああああ}
>

The picture shows the difference. (For making it clear, I changed the color, blue is for \myp{ああああ}+\myp{ああああ}+\myp{あああ} while red is for \myp{ああああ}+\mypvar{ああああ}+\myp{ああああ}.) satysfi

abenori commented 4 years ago

You get the same result if the definition of \mypvar is changed to

let-block ctx +mypvar i = (block-skip 0pt) +++ (line-break true true (set-paragraph-margin 0pt 0pt ctx) ((read-inline (red ctx) i) ++ inline-fil))