![texdoc 未找到任何包的结果](https://linux22.com/image/299883/texdoc%20%E6%9C%AA%E6%89%BE%E5%88%B0%E4%BB%BB%E4%BD%95%E5%8C%85%E7%9A%84%E7%BB%93%E6%9E%9C.png)
无论我在调用时使用什么包名texdoc
,我都不会得到任何结果。这似乎表明设置中缺少某些内容。我确保安装了几个文档包。以下是一份记录,使其更加具体:
$ sudo yum install texlive-commath-doc
<yum noise snipped>
Running Transaction
Installing : 2:texlive-commath-doc-svn15878.0.3-20.fc18.noarch 1/1
Verifying : 2:texlive-commath-doc-svn15878.0.3-20.fc18.noarch 1/1
Installed:
texlive-commath-doc.noarch 2:svn15878.0.3-20.fc18
Complete!
$ texdoc commath
/usr/share/texlive/texmf-local/lsR19748.tmp/ls-R: Permission denied
/usr/share/texlive/texmf-local/lsR19748.tmp/ls-r: Permission denied
/usr/share/texlive/texmf-local/lsR19748.tmp/ls-R: Permission denied
/usr/share/texlive/texmf-local/lsR19748.tmp/ls-r: Permission denied
/usr/share/texlive/texmf-local/lsR19748.tmp/aliases: Permission denied
Sorry, no documentation found for commath.
If you are unsure about the name, try searching CTAN's TeX catalogue at
http://ctan.org/search.html#byDescription.
我需要指定/安装什么才能使其工作? 还有其他选择吗?
顺便说一句,我对适用于 Emacs 的解决方案更感兴趣(手册页或信息页就很棒)。
答案1
我终于找到了原因,或者至少我可以修复它,按照这个线索:http://www.forums.fedoraforum.org/showthread.php?t=301163
我发现 search.tlu 的代码不会创建数据库,因此texdoc
根本无法搜索。以下是我修改后的相关代码:
-- populate the doc_roots filename databases
function init_texdocs_database()
doc_roots = {}
local sep = (os.type == 'windows') and ';' or ':'
local kpse_texdocs = kpse.expand_var("$TEXDOCS")
-- expand the path and turn it into a lua list
local raw_doc_roots = string.explode(kpse.expand_braces(kpse_texdocs), sep)
local max = #raw_doc_roots + 1
for j, dir in ipairs(raw_doc_roots) do
local i = max - j
local n
local path, db
-- get path, !! and // values
dir, n = string.gsub(dir, '//$', '')
local recursion_allowed = (n == 1)
local path, n = string.gsub (dir, '^!!', '')
local index_mandatory = (n == 1)
deb_print('texdocs', string.format(
'texdocs[%d] = %s (index_mandatory=%s, recursion_allowed=%s)',
i, path, tostring(index_mandatory), tostring(recursion_allowed)))
-- decide if we should use a ls-R index, the filesystem, or do nothing
local root, shift = lsr_root(path)
if root and shift and recursion_allowed then
deb_print('texdocs', string.format(
'texdocs[%d] using index: %s (shift=%s)', i, root, shift))
db = init_lsr_db(root, shift)
elseif not index_mandatory and lfs.isdir(path) then
deb_print('texdocs', string.format(
'texdocs[%d] using filesystem search', i))
-- db = init_tree_db(path, recursion_allowed)
-- Above was the original code, but it could never work because
-- if you can't recurse on subdirectories of the documentation
-- directory, there's no way you can find any files at all.
-- I've no idea why this was the way it was.
db = init_tree_db(path, true)
end
-- register this in docroots
doc_roots[i] = { path = path, db = db }
end
end