GithubHelp home page GithubHelp logo

lshort-zh-cn's People

Contributors

alphaztx avatar atxy-blip avatar hushidong avatar jjgod avatar liam0205 avatar louisstuart96 avatar muzimuzhi avatar osbertwang avatar sainonamkho avatar stone-zeng avatar syvshc avatar yunhao94 avatar zepinglee avatar

Stargazers

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

Watchers

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

lshort-zh-cn's Issues

tabular 环境未介绍 align 可选参数

目前的介绍

排版表格最基本的 \env{tabular} 环境用法为:
\begin{command}
\cmd{begin}\marg*{tabular}\marg{column-spec}\\
\Arg{item1} \texttt\& \Arg{item2} \texttt\& \ldots\ \crcmd \\
\cmd{hline} \\
\Arg{item1} \texttt\& \Arg{item2} \texttt\& \ldots\ \crcmd \\
\cmd{end}\marg*{tabular}
\end{command}
其中 \Arg{column-spec} 是列格式标记,在接下来的内容将仔细介绍;\texttt\& 用来分隔单元格;
\crcmd\ 用来换行;\cmd{hline} 用来在行与行之间绘制横线。

完整的用法应为

\begin{tabular}[⟨align⟩]{⟨column-spec⟩}
⟨item1⟩ & ⟨item2⟩ & … \\
\hline
⟨item1⟩ & ⟨item2⟩ & … \\
\end{tabular}

建议

  • 在 tabular 环境的完整语法中增加 \oarg{align}
  • 补充相应的文字描述

参考垂直盒子

如果需要排版一个文字可以换行的盒子,\LaTeX\ 提供了两种方式:
\begin{command}
\cmd{parbox}\oarg{align}\oarg{height}\oarg{inner-align}\marg{width}\marg*{\ldots} \\[0.5ex]
\cmd{begin}\marg*{minipage}\oarg{align}\oarg{height}\oarg{inner-align}\marg{width} \\
\ldots \\
\cmd{end}\marg*{minipage}
\end{command}

image

[表 8.3] \[above|below]captionskip 的功能表述错误

在 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}

仅作记录,有空时提交。

1.2 节编译源代码 1.1 为什么建议使用 xelatex 作为默认编译方式

此处还是建议使用 pdflatex 作为编译命令。
我目前碰到的大部分使用者均为使用期刊所提供模板进行投稿的入门级用户,这些期刊模板使用 xelatex 并不会带来额外好处,且容易增加编译时间;某些 linux 用户甚至还可能因缺失 libfontconfig 而导致 xelatex 失败(参考 刘鹏:texlive 2019安装指南)。
作为本书第一个源码,增加这样的风险很没有必要。建议在编译源码 1.2 时再将 xelatex 引出,在 1.7 节和 2.2 节再展开 xelatex 的相关内容。

关于西文字体的疑问

\setmainfont{cmun}[
Extension = .otf,
UprightFont = *rm,
ItalicFont = *ti,
SlantedFont = *sl,
BoldFont = *bx,
BoldItalicFont = *bi,
BoldSlantedFont = *bl,
]
\setsansfont{cmun}[
Extension = .otf,
UprightFont = *ss,
ItalicFont = *si,
BoldFont = *sx,
BoldItalicFont = *so,
]
\setmonofont{cmun}[
Extension = .otf,
UprightFont = *btl,% light version
ItalicFont = *bto,% light version
BoldFont = *tb,
BoldItalicFont = *tx,
]

为什么都用同一种字体?这个字体有什么优点/是出于什么目的这么做的吗?单纯好奇

建议更新附录B.3中部分介绍

结合自己的一些使用情况,给出以下建议,仅供参考:

  • B.3.1 中添加 nicematrixunicode-math
  • B.3.2 中的 ntheorem 换成 amsthm
  • B.3.3 中的 tabu 换成 tabularray;在 subcaption 后面将 keyfloat 列为类似宏包。

代码库结构调整

CTAN 的人要求把 chap 一级的文件都放到 src 目录下(原文是放在 lshort-zh-cn 根目录下,没明白为啥,在交涉)。我在提交给 CTAN 的版本改动了,代码库还没动,等确定的消息吧

标准文档类纸型选项的描述有误

当前描述

可选参数 \Arg{options} 为文档类指定选项,以全局地规定一些排版的参数,如字号、纸张大小、单双面等等。
比如调用 \cls{article} 文档类排版文章,指定纸张为 A4 大小,基本字号为 11pt,双面排版:
\begin{verbatim}
\documentclass[11pt,twoside,a4paper]{article}
\end{verbatim}
\LaTeX\ 的三个标准文档类可指定的选项包括:
\begin{description}
\item[\texttt{10pt, 11pt, 12pt}] \quad 指定文档的基本字号。默认为 \texttt{10pt}。
\item[\texttt{a4paper, letterpaper, \ldots}] \quad 指定纸张大小,默认为美式信纸 \texttt{letterpaper} ($8.5\times11$英寸)。

