NOTE: scribble and xelatex

Dan's
Blog

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
\usepackage{fontspec}
\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)

@title{Title}
@author+email["Danny" "dannypsnl@gmail.com"]

@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

category:cs

tag:noteracketscribblelatexxelatex

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(林子篆)