NOTE: scribble and xelatex


Programming Language Theory • System Programming

NOTE: scribble and xelatex

scribble is a useful tool to create nice documents, however, with Chinese(any unicode character) it might produce some weird empty box for them. To solve this problem we need to create style.tex.

% style.tex
\setmainfont{Kaiti TC}

% reduce word spacing
\spaceskip \fontdimen 2 \font
% auto line breaks
\XeTeXlinebreaklocale "zh"

Kaiti TC can be changed to any supported fonts on your machine.

Then we have our scribble document.

; test.scrbl
#lang scribble/manual

@(require scribble/core)

@author+email["Danny" ""]

@para[#:style 'pretitle]{
 @elem[#:style (make-style "fontsize" '(exact-chars))]|{8pt}{12pt}|
 @elem[#:style "selectfont"]}


Using command: scribble ++style style.tex --latex test.scrbl, it should produce test.tex, then eval xelatex test.tex should produce test.pdf. That is!

author: Lîm Tsú-thuàn/林子篆/Danny



Similar Articles

Buy Me A CoffeeCreative Commons Attribution-NonCommercial-NoDerivatives 4.0 InternationalAll works in this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
©2021 dannypsnl(林子篆)