Code Monkey home page Code Monkey logo

uestc-glasgow-final-year-report-template's Introduction

格院毕设LaTeX模板简略说明

依赖安装

  • 首先你需要安装一个LaTeX发行版, 推荐安装TeXLive. (默认使用xelatex编译)
  • 参考文献相关内容使用biber生成, Windows平台上这个程序好像一般已经包含在LaTeX发行版中了, 而在Linux下需要单独安装biber
  • 术语表相关内容使用bib2gls生成, 这个工具需要借助java, 因此你需要有java. 不过术语表 (这里有个简单示例) 基本就是装逼用的, 懒得安装可以把main.tex中list of symbols段中的内容注释掉, 然后删掉示例内容中调用的gls{}, 不要术语表
  • 代码插入使用minted包实现, 其中代码语法高亮依赖于代码语法高亮生成工具Pygments. 如果你的路径里有Python, 只需pip install Pygments即可. (同样如果你不需要插入代码那就不用管)

文件结构

.
├── 📁.vscode           vscode配置文件
├── 📁Appendices        各个附录的tex文件文件夹
├── 📁Code              要插入的代码可以放这个文件夹
├── 📁Figures           图片文件夹
├── 📁Front             几个前置页的tex文件文件夹
├── 📁Sections          各个正文章节的tex文件文件夹
├── 📑main.tex          控制页
├── 📑Notations.bib     所有符号, 缩写放在这里
├── 📑sample.pdf        生成出来的pdf该是这样
├── 📑README.md         本说明文件
└── 📑References.bib    所有引用的bibtex放这里

关于版式, 使用的包, 颜色等文章设置, 姓名学号, 一导二导名字等信息都在main.tex这个控制页中, 在main.tex中以\include{AA/Bb.tex}语句添加了Front下的封面, 信息表格, 摘要, 致谢几个前置页, Sections下的几个正文章节以及Appendices下的几个附录. 通过在main.tex中注释掉相应include语句可以在写论文的时候暂时不生成不必要的部分.

通过像Notations.bib中已经给出的例子那样将符号/缩写与含义配对地写在Notations.bib中, 以\gls{xx}来调用, 可以在文中插入点击能跳转到List of Notations页的符号/缩写. 如果不想放这种东西, 可以Notations.bib留空不管.

如果文中想放代码, 可以参考附录2的写法, 将代码放在Code文件夹然后用\inputminted[]{}{}语句插入代码. code这个定义在main.tex中的环境是为了让跨页的代码也能有caption的. 更具体的用法就需要自己上网搜搜minted这个包啦.

\.vscode文件夹中有我在用VSC的LaTeX Workshop插件写LaTeX时用到的配置, 如果你已经安装了完整的TexLive并添加到路径了, 应当直接能用.

指定字体

取消main.tex中38-41行注释来指定常规字体, 无衬线字体, 等宽字体. 注意Times New Roman, Arial, Courier New这几个字体在Linux系统默认是没有的, 是Windows的字体. 可以换成你电脑上装了的字体的全称填进去.

\usepackage{fontspec}
\setmainfont{Times New Roman}
\setsansfont{Arial}
\setmonofont{Courier New}

中文支持

xelatex天然支持中文字符的存在, 但是需要取消main.tex中36行\usepackage{xeCJK}的注释, 输出的pdf中才会在对应处显示出中文. 如果文中不含中文建议还是把这行注释掉.

编译

xelatex ➞ bib2gls ➞ biber ➞ xelatex × 2

在vsc的配置文件中提供了两条编译工具链. 以上面这条为例, xelatex是比pdflatex功能更强大的pdf生成工具, 支持中文字符, bib2gls是根据.bib文件生成符号工具, biber是比bibtex功能更新的引用生成工具, 支持像References.bib中已有的@online这样的引用类型. 如果不想放符号, 可以不调用bib2gls, 用另一条编译工具链. (需要整个注释掉main.texlist of symbols一段的设置)

💡 如果你是用VSC的LaTeX Workshop插件进行的编译, 你会发现多了一个main.synctex.gz (如果你是以其他方式编译的, 那很有可能多出很多文件), 这个是用于tex源文件与pdf正反向同步用的文件, 删掉了就无法在pdf中按着Ctrl点到字或者图上跳转到tex文件中对于字段了.

小技巧

通过取消main.tex第16行的注释, 即给\documentclass[]{article}加上draft选项, 会开启草稿模式, 以线框代替图片, 在布局不恰当处用粗黑线标出, 生成也会更快.

取消17行的注释的话会以线条显示出当前布局.

更多LeTaX帮助

最近在更新一篇LaTeX使用笔记, 学弟学妹们有兴趣可以看看 😏


祝学弟学妹们毕业设计顺利, 圆满毕业 💪

uestc-glasgow-final-year-report-template's People

Contributors

leojhonsong avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

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.