GithubHelp home page GithubHelp logo

fusyong / vertical-typesetting Goto Github PK

View Code? Open in Web Editor NEW
14.0 1.0 3.0 2.17 MB

a ConTeXt LMTX module for Chinese vertical typesetting

Lua 96.62% TeX 3.38%
typesetting chinese context luatex luametatex vertical cjk tex

vertical-typesetting's Introduction

ConTeXt模块,在ConTeXt lmtx/LuaTEX环境中实现中文竖排/直书。

安装和使用方法

  • 两种安装方法:
    1. ConTeXt官方指南安装模块文件:t-vtypeset.mkiv(入口)和t-vtypeset.lua,然后使用context --generate命令更新文件索引
    2. 将上述文件直接放在编译时的当前路径(通常即排版脚本所在的目录,在vscode环境中即项目根目录);直接使用lua模块时不限定存放位置,但需要自行确保导入位置正确
  • 使用时在排版脚本前言中设置如下:
%%%%%%%%%%%%% 使用模块(保持顺序) %%%%%%%%%%%%%
% 竖排
\usemodule[vtypeset]


% 标点压缩与支持
\usemodule[zhpunc][pattern=kaiming, spacequad=0.5, hangjian=false]
% 
% 四种标点压缩方案:全角、开明、半角、原样:
%   pattern: quanjiao(default), kaiming, banjiao, yuanyang
% 行间标点(转换`、,。.:!;?`到行间,pattern建议用banjiao):
%   hangjian: false(default), true
% 加空宽度(角):
%   spacequad: 0.5(default)
% 
% 行间书名号和专名号(\bar实例):
%   \zhuanmh{专名}
%   \shumh{书名}


% 夹注
\usemodule[jiazhu][fontname=tf, fontsize=10.5pt, interlinespace=0.2em]
% default: fontname=tf, fontsize=10.5pt, interlinespace=0.08em(行间标点时约0.2em)
% fontname和fontsize与\switchtobodyfont的对应参数一致
% 夹注命令:
%   \jiazh{夹注}

可参考test文件夹下样例脚本中的设置(可能使用了夹注jiazhu、竖排vtypeset、标点挤压zhpunc三个模块)。

编译脚本

  1. 仅在ConTeXt LMTX环境测试。ConTeXt LMTX是与LuaMetaTeX(LuaTeX的后继者)配合使用的、最新的ConTeXt版本。调整后当可用于LuaTeX。可以使用context --version && luametatex --version命令查看你的环境版本。
  2. 如下编译排版脚本:
    > context 大学章句.lmtx
  3. 如果控制台显示中文时有乱码,可用命令临时改变代码页:
    > chcp 65001

效果

plot

plot

bug & TODO

  • 字符旋转、对齐
  • 双行夹注/割注,参见jiazhu插件
  • 字右、字左注音
  • 《标点符号用法》 5.2 竖排文稿标点符号的位置和书写形式
    • 5.2.1 句号、问号、叹号、逗号、顿号、分号和冒号均置于相应文字之下偏右。
    • 5.2.2 破折号、省略号、连接号、间隔号和分隔号置于相应文字之下居中,上下方向排列。
    • 5.2.3 引号改用双引号“﹃”“﹄”和单引号“﹁”“﹂”,括号改用“︵”“︶”,标在相应项目的上下。
    • 5.2.4 竖排文稿中使用浪线式书名号“﹏”,标在相应文字的左侧。
    • 5.2.5 着重号标在相应文字的右侧,专名号标在相应文字的左侧。
    • 5.2.6 横排文稿中关于某些标点不能居行首或行末的要求,同样适用于竖排文稿。
  • 改为在shipouts after回调中装盒旋转
    • 缓存标点的偏置数据
    • 缓存旋转后的盒子(至少是标点盒子),并测试收益
  • 模块化
  • 兼容现有bar功能
    • 文字(text选项,可做竖排书名号/波浪线)
      • 楷体正文时有间隙
    • MetaPost(mp选项)
  • 删除破折号、省略号禁止排在行头的规则
  • 更改旋转对齐规则(解决“一、灬”等字的问题)
  • 使PDF文件拷贝后的文字分行、分段正确
  • 管理属性设置,防止冲突(包括标点压缩、夹注个模块)
  • 模拟doublesided效果

vertical-typesetting's People

Contributors

fusyong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vertical-typesetting's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.