Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
61
2020 1 10 @
2
[ˈsætɪsˌfaɪ]
• 2017
• DSL
https://github.com/gfngfn/SATySFi
Better LATEX
•
•
3
•
•
•
•
•
•
2
WYSIWYG
troff
5
[Microsoft 1983] [Adobe 1991]
[Quark 1987]
[Lamport 1985][Knuth 1978]
[Gruber 2004]
[Osanna 1973]
RE:VIE...
WYSIWYG
6
😄
•
•
•
•
WYSIWYG
7
😄 😩
••
•
•
•
LATEX
•
•
8
! Undefined control sequence.
! Missing $ inserted.
! Missing number, treated as zero.
LATEX
•
•
9
! Undefined control sequence.
! Missing $ inserted.
! Missing number, treated as zero.
10
https://github.com/gfngfn/SATySFi
Static Analysis-based TYpesetting System
for Functional Implementation
🤔
(1/2)
11
2
+section{SATySFi; }<
+p{
emph{ }
}
>
let-inline ctx emph it =
let ctx =
ctx |> set-font
Latin italic-font
in
re...
(2/2)
• “ ”
•
•
•
12
“ ” OCaml
• ML
• Hindley–Milner
•
•
•
•
•
13
SML# [Ohori 1995][Milner 1978]
•
•
•
•
•
•
15
https://drive.google.com/open?id=1muaWGgyAGfIYJNyKfKvvAzN8vur1sTG3
• TEX [Knuth & Plass 1981]
– Unicode Line Breaking Algorithm
–
– [Liang & Knuth 1983]
• OpenType
(1/2)
16
•
– OpenType MATH
– Future Work
•
•
• figure
• ref label
• TikZ
(2/2)
17
2
18
•
LATEX
LATEX
https://drive.google.com/open?id=1r14gHwCUxe3DQjoxkGHDWWkwtHWqMwaY
https://drive.google.com/open?id=1DyKB0V2xIKz6SMYNGdEWnupPAxXkWCeE
•
•
•
•
•
•
“ ”
PDF
OpenType
22
23
“ ”
PDF
OpenType
“ ”
PDF
OpenType
24
{The quick brown fox … }
“ ”
PDF
OpenType
25
Y
______]
______[
•
–
•
–
26
2
•
–
•
–
•
–
•
–
27
Y
______]
______[
Y
______]
______[
28
{The quick brown fox … }
inline-text
inline-boxes block-boxes
< +p{
The quick
brown fox …
} >
block-text
29
{The quick brown fox … }
Y
______]
______[
•
•
• ...
context
read-inline {The quick brown fox jumps … }
• read-inline :...
• line-break : bool → bool → context → inline-boxes → block-boxes
30
line-break true true Ctx
– 2
–
– Knuth–Plass
Ctx
[Knu...
• 
–
• +
–
31
let-inline  =cmdy x1 · · · xn e
0
cmd
cmd
Y
______]
______[
32
let-inline ctx emph contents =
let ctx-emph =
ctx |> set-font Latin italic-font
in
read-inline ctx-emph contents
emph
33
The emph{quick brown} fox jumps …
read-inline {The emph{quick brown} fox jumps … }
……
Ctx
Ctx
34
emph{quick brown} fox jumps …
read-inline {The emph{quick brown} fox jumps … }
……
Ctx
Ctx
35
emph{quick brown} fox jumps …
let-inline ctx emph contents =
let ctx-emph =
ctx |> set-font Latin italic-font
in
read-i...
let-inline ctx emph contents =
let ctx-emph =
ctx |> set-font Latin italic-font
in
read-inline ctx-emph contents
36
emph{q...
37
emph{quick brown} fox jumps …
quick brown
read-inline {The emph{quick brown} fox jumps … }
……
Ctx
Ctx
CtxÕ
38
emph{quick brown} fox jumps …
brown
read-inline {The emph{quick brown} fox jumps … }
……
Ctx
Ctx
CtxÕ
39
emph{quick brown} fox jumps …
read-inline {The emph{quick brown} fox jumps … }
……
Ctx
Ctx
CtxÕ
40
fox jumps …
read-inline {The emph{quick brown} fox jumps … }
……
Ctx
Ctx
41
fox jumps …
read-inline {The emph{quick brown} fox jumps … }
……
Ctx
Ctx
42
jumps …
read-inline {The emph{quick brown} fox jumps … }
……
Ctx
Ctx
43
[ ; ; ] inline-cmd·1 ·n· · ·
+p{
fbox{parbox(5cm)<
+p{ }
>}
}
[ ; ; ] block-cmd·1 ·n· · ·
• emph : [ inline-text ] inli...
•
•
•
•
•
•
😄
😩
•
45
DSL
46
amidakuji(```
|X|-|=|/| |
| |-||-|X|
|=|X|-||=|
|-||-|=|-|
|X|=|-|| |
```);
amidakuji([
[Cross ; Line ; … ];
[Empty...
•
DSL
47
•
–
– Lisp quasiquote
– MetaML [Taha 1997] MetaOCaml [Kiselyov 2014]
•
–
–
48
•
–
–
49
50
https://drive.google.com/open?id=1LMXFbEXLAjwscC5gKZnvBwR2O5gjIu8Y
•
•
•
•
•
•
• VM [ matsud224]
•
– HTML LATEX
–
• Markdown
–
52
•
– LTR/RTL
– OpenType on/off jp90 (JIS 90 form)
•
–
–
–
–
–
•
–
Future Work
53
B5 / 160
https://booth.pm/
ja/items/1127224
satysfi book
•
•
•
•
•
•
•
https://github.com/gfngfn/SATySFi
• DSL
•
•
•
Pull Request
56
Nächste SlideShare
Wird geladen in …5
×

静的型つき組版処理システムSATySFi @第61回プログラミング・シンポジウム

2.286 Aufrufe

Veröffentlicht am

第61回プログラミング・シンポジウムにて発表した際のスライド資料です.

Veröffentlicht in: Ingenieurwesen
  • Loggen Sie sich ein, um Kommentare anzuzeigen.

静的型つき組版処理システムSATySFi @第61回プログラミング・シンポジウム

  1. 1. 61 2020 1 10 @
  2. 2. 2 [ˈsætɪsˌfaɪ] • 2017 • DSL https://github.com/gfngfn/SATySFi
  3. 3. Better LATEX • • 3
  4. 4. • • • • • •
  5. 5. 2 WYSIWYG troff 5 [Microsoft 1983] [Adobe 1991] [Quark 1987] [Lamport 1985][Knuth 1978] [Gruber 2004] [Osanna 1973] RE:VIEW [ et al. 2002]
  6. 6. WYSIWYG 6 😄 • • • •
  7. 7. WYSIWYG 7 😄 😩 •• • • •
  8. 8. LATEX • • 8 ! Undefined control sequence. ! Missing $ inserted. ! Missing number, treated as zero.
  9. 9. LATEX • • 9 ! Undefined control sequence. ! Missing $ inserted. ! Missing number, treated as zero.
  10. 10. 10 https://github.com/gfngfn/SATySFi Static Analysis-based TYpesetting System for Functional Implementation 🤔
  11. 11. (1/2) 11 2 +section{SATySFi; }< +p{ emph{ } } > let-inline ctx emph it = let ctx = ctx |> set-font Latin italic-font in read-inline ctx it “ ” “ ” • LATEX • { … } < … > • OCaml •
  12. 12. (2/2) • “ ” • • • 12 “ ” OCaml
  13. 13. • ML • Hindley–Milner • • • • • 13 SML# [Ohori 1995][Milner 1978]
  14. 14. • • • • • •
  15. 15. 15 https://drive.google.com/open?id=1muaWGgyAGfIYJNyKfKvvAzN8vur1sTG3
  16. 16. • TEX [Knuth & Plass 1981] – Unicode Line Breaking Algorithm – – [Liang & Knuth 1983] • OpenType (1/2) 16
  17. 17. • – OpenType MATH – Future Work • • • figure • ref label • TikZ (2/2) 17
  18. 18. 2 18 • LATEX
  19. 19. LATEX https://drive.google.com/open?id=1r14gHwCUxe3DQjoxkGHDWWkwtHWqMwaY
  20. 20. https://drive.google.com/open?id=1DyKB0V2xIKz6SMYNGdEWnupPAxXkWCeE
  21. 21. • • • • • •
  22. 22. “ ” PDF OpenType 22
  23. 23. 23 “ ” PDF OpenType
  24. 24. “ ” PDF OpenType 24 {The quick brown fox … }
  25. 25. “ ” PDF OpenType 25 Y ______] ______[
  26. 26. • – • – 26
  27. 27. 2 • – • – • – • – 27 Y ______] ______[ Y ______] ______[
  28. 28. 28 {The quick brown fox … } inline-text inline-boxes block-boxes < +p{ The quick brown fox … } > block-text
  29. 29. 29 {The quick brown fox … } Y ______] ______[ • • • ... context read-inline {The quick brown fox jumps … } • read-inline : context → inline-text → inline-boxes Ctx
  30. 30. • line-break : bool → bool → context → inline-boxes → block-boxes 30 line-break true true Ctx – 2 – – Knuth–Plass Ctx [Knuth & Plass 1981]
  31. 31. • – • + – 31 let-inline =cmdy x1 · · · xn e 0 cmd cmd Y ______] ______[
  32. 32. 32 let-inline ctx emph contents = let ctx-emph = ctx |> set-font Latin italic-font in read-inline ctx-emph contents emph
  33. 33. 33 The emph{quick brown} fox jumps … read-inline {The emph{quick brown} fox jumps … } …… Ctx Ctx
  34. 34. 34 emph{quick brown} fox jumps … read-inline {The emph{quick brown} fox jumps … } …… Ctx Ctx
  35. 35. 35 emph{quick brown} fox jumps … let-inline ctx emph contents = let ctx-emph = ctx |> set-font Latin italic-font in read-inline ctx-emph contents Ctx read-inline {The emph{quick brown} fox jumps … } …… Ctx
  36. 36. let-inline ctx emph contents = let ctx-emph = ctx |> set-font Latin italic-font in read-inline ctx-emph contents 36 emph{quick brown} fox jumps … Ctx read-inline {The emph{quick brown} fox jumps … } …… Ctx
  37. 37. 37 emph{quick brown} fox jumps … quick brown read-inline {The emph{quick brown} fox jumps … } …… Ctx Ctx CtxÕ
  38. 38. 38 emph{quick brown} fox jumps … brown read-inline {The emph{quick brown} fox jumps … } …… Ctx Ctx CtxÕ
  39. 39. 39 emph{quick brown} fox jumps … read-inline {The emph{quick brown} fox jumps … } …… Ctx Ctx CtxÕ
  40. 40. 40 fox jumps … read-inline {The emph{quick brown} fox jumps … } …… Ctx Ctx
  41. 41. 41 fox jumps … read-inline {The emph{quick brown} fox jumps … } …… Ctx Ctx
  42. 42. 42 jumps … read-inline {The emph{quick brown} fox jumps … } …… Ctx Ctx
  43. 43. 43 [ ; ; ] inline-cmd·1 ·n· · · +p{ fbox{parbox(5cm)< +p{ } >} } [ ; ; ] block-cmd·1 ·n· · · • emph : [ inline-text ] inline-cmd • +p : [ inline-text ] block-cmd • parbox : [ length; block-text ] inline-cmd ·i i
  44. 44. • • • • • •
  45. 45. 😄 😩 • 45
  46. 46. DSL 46 amidakuji(``` |X|-|=|/| | | |-||-|X| |=|X|-||=| |-||-|=|-| |X|=|-|| | ```); amidakuji([ [Cross ; Line ; … ]; [Empty ; Line ; … ]; [Double; Cross; … ]; … ]);
  47. 47. • DSL 47
  48. 48. • – – Lisp quasiquote – MetaML [Taha 1997] MetaOCaml [Kiselyov 2014] • – – 48
  49. 49. • – – 49
  50. 50. 50 https://drive.google.com/open?id=1LMXFbEXLAjwscC5gKZnvBwR2O5gjIu8Y
  51. 51. • • • • • •
  52. 52. • VM [ matsud224] • – HTML LATEX – • Markdown – 52
  53. 53. • – LTR/RTL – OpenType on/off jp90 (JIS 90 form) • – – – – – • – Future Work 53
  54. 54. B5 / 160 https://booth.pm/ ja/items/1127224 satysfi book
  55. 55. • • • • • •
  56. 56. • https://github.com/gfngfn/SATySFi • DSL • • • Pull Request 56

×