Code Monkey home page Code Monkey logo

latex-book-template's Introduction

LaTeX 中文书籍模板

本模板用于使用LaTeX排版中文书籍。

Quick Start

首先下载并安装texlive 2021,安装minted包,然后执行如下命令。

git clone [email protected]:NelsonCheung-cn/latex-book-template.git
cd latex-book-template
xelatex -shell-escape book.tex
xelatex -shell-escape book.tex

生成的book.pdf为模板示例。

或者直接将项目上传至overleaf,然后将compiler更换成XeLaTeX即可编译。

部分效果如下(github的内嵌pdf显示器可能无法显示中文......)。

Introduction

本模板使用ctexbook作为documentclass,见book.tex,如下所示。

\documentclass[openany,10pt,UTF-8,CJK,GBK]{ctexbook}

\usepackage[a4paper,twoside,width=15cm]{geometry}

\include{package.tex}

\begin{document}

\frontmatter

\include{title.tex}

\vspace*{\fill}
    \begin{center}
        \textit{谨以此书献给我的家人。}
    \end{center}
\vspace*{\fill}

\include{preface.tex}

\tableofcontents

\mainmatter

\include{chapter_1.tex}
\include{chapter_2.tex}
\include{chapter_3.tex}
\include{chapter_4.tex}
\include{chapter_5.tex}
\include{chapter_6.tex}

\include{attachment.tex}

\end{document}

由于书籍模板常用于排版大量文字,模板的每一个部分通过\include命令包含进来,\inculde命令包含的tex文件如下所示。

  • package.tex:模板用到的包。
  • title.tex:标题。
  • preface.tex:前言。
  • chapter_X.tex:第X章的内容。
  • attachment.tex:附录。

本模板的文案选自成都理工提供的LaTeX模板,生成的book.pdf中的某些细节可能和模板的实际代码有所出入,详情以源码为准。

References

  1. 成都理工学院实验报告模板 [DOWNLOAD]
  2. Elegantbook [GITHUB]
  3. Book Class: Instructor's Guide [LINK]

latex-book-template's People

Contributors

nelson-cheung 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.