Skip to content
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠
CFD中文网

CFD中文网

  1. CFD中文网
  2. CFD彩虹条
  3. 写给工程技术人员的 LaTeX 安装指南

写给工程技术人员的 LaTeX 安装指南

已定时 已固定 已锁定 已移动 CFD彩虹条
14 帖子 8 发布者 13.8k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 星 离线
    星 离线
    星星星星晴
    写于 最后由 编辑
    #5

    Mac下配置LaTeX + Sublime Text +skim or mac自带预览

    1. 下载MacTex,完整安装包4GB左右
      https://www.tug.org/mactex/

    截屏2021-05-27 21.35.37.png
    截屏2021-05-27 21.37.25.png
    截屏2021-05-27 21.36.35.png
    2. 下载文本编辑器Sublime Text
    https://www.sublimetext.com/
    2.1 在Sublime Text中安装package Control,网上很多教程
    2.2 在Sublime Text里Command+Shift+P调出命令窗口,输入Install,之后选择LaTexTools, 我的因为已经安装过了,所以没有下面的选项,
    截屏2021-05-27 22.19.47.png
    截屏2021-05-27 22.20.06.png

    3.下载skim, PDF阅读器,可以实时编译,有点类似overleaf在线一样的效果,设置同步,如下图。
    https://skim-app.sourceforge.io/
    截屏2021-05-27 22.20.06.png
    截屏2021-05-27 22.23.19.png
    截屏2021-05-27 22.23.39.png

    至此,英文环境就没问题了。
    在sublime中 工具- 编译系统-选择LaTeX
    然后 command+B即可编译
    效果如下
    截屏2021-05-27 22.26.12.png
    截屏2021-05-27 22.52.05.png
    截屏2021-05-27 22.52.54.png

    1. 中文环境
      ***下面中文环境的配置仅仅简单测试过,平时不会使用中文LaTeX环境, 仅供参考
      打开terminal 输入如下命令,tlmgr 是MacTex的包管理工具,顺手安装一下ctex的包
    sudo tlmgr update --self
    sudo tlmgr install latexmk
    sudo tlmgr install ctex
    
    

    然后在Sublime中,Preferences——Package Settings——LaTeXTools——Reconfigure LaTeXTools and migrate settings重建配置文件),在builder-settings下面新增两项配置:

    "program" : "xelatex",
    "command" : ["latexmk", "-cd", "-e", "$pdflatex = 'xelatex -interaction=nonstopmode -synctex=1 %S %O'", "-f", "-pdf"],
    

    简易的中文设置: 在tex文件前加上如下代码:

    %!TEX program = xelatex
    %!TEX TS-program = xelatex
    %!TEX encoding = UTF-8 Unicode
    

    使用ctex包

    \usepackage[UTF8]{ctex}
    
    
    1. 测试
      随便选了一个中文模板,中间会要求下载字体。
      https://www.latexstudio.net/archives/51626.html
      截屏2021-05-27 22.16.13.png

    清华的LaTeX模版编译总会提示Error,错误Log如下

    [Compiling /Users/xxxxxxxx/Downloads/thuthesis-master/thuthesis-example.tex]
    
    TraditionalBuilder: Your custom command does not allow the engine to be selected
    
    Invoking latexmk... done.
    
    Errors:
    
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Package fontspec Error: The font "Kaiti SC Regular" cannot be found. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Package fontspec Error: The font "Kaiti SC Regular" cannot be found. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXfeaturename with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXisexclusivefeature with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXselectorname with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXfeaturename with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXisexclusivefeature with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXselectorname with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Missing \endcsname inserted. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Missing \endcsname inserted. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: LaTeX Error: Missing \begin{document}. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Extra \endcsname. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Package fontspec Error: The font "Kaiti SC Bold" cannot be found. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Package fontspec Error: The font "Kaiti SC Bold" cannot be found. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXfeaturename with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXisexclusivefeature with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXselectorname with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXfeaturename with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXisexclusivefeature with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Cannot use \XeTeXselectorname with nullfont; not an AAT or Graphite font. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Missing \endcsname inserted. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Missing \endcsname inserted. [\thu@set@cjk@font]
    /usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls:1019: Extra \endcsname. [\thu@set@cjk@font]
    
    Warnings:
    
    /Users/xxxxxx/Downloads/thuthesis-master/data/appendix.tex: LaTeX Warning: `h' float specifier changed to `ht'.
    
    /Users/xxxxxxx/Downloads/thuthesis-master/thuthesis-example.log:1: Double-click here to open the full log.
    
    [Done!]
    
    
    1. 如果不想使用Skim的话,可以在LatexTools中做如下设置
      在Settings中的第487行,将"viewer": "",改为"viewer": "preview",这个操作会让你在Sublime Text3中build完.tex后自动弹出预览(preview),以便检查PDF文件。
      截屏2021-05-27 23.05.21.png
      截屏2021-05-27 23.05.29.png

    游荡

    1 条回复 最后回复
  • S 离线
    S 离线
    Sloan
    在 中回复了 peiying 最后由 编辑
    #6

    @peiying 这个用着好用吗

    1 条回复 最后回复
  • chengan.wangC 离线
    chengan.wangC 离线
    chengan.wang
    在 中回复了 李东岳 最后由 编辑
    #7

    @李东岳 请教东岳大佬,我看见你在朋友圈发了几张图挺漂亮的,能公开一下开代码吗?

    mmexport1638775239683.jpg mmexport1638775221605.jpg

    李东岳李 1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    在 中回复了 chengan.wang 最后由 编辑
    #8

    @chengan-wang http://www.dyfluid.cn/theory.pdf

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    chengan.wangC 1 条回复 最后回复
  • chengan.wangC 离线
    chengan.wangC 离线
    chengan.wang
    在 中回复了 李东岳 最后由 编辑
    #9

    @李东岳 这些图有对应的latex源代码么?

    李东岳李 1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    在 中回复了 chengan.wang 最后由 编辑
    #10

    @chengan-wang 没有,这是用Adobe AI做的

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    chengan.wangC 1 条回复 最后回复
  • chengan.wangC 离线
    chengan.wangC 离线
    chengan.wang
    在 中回复了 李东岳 最后由 编辑
    #11

    @李东岳 谢谢

    李东岳李 1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    在 中回复了 chengan.wang 最后由 编辑
    #12

    @chengan-wang 理解起来怎么样

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    chengan.wangC 1 条回复 最后回复
  • chengan.wangC 离线
    chengan.wangC 离线
    chengan.wang
    在 中回复了 李东岳 最后由 编辑
    #13

    @李东岳 其实目前只是浏览了一下

    1 条回复 最后回复
  • 黑山雁黑 离线
    黑山雁黑 离线
    黑山雁
    写于 最后由 编辑
    #14

    提醒读者: 因近期图床地址变动,以上贴子中的图片可能失效,这里附上我个人博客中的相应页面(可以正常浏览),以供后来者参考:写给工程技术人员的 LaTeX 安装指南

    1 条回复 最后回复

  • 登录

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]