使用 dtx 和 ins 文件对模板进行重构,减少重复代码的维护。
备注:尽量与 ElegantBook 4.1 同步发布,最终采用单文件 dtx。
xelatex elegantlatex.dtx
source code of ElegantLaTeX templates(reconstruction)
Elegant LaTeX Template for Books
License: LaTeX Project Public License v1.3c
使用 dtx 和 ins 文件对模板进行重构,减少重复代码的维护。
备注:尽量与 ElegantBook 4.1 同步发布,最终采用单文件 dtx。
xelatex elegantlatex.dtx
source code of ElegantLaTeX templates(reconstruction)
建议代码块增加类似图片那样的章节序号,可以方便查找
根据 #49 (comment) 和 #49 (comment) ,目前章节标题悬挂缩进的距离是固定的 2.45em
。
Lines 366 to 373 in ae0d420
在 section label 的宽度较大时,输出样式会不一致(见下图 “Before” 部分),建议修改。
假设仍燃使用悬挂风格,有多种方案,
\sectionLabelWidth
)可设置。方案比较
以下例子展示了当前实现和第三种方案的效果,同时也简化了 \titleformat
的使用。
\documentclass{elegantbook}
\usepackage{lipsum}
\linespread{1}\selectfont
\newcommand\test[1]{
\refstepcounter{chapter}
\noindent{\LARGE\bfseries #1}
\section{title}
\setcounter{section}{10}
\section{title}
\setcounter{chapter}{10}
\section{long long long long long long long long long long long long long long long long long title}
\lipsum[23]
\vspace{20pt}
}
\begin{document}
%% current setting
%\titleformat{\section}[hang]
% {\bfseries}
% {\hspace{-2.45em}\Large\bfseries{\color{structurecolor}\thesection}\enspace}
% {1pt}
% {\color{structurecolor}\Large\bfseries\filright}
\test{Before}
%% suggested setting
\titleformat{\section}[hang]
{\Large\bfseries\color{structurecolor}}
{\llap{\thesection\enspace}}
{0pt}
{}
\setcounter{chapter}{1}
\test{After}
\end{document}
如果觉得需要该,并且能确定修改方案,我可以提供实现。
2019/7/29下载的最新模板
MWE如下
`\documentclass[lang=cn,11pt]{elegantbook}
\usepackage{siunitx}
\title{Title}
\subtitle{Subtitle is here}
\author{Your Name}
\institute{XXX University}
\date{\today}
\version{1.00}
\extrainfo{Victory won\rq t come to us unless we go to it. --- M. Moore}
\logo{logo.png}
\cover{cover.jpg}
\begin{document}
\maketitle
\mainmatter
\hypersetup{pageanchor=true}
\chapter{Example Chapter Title}
\si{\angstrom}
\end{document}`
PDF正文部分一片空白,已尝试在ctexart标准文档类使用\angstrom命令,正常。
bm
宏包会额外声明 4 个数学字体,这容易让「最多 16 个数学字体」的限额变得紧张。
根据文档 texdoc bm
, sec. 2,通过使用
\newcommand\bmmax{0}
\RequirePackage{bm}
可以让 bm
宏包不额外声明数学字体,代价是
为每一章提供章节环境,并且内层嵌套列表环境 enumerate。
一本书每个章节大概要引用20左右个文献,都在最后一起引用太乱了。
在Overleaf中编辑,默认编译器是 pdfLatex 报了一对错。希望可以在README说明 使用 xeLatex编译器
最小例子
\documentclass[cn,11pt,cyan]{elegantbook}
\begin{document}
\begin{definition}
测试
\end{definition}
\end{document}
\documentclass[cn,11pt,cyan]{elegantbook}
\begin{document}
\begin{definition}{ }{}
测试
\end{definition}
\end{document}
修改 elegantbook.cls
中的 \newenvironment{definition}[2]
为
\newenvironment{definition}[2]
{\ifstrempty{#1}{}{\edefinition[#1]}\ifstrempty{#2}{}{\label{def:#2}}}
{\endedefinition}
仍需要使用 \begin{definition}{}{}
才能达到效果。期望能直接使用 \begin{definition}
达到期望的效果。
I have a few problems about margin.
The section title exceeds the content border, as indicated by the arrows in the figure below.
In twoside mode, the left and right margins for odd and even page are inverse. As shown below, the right margin is wider for odd page, and the left margin is wider for even page, which should be opposite.
If I manually set page margin, the header text doesn't align with header line, and the margin size is not what I specified. For example
\geometry{top=1cm,bottom=1cm,inner=2.5cm,outer=1.5cm,includeall}
it shows
You can click the pictures to clearly identify the margin. I use MikTex on windows 10. The elegantbook version is 3.08.
今天在用户群,讨论到定理的问题,现有的定理形式是:
\begin{theorem}{theorem name}{label}
The content of theorem.
\end{theorem}
其中用到的是 tcolorbox
宏包的 newtcbtheorem
命令,对于这个定理的引用,使用 \ref{thm:label}
。而为了兼容 mode=simple
和 mode=fancy
,在 simple
模式下,实际调用的为 amsthm
,即通过 newtheorem
命令定义。
在 ElegantBook 中,如果定理名没有或者不需要引用时,需要写成
\begin{theorem}{}{}
The content of theorem.
\end{theorem}
amsthm
定理用法一般通过 amsthm
定义的定理使用方法是
\begin{theorem}[theorem name]\label{thm:label}
The content of theorem.
\end{theorem}
这种可选项作为定理名的方式有一个好处是,如果定理没有名字,也不需要引用,可以写成
\begin{theorem}
The content of theorem.
\end{theorem}
也就是在偷懒或者信息缺失的时候,这样写看着更加自然。
其实这个问题我原来也考虑过,不是考虑写起来麻烦还是不麻烦,而是兼容性问题,也就是把 ElegantBook 中的定理搬到其他模板/文类中不可以直接使用,需要修改之后才可以。我有计划改动,但由于这个定理的设置会影响到大部分人,而且是大幅度的,因此希望大家能够积极表达自己的观点。
放弃 newtcbtheorem
默认定理命令,改用一般环境定义命令 tcolorboxenvironment
,结合 amsthm
定义定理类环境。
注:关于 amsthm
和 ntheorem
的讨论,请参考:Theorem packages: which to use, which conflict?
未来方向:
考虑到书籍在装订时方便,对于单双页来讲,左侧和右侧的页边距一般是不同的。简单来讲,单页装订侧在左,双页装订侧在右,因此单页左侧页边距=双页右侧页边距>单页右侧页边距=双页左侧页边距。为了方便装订,希望作者能将此问题列入考虑,单双页设置不同的页边距。
url中的下划线会被当作下标处理,尽管链接指向仍然正确。
MWE(已删除)
https://www.overleaf.com/read/hpmhfxvcmjys
代码片段
\url{https://www.youtube.com/channel/UCllYBm-_FbqWuI92o6zPXfw}
已经确定这不是hyperref的问题,在其他模板中使用hyperref并复制elegantbook中的参数不会报错也不会异常显示下标
\documentclass[cn,11pt,twoside]{elegantbook}
\usepackage{zhlipsum}
\titleclass{\section}{top}
\newcommand\sectionbreak{\clearpage}
\begin{document}
\chapter{Elegant\LaTeX{} 系列模板介绍}
\section{第一章}
\zhlipsum[1-10]
\section{第二章}
\zhlipsum[1]
\end{document}
具体表现为第五页的页眉显示为第二章而不是第一章
kpathsea: Running mktextfm SimSun/OT
/usr/local/texlive/2017/texmf-dist/web2c/mktexnam: Could not map source abbreviation O for OT. /usr/local/texlive/2017/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2017/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input OT
This is METAFONT, Version 2.7182818 (TeX Live 2017) (preloaded base=mf)
kpathsea: Running mktexmf OT
! I can't find file `OT'. <> \mode:=ljfour; mag:=1; nonstopmode; input OT Please type another input file name ! Emergency stop. <> \mode:=ljfour; mag:=1; nonstopmode; input OT Transcript written on mfput.log.
grep: OT.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input OT' failed to make OT.tfm. kpathsea: Appending font creation commands to missfont.log. kpathsea: Running mktextfm SimSun/OT
/usr/local/texlive/2017/texmf-dist/web2c/mktexnam: Could not map source abbreviation O for OT. /usr/local/texlive/2017/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2017/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input OT
This is METAFONT, Version 2.7182818 (TeX Live 2017) (preloaded base=mf)
kpathsea: Running mktexmf OT
! I can't find file `OT'. <> \mode:=ljfour; mag:=1; nonstopmode; input OT Please type another input file name ! Emergency stop. <> \mode:=ljfour; mag:=1; nonstopmode; input OT Transcript written on mfput.log.
grep: OT.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input OT' failed to make OT.tfm.
kpathsea: Running mktextfm KaiTi/OT
/usr/local/texlive/2017/texmf-dist/web2c/mktexnam: Could not map source abbreviation O for OT. /usr/local/texlive/2017/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2017/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input OT
This is METAFONT, Version 2.7182818 (TeX Live 2017) (preloaded base=mf)
kpathsea: Running mktexmf OT
! I can't find file `OT'. <> \mode:=ljfour; mag:=1; nonstopmode; input OT Please type another input file name ! Emergency stop. <> \mode:=ljfour; mag:=1; nonstopmode; input OT Transcript written on mfput.log.
grep: OT.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input OT' failed to make OT.tfm. kpathsea: Running mktextfm KaiTi/B/OT
/usr/local/texlive/2017/texmf-dist/web2c/mktexnam: Could not map source abbreviation O for OT. /usr/local/texlive/2017/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2017/texmf-dist/fonts/map/fontname/special.map?
Error: Command crashed: xelatex -synctex=1 -interaction=nonstopmode "elegantbook-en".tex
Process exited with error(s)
When I compile my book project, I get the following error (several times): "Font U/esint/m/n/10=esint10 at 10.0pt not loadable: Metric (TFM) file not found. \maketitle". I saw in the class file that a package named mtpro2 is requested, which does not exist on CTAN. I don't know this has to do with the issue....
Anyway, I don't know from where the error comes. Everything worked fine until Version 3.08.
I'm using up to date MiKTeX 2.9 under Windows 10.
\nocite{EINAV2010,Havrylchyk2018} 是不给出引用的意思吗?为什么还是给出来了?而有的没显示引用?
作者名不能加* 吗?
首先预设的数学字体确实符合网上流传的漂亮字体的建议。然而字体对于LaTeX 用户来说通常会造成麻烦。比如 mtpro2 和 esint。前者是付费字体,大多数用户没有,即使是mtpro2 lite的版本,可能很多用户也不熟悉。esint 由于宏包升级删去了 esint10.tfm,给使用最新版宏包的用户造成了很多麻烦。尤其是没有完全安装TeXLive 或者 MikTeX的用户。要想运行成功新的elegentbook 模板,要花很多功夫补这些字体。
所以从用户的角度,最好是给出一些推荐字体,说明这些字体的来源。让用户自己选择字体组合。
网上推荐的一些免费的字体组合,如 \usepackage{charter}
和 \usepackage[charter]{mathdesign}
, 以及 \usepackage{libertine}
和 \usepackage[libertine]{newtxmath}
都是不错的组合。并且这些字体都是免费的,且已经包含在 TeX 系统里面。
有用户希望插入比率符号,如图所示:
所谓「比号」是 U+2236 Ratio ∶
,注意与冒号 U+003A Colon :
和全角冒号 U+FF1A Fullwidth colon :
区分。
ElegantBook 模板所使用的西文字体并不包含这一符号,而中文字体一般是包含的。但 xeCJK
宏包默认把这一符号使用西文字体输出,因此需要做一些修改:
% 导言区
\xeCJKDeclareCharClass{FullRight}{"2236}
\newcommand\ratio[2]{#1^^^^2236#2}
第一行把 U+2236 这一符号设为 FullRight
字符类,使用中文字体输出,禁则处理类似冒号(右标点);第二行定义一个命令用来方便输出,其中的 ^^^^2236
相当于直接在代码中输入 ∶
。
使用时可采用 \ratio{1}{5000}
的语法。效果如下:
其实忽略这个错误并不影响pdf的生成,只是每次都出现,比较烦人。。。
是否可以在cls文件里增加一个条件判断?
if (lang == "xx")
\deinecolor{<base color>}{<color model>}{<spec list>}
fi
\colorlet{<color in use>}{<base color>}
\fancyhead{\color{<color in use>}...}
<base color> ::= "main" | "second" | ...
<color in use> ::= "header and footer" | "section title" | ...
开 issue 以记录工作任务。
This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(/home/shao/Documents/MyOneDrive/OneDrive - hrbeu.edu.cn/projects/doc_latex/ElegantBook-master/elegantbook-cn.tex
LaTeX2e <2017-04-15>
Babel <3.18> and hyphenation patterns for 3 language(s) loaded.
(./elegantbook.cls
Document Class: elegantbook 2019/02/24 v3.06 ElegantBook document class
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)))) (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/share/texlive/texmf-dist/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/bk12.clo)) (/usr/share/texlive/texmf-dist/tex/latex/tools/indentfirst.sty) (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty) (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex) (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def)) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xeCJK.sty (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty) (/usr/share/texlive/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty) (/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty (/usr/share/texlive/texmf-dist/tex/xelatex/xunicode/xunicode.sty (/usr/share/texmf/tex/latex/tipa/t3enc.def) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def))))) (/usr/share/texlive/texmf-dist/tex/xelatex/xunicode/xunicode.sty
*** Reloading Xunicode for encoding 'TU' ***
) (/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def) (/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))
! LaTeX Error: File `newtxmath.sty' not found.
Type X to quit or to proceed,
or enter new name. (Default extension: sty)
Enter file name:
./elegantbook.cls:66: Emergency stop.
<read *>
l.66 ^^I\setCJKfamilyfont
{zhsong}{SimSun}^^M
No pages of output.
Transcript written on elegantbook-cn.log.
查看了Tex Live的目录,里面有newtxmath.sty文件,请问如何修改?
另:注释掉\RequirePackage{newtxmath}后编译还是出错,提示“! LaTeX Error: File firamono.sty' not found.” 再注释掉,会提示“! LaTeX Error: File
texnames.sty' not found.”
再注释掉就可以编译了。
\displaystyle \int 可以使上下标分别在上下位置。但在这个模板中起不到这个效果,请问怎样才能达到这个效果?
Tex文档和目录溢出截图如下:
MWEofelegantbook.zip
欢迎大家提供颜色主题,基本原则:色调和谐,风格一致,适合屏幕阅读!
本 issue 长期有效。
建议章节标题与目录建立超链接,方便阅读。
我参考https://tex.stackexchange.com/questions/32495/linking-the-section-text-to-the-toc,实现了章节标题与目录建立的超链接。代码如下:
\let\oldcontentsline\contentsline%
\renewcommand\contentsline[4]{%
\hypertarget{toc#4}{}%
\oldcontentsline{#1}{#2}{#3}{#4}}
\RequirePackage[explicit]{titlesec}
\renewcommand{\chaptername}{\thechapter .}
\titleformat{\chapter}[\style]{\bfseries}
{\filcenter\LARGE\enspace\bfseries{\color{structurecolor}\chaptername}\enspace}{1pt}
{\bfseries\color{structurecolor}\LARGE\filcenter \protect\hyperlink{tocchapter.\thechapter}{#1}}%[\filcenter\base]
\titleformat{\section}[hang]{\bfseries}
{\Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}
{\color{structurecolor}\Large\bfseries\filright \protect\hyperlink{tocsection.\thesection}{#1}}
\titleformat{\subsection}[hang]{\bfseries}
{\large\bfseries\color{structurecolor}\thesubsection\enspace}{1pt}
{\color{structurecolor}\large\bfseries\filright \protect\hyperlink{tocsubsection.\thesubsection}{#1}}
参考这里,有空做一下 cleveref 支持。
这么好看的模板缺少一个好看的封底,作者可以增加一个封底吗,有封底的书才是完美的书是吧???
MWE如下
\documentclass[lang=cn]{elegantbook} \usepackage{yhmath} \begin{document} 1 \end{document}
在标准文档类下是可以编译的,报错显示Symbol font 'yhlargesymbols' is not defined.
I've been using elegantbook for more than a month and finished nearly two chapters. I recently reinstalled MikTex, installed elegantbook package and others , reinstalled TexMaker, refreshed file names, setting etc, and the Chinese fonts. But nothing worked. The elegantbook-cn.tex and all my previous files, which worked fine, failed to generate pdf. Evey time it generated : fatal error occurred. I've been trying all kinds possibilities for two days, and still have no clue. My files in English works fine. I tested a Chinese file using XeLatex, it worked fine as well. (I was using TeXmaker, pdflatex.)
Could anyone point out other possible problems so that I can move on? Thanks a great deal!
在文档的第 2.3 节,中英文版本使用的示例颜色不一致
Position A | Position B | |
---|---|---|
cn | main | structure |
en | main | main |
ElegantBook/elegantbook-cn.tex
Lines 75 to 92 in 92c4509
ElegantBook/elegantbook-en.tex
Lines 75 to 93 in 92c4509
main 颜色
cyan
和 green
主题 main 的差异小,blue
主题的 main 是绿色的structure 颜色
gray
主题的 structure 颜色是纯黑目前,建议都改用 structure。长期来看,可能需要调整配色。确认如何修改后,我可以提供 pull request。
当前,模板提供两种数学字体配置,math = newtx | mtpro2
,默认为前者。
当 math=newtx
时,会加载 newtxmath
包
newtxmath
会把很多符号定义为较 computer modern 稍粗的版本,
for those who do not like the integral in
txfonts
, an emboldened version of the Computer Modern integral is made available, matching the weight of thetxfonts
symbols
ref:texdoc newtx
, sec. 1
为了撤销这个修改,模板重新分配了四个常用数学命令(\int, \oint, \sum, \prod
)使用的字体
Lines 98 to 113 in b3d038f
在上述第 3 步中,存在一些风险
\iint
等\makeatletter
\ams@renewcommand{\iint}{\DOTSI\protect\MultiIntegral{2}}
\ams@renewcommand{\iiint}{\DOTSI\protect\MultiIntegral{3}}
\ams@renewcommand{\iiiint}{\DOTSI\protect\MultiIntegral{4}}
\renewcommand{\idotsint}{\DOTSI\protect\MultiIntegral{0}}
\def\intkern@{\mkern-6mu\mathchoice{\mkern-8mu}{\mkern-4mu}{}{}}
\makeatother
因为 newtxmath
使用的字体中,提供了一些 computer modern 没有提供的数学符号,所以仍然存在一些命令(如 \oiint
等),一定无法重定义为 computer modern 风格。
如果用户需要同时使用重定义过的 \int
和无法重定义的 \oiint
,那么总是会遇到符号风格不一致的问题。
可能的解决方案:
esint
宏包stix
或 xits
字体对应的宏包以上是与 pdflatex 兼容的方案。如果仅考虑 xelatex,可以考虑 unicode-math
配合 latin modern math
(仍然不包括四五个 newtx
包括的、不常用的积分符号), stix
或 xits
。
如何更改字体,目前文档里面是mtpro2,却不懂如何更改,请指导
The chapter heading seems to follow the section. When I got to the end
of the chapter, say, 第1章 习题,the heading remained to be the last
section, which didn't match the content of the page. (see the
attached.) I'd appreciate it greatly if there would be a command to
switch off the heading or simply to the chapter title.
heading.pdf
如果\subtitle
为空会在\maketitle
出现There is no line here to end
,原因是\maketitle
在elegantbook.cls
第700行直接使用的\the\subtitle\\
建议参考文献采用Biber编译,可以十分容易地实现分章节参考文献。
实现代码如下:
% 参考文献设置
\RequirePackage[backend=biber,style=gb7714-2015,refsection=chapter,
gbnamefmt=givenahead,texencoding=utf8,bibencoding=utf8]{biblatex}
\defbibheading{subbibliography}[\refname]{\section*{参考文献}}
\renewcommand{\bibauthorfont}{\bfseries}
\renewcommand{\bibpubfont}{\itshape}
\setlength{\bibhang}{-1em}
在需要参考文献的地方,用一下命令输出参考文献:
\printbibliography[heading=subbibliography]
I want to print my book so I use this: \documentclass[a4paper,twoside,fancy,blue,11pt]{elegantbook}
Unfortunatelly the margins are reversed. I guess they are for right-to-left books like Chinese but for left-to-right one they are incorrect. I propose to change the geometry for lang=en
option and keep it like it is for lang=cn
. I tried to correct it using geometry
package but an error occured.
I also propose that when twoside
option is used, blank pages are inserted after title page and after unpaired table-of-content page.
How can I fix this quickly?
ElegantBook
, ElegantNote
, ElegantPaper
都存在此问题
(d:/texlive/2018/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex)
! LaTeX3 Error: Control sequence \not= already defined.
For immediate help type H <return>.
...
l.3950 \NewNegationCommand { = } { \neq }
?
ElegantNote是有护眼模式的,但是ElegantBook好像没有了
建议增加目录双栏排版,使得标题较短的目录更紧凑
实现代码如下:
%%目录双栏排版
\makeatletter
\renewcommand{\tableofcontents}{%
\setlength{\columnsep}{2em}
%\setlength{\columnseprule}{.8pt}
\begin{multicols}{2}[\chapter*{\contentsname}]%
\@starttoc{toc}%
\end{multicols}}
\makeatother
我创建了一个 bookdown 项目 --- ElegantBookdown 实现在 R Markdown 环境下写书,LaTeX 主体模版 ElegantBook 不动,基于 Pandoc 定制了一些 block 实现 LaTeX 模版中的功能,后续会继续补充 LaTeX 书籍模版中的各种定理类、注释类。目前,项目的效果见网址 https://bookdown.org/xiangyun/ElegantBookdown/ PDF 格式可通过左上角下载按钮下载
首先非常感谢您们的付出,最近我在整理一些研究笔记,采用的是这个模板,但在使用过程中若用\bibliographystyle{plain}无法设置,导致系统出错。我查看了您们的代码,里面没有这个设置。若能加入这个格式选择,我们作为用户使用起来会有更多的选择。目前正文和参考文献中的显示也不符合国人习惯,最好加上序号,正文中引用也用序号。再次感谢!
Could you provide support for US letter paper size? This size is 216 x 279 mm, which is different from A4 (210 x 297 mm).
编译环境Ubuntu19.04+TeXLive2019,2019年10月10日,使用sudo tlmgr update --all进行了更新。
无论是使用TXLive2019发行版中的“elegantbook.cls”还是使用Github中的“elegantbook.cls”当使用\documentclass[cn, 11pt]{elegantbook}
引入宏包,编译无法通过,出现Command `\lvert' already defined等错误(应该是newtxmath与其它宏包冲突引起的)。
测试代码:
\documentclass[cn, 11pt]{elegantbook}
\begin{document}
欢迎来到\LaTeX 世界!
\end{document}
但不使用cn参数时,工作正常,如:
\documentclass[11pt]{elegantbook}
\usepackage{ctex}%为了使用中文,若纯英文,也正常
\begin{document}
欢迎来到\LaTeX 世界!
\end{document}
附件是出错后的log文件。
test.log
请教如何解决:
出现的error如下:
newtxmath.sty
786LaTeX Error: Command `\lvert' already defined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
l.786 ...thopen} {symbols}{106}{largesymbols}{12}
报错信息
! Package tikz Error: Sorry, some package has redefined the meaning of the math
-mode dollar sign. This is incompatible with tikz and its calc library and migh
t cause unrecoverable errors.
See the tikz package documentation for explanation.
Type H <return> for immediate help.
...
l.58 \end{Highlighting}
\documentclass[cn]{elegantbook}
\usepackage{fancyvrb}
\begin{document}
\vspace*{21cm}
\begin{verbatim}
a
b
c
d
e
f
g
h
i
\end{verbatim}
\end{document}
Ref: annProg/PanBook#27
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.