ctex-org / lshort-zh-cn Goto Github PK
View Code? Open in Web Editor NEWA Chinese edition of the Not So Short Introduction to LaTeX2ε
A Chinese edition of the Not So Short Introduction to LaTeX2ε
目前本项目在 ctan 上名称为 lshort-zh-cn,在 TeX Live 中收录的名称为 lshort-chinese,建议 GitHub 项目与之保持一致。
操作系统
TeX 发行版
指定清华源 tlmgr option repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet
,升级所有宏包后,按照 README-zh.md
中的
xelatex lshort-zh-cn
makeindex -s lshort-zh-cn.ist lshort-zh-cn
xelatex lshort-zh-cn
xelatex lshort-zh-cn
步骤编译,第一步就报错了
不是 MWE,偷懒了 https://github.com/CTeX-org/lshort-zh-cn
(用 XeLaTeX 编译后)输出
Undefined control sequence.
<recently read> \Bbbk
找到对应的位置
lshort-zh-cn/src/chap/sec.symbol.table.tex
Line 379 in 656ce8f
\AMSSYM{\hbar} & \AMSSYM{\hslash} & \AMSSYM{\Bbbk} \\
如何解决?
应当鼓励在写变换字体的数学符号时使用表达语义的命令,而不是直接使用控制格式的命令,比如向量 x 应该写 \Vector{x}
或者定义新的命令 \vx
,而不是直接写 \mathbf{x}
或者 \symbf{x}
。
略去已经过时的 \boldmath
和 \boldsymbol
命令。
增加 unicode-math
宏包的 \symbf
命令的说明。
本小节所有符号依赖 amssymb 宏包。
经测试,\lvert
和 \rvert
不需要 amssymb
宏包,只需要 amsmath
宏包,MWE:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\lvert\rvert$
\end{document}
对应源码
lshort-zh-cn/src/chap/sec.symbol.table.tex
Line 369 in a7e1010
lshort-zh-cn/src/chap/sec.symbol.table.tex
Lines 199 to 214 in a7e1010
在 1.2 节中,文中写道
假设将源代码 1.1 保存成 helloworld.txt
这里建议保存为 helloworld.tex 更好一些。
如题,能否给个安装教程谢谢
第一是不太明白为什么CTAN上和github上的lshort长得不太一样。。。。
第二是两者都用下划线而非斜体表示强调,但在文字解释部分又都说\emph命令使用斜体表强调
第一章1.6 文件的组织方式中给出的例子应当修改修改为去掉.tex
后缀。望采纳、更新,感谢!
下面是该问题的详细说明
在lshort-zh-cn
的第一章的1.6 文件的组织方式有提到\include
命令的用法:
LATEX 提供了命令 \include 用来在源代码里插入文件:
\include{⟨filename⟩}
⟨filename⟩ 为文件名,如果和要编译的主文件不在一个目录中,则要加上相对或绝对路径,例如:
\include{chapters/a.tex} % 相对路径
\include{/home/Bob/file.tex} % Linux/macOS 绝对路径
\include{D:/file.tex} % Windows 绝对路径,用正斜线
而事实上,通过如下尝试:
在一个空文件夹下面建立两个文件,分别是:
%filea.tex
\documentclass{article}
\begin{document}
This is a \LaTeX \ file.
\include{fileb.tex}
%\include{fileb}
\end{document}
%fileb.tex
This is another \LaTeX \ file.
执行命令pdflatex filea.tex
,输出的只有filea.tex
文件的内容。
将filea.tex
修改为:
%filea.tex
\documentclass{article}
\begin{document}
This is a \LaTeX \ file.
%\include{fileb.tex}
\include{fileb}
\end{document}
再执行命令pdflatex filea.tex
,就得到了同时包含filea.tex
和fileb.tex
文件内容的输出结果。
可以发现,在使用相对路径时,不应当使用\include{chapters/a.tex}
这种形式的命令,而应当改为 \include{chapters/a}
这种形式,否则编译不出a.tex
文件中的内容。
同时,在查阅了lshort
原文后,注意到,在Chapter 1的1.8 Big Projects中是这么介绍的:
When working on big documents, you might want to split the input file into several parts. LATEX has two commands that help you to do that.
\include{filename}
Use this command in the document body to insert the contents of another file named filename.tex. Note that LATEX will start a new page before processing the material input from filename.tex.
可以看出,虽然原文没有给出使用示例,但是确实是指的是使用\include{chapters/a}
这种形式的命令。
出于对上述错误的思考,我又尝试了另外一种,就是使用绝对路径,但结果令人惊讶,无论我是否带后缀,\include
命令都无法编译出来;而使用\input
命令,无论我是否带后缀,都能编译出理想的效果。
中文版本6.01
页眉41页。“LATEX提供了\pmod和\bmod命令,前者相当于一个二元运算符,后者作为同余表达式的后缀”。个人认为“前者”“后者”写反了。
技术书籍代码排版的宏包
把 license 放在正文里面略有多余,而且英文版也没有这一部分。
事实上,Microsoft Word 2003 及以前默认是上下边距 1.25 英寸,左右边距 1 英寸,这里写反了;
Microsoft Word 2003 及以后默认是边距一致为 1.25 英寸。
目前的介绍
lshort-zh-cn/src/chap/chap.03.elements.tex
Lines 507 to 516 in 94979dc
完整的用法应为
\begin{tabular}[⟨align⟩]{⟨column-spec⟩}
⟨item1⟩ & ⟨item2⟩ & … \\
\hline
⟨item1⟩ & ⟨item2⟩ & … \\
\end{tabular}
建议
\oarg{align}
参考垂直盒子
lshort-zh-cn/src/chap/chap.03.elements.tex
Lines 911 to 917 in 94979dc
如题。
提出这个建议有三个原因:
一、被很多国内高校的学位论文样式要求搞烦了,国内很多高校虽然在学位论文样式要求中提到了这个国标,但给出的示例往往和国标不一致。不如在表6.1中给出来排版效果,也方便日后说明。
二、6.1.6 节有对 gb7714-2015 的介绍。
三、经常被询问中文的参考文献该如何用bibtex。
在 2.3.6(12页)特殊西文符号与重音一节
英文原版为
H\^otel, na\"\i ve, \'el\`eve,\\
sm\o rrebr\o d, !`Se\~norita!,\\
Sch\"onbrunner Schlo\ss{}
Stra\ss e
而中文是
H\^otel, na\"\i ve, \’el\‘eve,\\
sm\o rrebr\o d, !‘Se\ norita!,\\
Sch\"onbrunner Schlo\ss{}
Stra\ss e
其中的 ` 和 ' 在中文显示为单引号 ‘ 和 ’ 。
查看最新版本没有改动。我用的是Linux的Document Viewer 查看pdf文件的。
我第一次发Issues,如果有错误请原谅。
原标题为 关于排版问题, 已改为 关于字体问题。
在文中增加 filecontents
环境的说明,感觉可以放 sec 3.5 特殊环境 里面,优点:
比如对
lshort-zh-cn/src/chap/chap.06.spec.tex
Lines 264 to 291 in 34a54eb
\begin{filecontents}{egbibdata.bib}
@book{caimin2006,
title = {UML 基础和 Rose 建模教程},
address = {北京},
author = {蔡敏 and 徐慧慧 and 黄柄强},
publisher = {人民邮电出版社},
year = {2006},
month = {1}
}
\end{filecontents}
\documentclass{ctexart}
% 使用符合 GB/T 7714-2015 规范的参考文献样式
\usepackage[style=gb7714-2015]{biblatex}
% 注意加 .bib 扩展名
\addbibresource{egbibdata.bib}
\begin{document}
见文献\cite{caimin2006}。
\printbibliography
\end{document}
直接复制粘贴就能编译,学习 LaTeX 的体验大大增强
可否为源代码 3.1 再添加些注释。这几天已经见到有用户直接在 tex 文件中写 \usepackage{...}
了。
另外,3.9.2 节能再添加一个 subcaption
中 subfigure
的用法吗?
截止到提交 98efd33 ,文档中使用
「反斜线」,六处
./src/chap/chap.01.basics.tex:117:\LaTeX\ 中命令\footnote{也叫作控制序列(control sequence)。}以反斜线 \texttt{\textbackslash} 开头,为以下两种形式之一:
./src/chap/chap.01.basics.tex:119: \item 反斜线和后面的一串字母,如 \cmd{LaTeX}。它们以任意非字母符号(空格、数字、标点等)为界限。
./src/chap/chap.01.basics.tex:120: \item 反斜线和后面的单个非字母符号,如 \cmd{\$}。
./src/chap/chap.01.basics.tex:128:\footnote{另外也可以在命令后面紧跟一个 \cmd{\textvisiblespace} 命令(反斜线加空格),代表插入一个间距。
./src/chap/chap.02.text.tex:155:如果想要输入以上符号,需要使用以下带反斜线的形式输入:
./src/chap/chap.02.text.tex:161:事实上这些带反斜线的形式就是 \LaTeX\ 命令。\cmd{\textasciicircum} 和 \cmd{\textasciitilde}
「反斜杠」,三处。
./src/chap/chap.08.custom.tex:26:同时还使用了一个命令:\cmd{cmd}, 这个命令负责输出命令的名字,包括前面的反斜杠。
./src/chap/chap.08.custom.tex:38:基本上,这个命令有两个参数,第一个 \Arg{name} 是你想要建立的命令的名称(带反斜杠),
./src/chap/chap.02.text.tex:163:\crcmd\ 被直接定义成了手动换行的命令,输入反斜杠就只好用 \cmd{text\-back\-slash}。
我对统一为哪一种没有偏好。
中文版本6.01
页眉44页。“在以下的例子,为了对齐加号”。个人认为“加号”应改为“等号”。
lshort-zh-cn/src/lshort-zh-cn-style.sty
Lines 168 to 170 in 327e68b
%
,导致多出一个空格,使得 TikZ 后的间距偏大。在这一行中, Can 被写成了 Cam.
查 texlive svn repo 知,texlive 没有收录 Apr 18 2019 的 lshort-zh-cn v6.01(texlive 按 lshort-chinese 收录)。请问维护者是否了解具体原因?
相关链接:http://www.tug.org/svn/texlive/trunk/Master/texmf-dist/doc/latex/lshort-chinese
'vaccum' 应该是 'vacuum'
在lshort-zh-cn中,bibtex的介绍内容有一些值得商榷。
CTAN 的人要求把 chap 一级的文件都放到 src 目录下(原文是放在 lshort-zh-cn 根目录下,没明白为啥,在交涉)。我在提交给 CTAN 的版本改动了,代码库还没动,等确定的消息吧
lshort-zh-cn/src/chap/chap.02.text.tex
Line 166 in 550a239
''
似乎会吸收前方与汉字的间距,效果不良或许可以使用
双引号 `` 和\ '' 分别
第一页中“二零二零”的“零”错误,应为“二〇二〇”。
这样可以在线搜索。本地的pdf搜索结果不好。如果是网页版则有更强的搜索功能。
在目前的版本中,《雷太赫排版系统简介》提供的网址还是旧地址。
如今这本书已经更新,更新网址 https://github.com/huangxg/lnotes。
lshort-zh-cn/src/lshort-zh-cn-style.sty
Lines 30 to 52 in 4ceb127
当前描述
lshort-zh-cn/src/chap/chap.01.basics.tex
Lines 228 to 237 in 98efd33
存在问题
\paperwidth
和 \paperheight
)影响输出区域,不影响纸张大小tlmgr paper
获取(和修改),例如
$ tlmgr paper
Current dvipdfmx paper size (from /usr/local/texlive/2019basic/texmf-config/dvipdfmx/dvipdfmx.cfg): a4
Current dvips paper size (from /usr/local/texlive/2019basic/texmf-config/dvips/config/config.ps): a4
Current pdftex paper size (from /usr/local/texlive/2019basic/texmf-config/tex/generic/config/pdftexconfig.tex): a4
Current xdvi paper size (from /usr/local/texlive/2019basic/texmf-config/xdvi/XDvi): a4
修改建议
geometry
和 typearea
等宏包目前 lshort-zh-cn 中所有表格题注均以句号结尾,是否必要?
\texttt
、\verb
、\cmd
等verbatim
、command
、sourcecode
等hologo
输出 \TeX
等标记(避免上回 MiKTeX 那种问题)\TeX\
建议改为 \TeX{}
(后跟标点符号时比较坑)~
的用法在英文中很少使用波浪号作为连接符,所以 5.1.4 节中的 “a~b” 用法是错误的,包括 \textasciitilde
和 \sim
。
https://en.wikipedia.org/wiki/Tilde
In some languages (though not generally in English)[citation needed], a tilde-like wavy dash may be used as punctuation (instead of an unspaced hyphen or en-dash) between two numbers, to indicate a range rather than subtraction or a hyphenated number (such as a part number or model number). For example, "12~15" means "12 to 15", "3" means "up to three", and "100" means "100 and greater". Japanese and other East Asian languages almost always use this convention, but it is often done for clarity in some other languages as well. Chinese uses the wavy dash and full-width em dash interchangeably for this purpose. In English, the tilde is often used to express ranges and model numbers in electronics, but rarely in formal grammar or in type-set documents, as a wavy dash preceding a number sometimes represents an approximation (see below).
在中文里波浪号可以作为连字符表示范围,但是这个符号是 U+FF5E “~”。
https://zh.wikipedia.org/wiki/连接号
@louisstuart96
https://github.com/CTeX-org/lshort-cn/blob/d7230be36d0b6936d283ca438b46506d53bd0845/src/chap/chap.04.math.tex#L725
根据《GB 3102.11-1993 物理科学和技术中使用的数学符号》标准,
使用粗斜体表示向量是正确的用法,尤其用在在印刷。
在 latex2e 中,它们总是在 \caption
之前/之后插入,与 \caption
在图表之前或之后无关。目前表述的功能,在 caption
宏包后才生效。
% article.cls, line 480:
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1: #2}%
\ifdim \wd\@tempboxa >\hsize
#1: #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
仅作记录,有空时提交。
结合自己的一些使用情况,给出以下建议,仅供参考:
B.3.1
中添加 nicematrix
和 unicode-math
。B.3.2
中的 ntheorem
换成 amsthm
。B.3.3
中的 tabu
换成 tabularray
;在 subcaption
后面将 keyfloat
列为类似宏包。此处还是建议使用 pdflatex 作为编译命令。
我目前碰到的大部分使用者均为使用期刊所提供模板进行投稿的入门级用户,这些期刊模板使用 xelatex 并不会带来额外好处,且容易增加编译时间;某些 linux 用户甚至还可能因缺失 libfontconfig 而导致 xelatex 失败(参考 刘鹏:texlive 2019安装指南)。
作为本书第一个源码,增加这样的风险很没有必要。建议在编译源码 1.2 时再将 xelatex 引出,在 1.7 节和 2.2 节再展开 xelatex 的相关内容。
应在“本章介绍的许多命令和环境依赖于amsmath 宏包。”后,显著的说明“本章例子都假设在导言中添加\usepackage{amsmath}.”
现在 BibLaTeX 的应用越来越广泛,不知道这部分内容什么时间能够添加到 lshort-zh 中?
随着 l3 的使用越来越广泛,要不要在 lshort 中补充 l3 相关的内容?
大概只需要讲 expl3 与 xparse 的基础部分?
lshort-zh-cn/src/chap/chap.03.elements.tex
Line 524 in e8e2369
在Ubuntu20.04LTS+TeXLive2020(tlmgr update至2020.05.08)环境下直接用latexmk编译时,“chap.05.style.tex”中的第300行出现未定义\uline的错误。
修改“lshort-zh-cn-style.sty”,加入“\RequirePackage{ulem}”后问题得以解决,猜测应该是ctex宏集更新后的问题。
在文中没有提到使用 draft
文档类选项时会让插入的图片只显示 filename
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.