我的 pandoc 目录在哪里?

编程入门 行业动态 更新时间:2024-10-08 07:36:47
本文介绍了我的 pandoc 目录在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试为 pandoc 添加自定义乳胶模板

I am trying to add a custom latex template for pandoc

我知道 pandoc 模板在 ~/.pandoc/templates

I know that pandoc templates go in ~/.pandoc/templates

我通过输入 pandoc --v 确认了 pandoc 目录位置 - 它说 pandoc 在 ~/.pandoc

and I confirmed the pandoc directory location by typing pandoc --v - it says pandoc is in ~/.pandoc

但是当我做 cd ~/.pandoc 时:

-bash: cd: /Users/[Name]/.pandoc: No such file or directory

根据 pandoc 手册页,我可以使用 --data-dir=DIRECTORY 为 pandoc 数据文件设置不同的路径,但是当我尝试以这种方式构建文件时,例如

According the pandoc man page I can set a different path for pandoc data files using --data-dir=DIRECTORY, but when I try build a file this way, e.g.

pandoc file.md -o file.pdf --data-dir=~/Library/texmf/tex/latex --template=mytemplate.latex

它抛出错误

pandoc: Could not find data file templates/mytemplate.latex

我认为这意味着数据目录命令被忽略.

which I assume means the data directory command is ignored.

为什么我无法访问我的 pandoc 目录?

Why can't I access my pandoc directory?

推荐答案

如果 ~/.pandoc 目录尚不存在,您确实应该创建它.例如对于默认的乳胶模板:

You are indeed expected to create the ~/.pandoc directory if it doesn't exist already. For example for a default latex template:

mkdir -p ~/.pandoc/templates pandoc -D latex > ~/.pandoc/templates/default.latex

--template 选项查找相对于当前目录(pwd)的文件,或者如果没有找到,pandoc 将在用户数据目录"(~/.pandoc/templates for --data-dir=~/.pandoc,这是默认值).

The --template option looks for files relative to the current directory (pwd), or "if not found, pandoc will search for it in the templates subdirectory of the user data directory" (~/.pandoc/templates for --data-dir=~/.pandoc, which is the default).

您的错误来自哪里,因为可能没有文件 /Library/texmf/tex/latex/templates/mytemplate.latex.

Which is where your error comes from as there's probably no file /Library/texmf/tex/latex/templates/mytemplate.latex.

更多推荐

我的 pandoc 目录在哪里?

本文发布于:2023-11-12 14:35:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581756.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:目录   pandoc

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!