存在问题

  • 标准文档类的纸型选项(a4paper,b5paper,letterpaper,还包括 landscape),只(通过修改 \paperwidth\paperheight)影响输出区域,不影响纸张大小
  • 默认纸张大小,在 texlive 2019 中已经为 a4paper,不再是 letterpaper。从这篇文章的截图看,texlive 2014 时默认纸张大小就是 a4paper 了。(下图来源:李阿玲,《TeX Live 2019安装指南》,知乎专栏)
    image
  • 引擎默认纸张大小可通过 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

修改建议

  • 说明只修改输出区域,不修改修改纸张大小(默认为 a4paper)
  • 对修改纸张大小的需求,建议用户使用 geometrytypearea 等宏包

关于字体问题

在 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,如果有错误请原谅。
原标题为 关于排版问题, 已改为 关于字体问题。

关于“文件的组织方式”一节的错误例子的修改建议

问题修改建议

第一章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.texfileb.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命令,无论我是否带后缀,都能编译出理想的效果。

参考链接

  1. 我本来遇到的问题是这个:https://wenda.latexstudio.net/q-5285.html
  2. lshort原文对应章节文档:https://github.com/oetiker/lshort/blob/master/book/src/things.tex

应该更早说明命令 `\mathbb` 的来源

在 4.2 节的结尾有例
image
4.3.6 节也有两次提到 \mathbb
image
均未提及这个命令的来源,
而在 4.7 节才提到某些字体命令需要宏包的支持
image
行文顺序可能有一些问题.

41页“前者”“后者”写反了

中文版本6.01
页眉41页。“LATEX提供了\pmod和\bmod命令,前者相当于一个二元运算符,后者作为同余表达式的后缀”。个人认为“前者”“后者”写反了。

5.1.4 字体编码一节关于连接符的叙述有误

在英文中很少使用波浪号作为连接符,所以 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/连接号

编译中的\uline错误

在Ubuntu20.04LTS+TeXLive2020(tlmgr update至2020.05.08)环境下直接用latexmk编译时,“chap.05.style.tex”中的第300行出现未定义\uline的错误。

修改“lshort-zh-cn-style.sty”,加入“\RequirePackage{ulem}”后问题得以解决,猜测应该是ctex宏集更新后的问题。

添加 l3 相关内容

随着 l3 的使用越来越广泛,要不要在 lshort 中补充 l3 相关的内容?

大概只需要讲 expl3 与 xparse 的基础部分?

\emph使用问题

第一是不太明白为什么CTAN上和github上的lshort长得不太一样。。。。
第二是两者都用下划线而非斜体表示强调,但在文字解释部分又都说\emph命令使用斜体表强调

1.2 节有一个小错误

在 1.2 节中,文中写道

假设将源代码 1.1 保存成 helloworld.txt

这里建议保存为 helloworld.tex 更好一些。

名词「反斜线」与「反斜杠」混用

截止到提交 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}。

我对统一为哪一种没有偏好。

sec4.9.2 AMS符号,`\lvert` 和 `\rvert` 归属错了

本小节所有符号依赖 amssymb 宏包。

经测试,\lvert\rvert 不需要 amssymb 宏包,只需要 amsmath 宏包,MWE:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\lvert\rvert$
\end{document}

对应源码

\AMSSYM{\lvert} &\AMSSYM{\rvert} &\AMSSYM{\lVert} &\AMSSYM{\rVert}\\

应放到
\begin{table}[htp]
\centering
\caption{定界符。}\label{tbl:math-delims}
\begin{symbols}{*3{cl}}
\hline
\SYM{(} & \SYM{)} & \SYM{\uparrow} \\
\SYM{[} or \cmd{lbrack} & \SYM{]} or \cmd{rbrack} & \SYM{\downarrow} \\
\SYM{\{} or \cmd{lbrace} & \SYM{\}} or \cmd{rbrace} & \SYM{\updownarrow} \\
\SYM{\langle} & \SYM{\rangle} & \SYM{\Uparrow} \\
\SYM{|} or \cmd{vert} & \SYM{\|} or \cmd{Vert} & \SYM{\Downarrow} \\
\SYM{/} & \SYM{\backslash} & \SYM{\Updownarrow} \\
\SYM{\lfloor} & \SYM{\rfloor} & \\
\SYM{\rceil} & \SYM{\lceil} & & \\
\hline
\end{symbols}
\end{table}

关于lshort-zh-cn中bibtex的内容

在lshort-zh-cn中,bibtex的介绍内容有一些值得商榷。

  1. plain模式下的例子可以稍作更改。目前的例子更像abbrv模式。
  2. 使用natbib包时,应该改为plainnat模式才能进入author-year,否则还是以前的样子。这点在natbib的说明文档中有写。

第四章 排版数学公式

应在“本章介绍的许多命令和环境依赖于amsmath 宏包。”后,显著的说明“本章例子都假设在导言中添加\usepackage{amsmath}.”

建议在表6.1中添加 gbt7714 的排版效果

如题。
提出这个建议有三个原因:
一、被很多国内高校的学位论文样式要求搞烦了,国内很多高校虽然在学位论文样式要求中提到了这个国标,但给出的示例往往和国标不一致。不如在表6.1中给出来排版效果,也方便日后说明。
二、6.1.6 节有对 gb7714-2015 的介绍。
三、经常被询问中文的参考文献该如何用bibtex。

不知能不能再加点内容

可否为源代码 3.1 再添加些注释。这几天已经见到有用户直接在 tex 文件中写 \usepackage{...} 了。
另外,3.9.2 节能再添加一个 subcaptionsubfigure 的用法吗?

分割号“/”不应出现在一行之首

代码对应

\texttt{xelatex} 和 \texttt{lualatex} 编译命令配合 \cls{ctex} 宏包 / 文档类的方式成为当前的主流中文排版支持方式。

编译结果
1
个人建议解决措施

\texttt{xelatex} 和 \texttt{lualatex} 编译命令配合 \cls{ctex} 宏包~/ 文档类的方式成为当前的主流中文排版支持方式。

编译结果
2

4.7.3 节加粗的数学符号的改进建议

  1. 应当鼓励在写变换字体的数学符号时使用表达语义的命令,而不是直接使用控制格式的命令,比如向量 x 应该写 \Vector{x} 或者定义新的命令 \vx,而不是直接写 \mathbf{x} 或者 \symbf{x}

  2. 略去已经过时的 \boldmath\boldsymbol 命令。

  3. 增加 unicode-math 宏包的 \symbf 命令的说明。

统一代码风格

  • 代码抄录环境,什么时候用哪个最好统一一下:
    • 行内:\texttt\verb\cmd
    • 行间:verbatimcommandsourcecode
  • 使用 hologo 输出 \TeX 等标记(避免上回 MiKTeX 那种问题)
  • \TeX\ 建议改为 \TeX{}(后跟标点符号时比较坑)
  • 统一 ~ 的用法
  • 合理断行、缩进

最新版 lshort-zh-cn 无法在最新版 TeXLive2019 编译通过

检查

  • 已在 issues 中进行搜索(包括已关闭的问题)

编译环境

  • 操作系统

    • Windows 7/8/10
    • macOS
    • Linux
  • TeX 发行版

    • TeX Live2019
    • MiKTeX
    • CTeX

描述问题

指定清华源 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)

不是 MWE,偷懒了 https://github.com/CTeX-org/lshort-zh-cn

(用 XeLaTeX 编译后)输出

Undefined control sequence.
<recently read> \Bbbk 

找到对应的位置

\AMSSYM{\hbar} & \AMSSYM{\hslash} & \AMSSYM{\Bbbk} \\

 \AMSSYM{\hbar}             & \AMSSYM{\hslash}           & \AMSSYM{\Bbbk}            \\

如何解决?

链接

改进建议

第一页中“二零二零”的“零”错误,应为“二〇二〇”。

添加 filecontents 环境及相关示例进行改写

在文中增加 filecontents 环境的说明,感觉可以放 sec 3.5 特殊环境 里面,优点:

  • 输入方便,不必再手动创建文件
  • 方便让提问者提供 MWE

比如对

\begin{sourcecode}[htp]
\begin{Verbatim}
% File: egbibdata.bib
@book{caimin2006,
title = {UML基础和Rose建模教程},
address = {北京},
author = {蔡敏 and 徐慧慧 and 黄柄强},
publisher = {人民邮电出版社},
year = {2006},
month = {1}
}
% File: demo.tex
\documentclass{ctexart}
% 使用符合 GB/T 7714-2015 规范的参考文献样式
\usepackage[style=gb7714-2015]{biblatex}
% 注意加 .bib 扩展名
\addbibresource{egbibdata.bib}
\begin{document}
见文献\cite{caimin2006}。
\printbibliography
\end{document}
\end{Verbatim}
\caption{应用 \pkg{biblatex} 的示例 egbibdata.bib 和 demo.tex。}
\end{sourcecode}

这部分改写,改为

\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 的体验大大增强

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.