Closed Lightmann closed 4 years ago
检查一下 bash
的版本 bash --version
$ bash --version
GNU bash,版本 4.4.23(1)-release (x86_64-pc-msys)
Copyright (C) 2016 Free Software Foundation, Inc.
许可证 GPLv3+: GNU GPL 许可证第三版或者更新版本 <http://gnu.org/licenses/gpl.html>
本软件是自由软件,您可以自由地更改和重新发布。
在法律许可的情况下特此明示,本软件不提供任何担保。
ref: https://stackoverflow.com/questions/6047648/bash-4-associative-arrays-error-declare-a-invalid-option
是不是版本太老了?
$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.
是的,需要 4.x 以上版本,可以试试升级 bash
更新 bash 版本之后的情况:
$ bash --version
GNU bash, version 5.0.17(1)-release (x86_64-apple-darwin19.4.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ panbook book
[NOTE] Welcome to PanBook!
cp: illegal option -- u
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
Unknown option --metadata-file.
Try pandoc --help for more information.
sed: 1: "s#(\includegraphics\{.* ...": RE error: invalid repetition count(s)
sed: 1: "s#(\includegraphics\{)h ...": RE error: invalid repetition count(s)
Latexmk: This is Latexmk, John Collins, 17 Jan. 2018, version: 4.55.
------------
Latexmk: Could not find file [/Users/lightmann/Desktop/temp/PanBook/build/PanBook-book-ctexbook-pc.tex].
-- Use the -f option to force complete processing.
[ERRO] book Compile status is not 0. Please Check. you may add -d or --trace to see more output
$ pandoc -v
pandoc 2.2.3.2
Compiled with pandoc-types 1.17.5.1, texmath 0.11.0.1, skylighting 0.7.2
Default user data directory: /Users/lightmann/.pandoc
Copyright (C) 2006-2018 John MacFarlane
Web: http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
cp
命令参考此文: https://stackoverflow.com/questions/27514652/cp-illegal-option-b-on-mac
pandoc
需要 2.9
以上版本
谢谢。mac 真是太坑了,现在能编译了,只是出来的 pdf 样式比较单一,没有 https://panbook.annhe.net/pub/PanBook-book-elegantbook-pc.pdf
好看
$ panbook book
[NOTE] Welcome to PanBook!
[NOTE] use -V device:(pc|mobile|kindle) to produce different size of pdf
[NOTE] use -V cover:(1-60|R|N|filepath) select cover background.R=random,N=no cover,filepath=custom cover file
[NOTE] use -V pagestyle:style to set pagestyle
Plot Warning: dot not installed!
Plot Warning: ditaa not installed!
Plot Warning: goseq not installed!
Plot Warning: a2s not installed!
Plot Warning: gnuplot not installed!
Plot Warning: gnuplot not installed!
Plot Cache Hit: _plot_render/f2ff41d8e88b195b77692897e8edb7ff89816fd4_asy.pdf
Plot Warning: abcm2ps not installed!
Plot Cache Hit: _plot_render/8420f3fa3ba1cc3ad6fa4e3c7d7aab86b90a2eef_tikz.pdf
Plot Warning: gnuplot not installed!
Plot Warning: gnuplot not installed!
Plot Warning: ditaa not installed!
WARNING: pandoc-crossref was compiled with pandoc 2.9.2 but is being run through 2.9.2.1. This is not supported. Strange things may (and likely will) happen silently.
sed: 1: "s#(\includegraphics\{.* ...": RE error: invalid repetition count(s)
sed: 1: "s#(\includegraphics\{)h ...": RE error: invalid repetition count(s)
Latexmk: This is Latexmk, John Collins, 17 Jan. 2018, version: 4.55.
Latexmk: applying rule 'xelatex'...
Rule 'xelatex': File changes, etc:
...
...
[NOTE] book Compile SUCCESSFUL
book 默认的模板是 ctex
,你发的那个链接是 elegantbook
模板,需要加参数编译:
panbook book --style=elegantbook
是用的 elegantbook
,代码块显示不太好:
pandoc 有代码高亮风格,默认的是无背景的。演示文档加了 --highlight-style=tango
参数,你可以看看 Makefile
里的定义,或者直接用 make elegantbook
来生成和演示pdf效果一样的文档。
原来如此,太感谢了
我将 PanBook 下载在了
/Users/lightmann/Desktop/temp
文件夹下面,然后添加了环境变量export PATH=$PATH:/Users/lightmann/Desktop/temp/PanBook
但执行panbook book
时出现下面的错误: