zoukankan      html  css  js  c++  java
  • 在debian上安装ctex

    在debian上安装ctex

    在debian上安装ctex

    1 安装texlive-full的问题

    • 安装ctex之前,先安装了texlive-full,配置时发现了问题
    Running mktexlsr. This may take some time... done.
    Building format(s) --all.
    This may take some time... done.
    Running updmap-sys. This may take some time...
    updmap-sys failed. Output has been stored in
    /tmp/updmap.iTM10721
    Please include this file if you report a bug.
    
    • 网上查了一下,与updmap.cfg 有关.打开一看/etc/texmf/updmap.d/10local.cfg,有一 段是
    Map song.map
    Map wqyhei.map
    
    • 这是我以前搞的一些map, 可能没有被系统找到哦,我把内容全部注释掉,重新运行 apt-get install texlive-full
    • 第一次死机了,关机再来,第二次问题解决

    2 编译错误

    • texlive-full装完了,编译却发生问题
    $ latex octave.tex
    This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)
    latex: fatal: Could not undump 1 4-byte item(s).
    
    • 百思不得其解,在网上查,有的说修改源代码,有的是说卸载texlive-full,安装 texlive
    • 在Debian Bug report logs - #197913,发现了解决办法
    Is there a suggestion that I should be running 'fmutil -all' twice in
    jadetex postinst when the fmt cannot be dumped?
    
    > sorry for the inconvenience but now tetex-bin has changed 
    > the default answer to debconf question to "yes" (i.e. turn on) 
    
    I'm glad to hear that, it's a more sane default.
    
    > so I believe you can safely call update-fmtutil and "fmtutil -all"
    
    No, the package needs to be installable whether these are configured
    to be on or off.  I think I have managed to do this with the newest
    jadetex package.
    

    3 安装ctex

    • 在 CTAN 的镜象服务器上找到当前的发行版本(这里使用 CTeX 网站的镜象):
    • 获取源代码后,需要按照 TDS 目录结构重新组织源代码,然后按目录结构复制到发行版 中的本地 TEXMF 目录。例如,在 TeX Live 系统中,本地的 TEXMF 目录一般是
      • usr/share/texmf
    • 将 ctex 源码目录下的 doc 和 test 目录内容放在 TDS 的 usr/share/texmf/doc/latex/ctex 目录下;将其他目录放在 TDS 结构的 usr/share/texmf/tex/latex/ctex 目录下
    • 用sudo运行texhash

    4 缺少文件

    • 安装完ctex后,第一次编译,出现错误:
    % 找不到
    ./engine/ctex-cjk-engine.def:11:  \RequirePackage{CJKpunct}[2009/05/06]
    
    ./fontset/ctex-cjk-winfonts.def:5:  \AtBeginDvi{\input{zhwinfonts}}
    
    http://code.google.com/p/ctex-kit/source/browse/trunk/chinese-fonts/\...
       tex/generic/zhmetrics/zhwinfonts.tex?r=142
    
    \ifCTEX@zhmap
      \AtBeginDvi{\input{zhwinfonts}}
    \fi
    

    5 难缠的配置

    • zhwinfonts.tex
      • 好像是和标点有关,用不着,全部屏蔽
    • ctex调用层次:
    ctex-common.def->ctex-cjk-engine.def->ctex-cjk-winfonts.def->zhwinfonts.tex
                              |
                              v
                          CJKpunct.sty
    
    • 对应字体
      • ctex 宏包默认使用 winfonts 选项,如果不使用其他选项修改字体配置,则需要操作 系统中安装有中文 Windows 操作系统自带的四种 TrueType 字体:宋体、黑体、仿宋 体、楷体。字体文件名为 sinsun.ttc, sinhei.ttf, simfang.ttf, simkai.ttf,字 体名随不同 Windows 版本可能会有区别。
      • 我的系统己安装有song(simsun),wqyhei(wqy-zenhwi),simkai(simkai)三种字体, 需要和crex的字体对应上
      • /usr/share/texmf/tex/latex/ctex/fd/c70rm.fd 修改:
    \DeclareFontFamily{C70}{rm}{\hyphenchar \font\m@ne}
    \DeclareFontShape{C70}{rm}{m}{n}{<-> CJK * song}{} % unisong
    \DeclareFontShape{C70}{rm}{b}{n}{<-> CJK * wqyhei}{} % unihei
    \DeclareFontShape{C70}{rm}{bx}{n}{<-> CJK * wqyhei}{} % unihei 
    \DeclareFontShape{C70}{rm}{m}{sl}{<-> CJK * song}{} % unisong
    \DeclareFontShape{C70}{rm}{b}{sl}{<-> CJK * wqyhei}{} % unihei 
    \DeclareFontShape{C70}{rm}{bx}{sl}{<-> CJK * wqyhei}{} % unihei 
    \DeclareFontShape{C70}{rm}{m}{it}{<-> CJK * simkai}{} % unikai
    \DeclareFontShape{C70}{rm}{b}{it}{<-> CJKb * simkai}{\CJKbold} % unikai
    \DeclareFontShape{C70}{rm}{bx}{it}{<-> CJKb * simkai}{\CJKbold} % unikai
    
    • /usr/share/texmf/tex/latex/ctex/fd/c70sr.fd 修改:
    \DeclareFontFamily{C70}{sf}{\hyphenchar \font\m@ne}
    \DeclareFontShape{C70}{sf}{m}{n}{<-> CJK * simkai}{} ; uniyou
    \DeclareFontShape{C70}{sf}{b}{n}{<-> CJKb * simkai}{\CJKbold} ; uniyou
    \DeclareFontShape{C70}{sf}{bx}{n}{<-> CJKb * simkai}{\CJKbold}
    \DeclareFontShape{C70}{sf}{m}{sl}{<-> CJK * simkaisl}{}
    \DeclareFontShape{C70}{sf}{b}{sl}{<-> CJKb * simkaisl}{\CJKbold}
    \DeclareFontShape{C70}{sf}{bx}{sl}{<-> CJKb * simkaisl}{\CJKbold}
    \DeclareFontShape{C70}{sf}{m}{it}{<-> CJK * simkai}{}
    \DeclareFontShape{C70}{sf}{b}{it}{<-> CJKb * simkai}{\CJKbold}
    \DeclareFontShape{C70}{sf}{bx}{it}{<-> CJKb * simkai}{\CJKbold}
    
    • /usr/share/texmf/tex/latex/ctex/fd/c70tt.fd 修改:
    \DeclareFontFamily{C70}{tt}{\hyphenchar \font\m@ne} ; unifs
    \DeclareFontShape{C70}{tt}{m}{n}{<-> CJK * simkai}{} ; unifs
    \DeclareFontShape{C70}{tt}{b}{n}{<-> CJKb * simkai}{\CJKbold}
    \DeclareFontShape{C70}{tt}{bx}{n}{<-> CJKb * simkai}{\CJKbold}
    \DeclareFontShape{C70}{tt}{m}{sl}{<-> CJK * simkaisl}{}
    \DeclareFontShape{C70}{tt}{b}{sl}{<-> CJKb * simkaisl}{\CJKbold}
    \DeclareFontShape{C70}{tt}{bx}{sl}{<-> CJKb * simkaisl}{\CJKbold}
    \DeclareFontShape{C70}{tt}{m}{it}{<-> CJK * simkai}{}
    \DeclareFontShape{C70}{tt}{b}{it}{<-> CJKb * simkai}{\CJKbold}
    \DeclareFontShape{C70}{tt}{bx}{it}{<-> CJKb * simkai}{\CJKbold}
    

    Date: 2012-11-20 22:39:56 CST

    Author: the machine of awareness

    Org version 7.8.06 with Emacs version 23

    Validate XHTML 1.0
  • 相关阅读:
    jQuery选择器
    有关ssh的理解
    前端WEB开发人员
    @antdesign/charts 解决echarts图宽高自适应问题,设置100%宽高显示异常
    npm run lintstaged:js报错
    node版本工具 nvm
    nginx域名隐性(地址栏域名不变)跳转
    mysql本地指定loginpath免密登录(mysql_config_editor的用法)
    Git管理查看自己是从那个分支建的分支(什么时间创建的)
    隐藏java代码中 连接数据库、redis等含密码信息方法【配置文件信息安全加密】
  • 原文地址:https://www.cnblogs.com/machine/p/2779869.html
Copyright © 2011-2022 走看看