Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

在 Debian 中使用 Zotero 文献管理软件 #5

Open
JackieMium opened this issue Mar 8, 2018 · 0 comments
Open

在 Debian 中使用 Zotero 文献管理软件 #5

JackieMium opened this issue Mar 8, 2018 · 0 comments
Labels
Linux Linux related 软件 一些软件使用方法、体验和问题 问题 抓头
Milestone

Comments

@JackieMium
Copy link
Owner

2017-05-14 20:51:47

我在 Debian 中用 Zotero 管理文献时发现 PDF 导入后获取文件信息获取不到。以下时解决过程记录。

Install the pdftotext and pdfinfo programs:

sudo apt-get install poppler-utils

Find the kernel and architecture:

uname --kernel-name --machine

In the Zotero data directory create a symbolic link to the installed programs. The printed kernel-name and machine is part of the link's name:

cd ~/.zotero
ln -s $(which pdftotext) pdftotext-$(uname -s)-$(uname -m)
ln -s $(which pdfinfo) pdfinfo-$(uname -s)-$(uname -m)

Install a small helper script to alter pdftotext paramaters:

cd ~/.zotero
wget -O pdfinfo.sh https://raw.githubusercontent.com/zotero/zotero/4.0/resource/redirect.sh
chmod a+x pdfinfo.sh

Create some files named *.version containing the version numbers of the utilities. The version number appears in the third field of the first line on stderr:

cd ~/.zotero
pdftotext -v 2>&1 | head -1 | cut -d ' ' -f3 > pdftotext-$(uname -s)-$(uname -m).version
pdfinfo -v 2>&1 | head -1 | cut -d ' ' -f3 > pdfinfo-$(uname -s)-$(uname -m).version

Start Zotero's gear icon, "Preferences"-"Search" should report something like:

PDF indexing
  pdftotext version 0.26.5 is installed
  pdfinfo version 0.26.5 is installed

Do not press "check for update". The usual maintenance of the operating system will keep those utilities up to date.

更多

如果上述完成还不可用,运行这个脚本:

#!/bin/bash

version=$(dpkg-query -W -f='${Version}' poppler-utils || echo "please_install_poppler-utils")

totextbinary='pdftotext-Linux-x86_64'
infobinary='pdfinfo-Linux-x86_64'
infohack='pdfinfo.sh'

for zoteropath in $(find $HOME/.zotero $HOME/.mozilla -name zotero.sqlite -exec dirname {} \;)
do
	echo $version > $zoteropath/"$totextbinary.version"
	echo $version > $zoteropath/"$infobinary.version"

	ln -s /usr/bin/pdftotext "$zoteropath/$totextbinary"
	ln -s /usr/bin/pdfinfo "$zoteropath/$infobinary"

	cat > $zoteropath/$infohack << EOF

#!/bin/sh
if [ -z "\$1" ] || [ -z "\$2" ] || [ -z "\$3" ]; then
    echo "Usage: $0 cmd source output.txt"
    exit 1
fi
"\$1" "\$2" > "\$3"
EOF

	chmod +x $zoteropath/$infohack

done

脚本来自 bugs.debian.org

@JackieMium JackieMium added Linux Linux related 软件 一些软件使用方法、体验和问题 labels Mar 8, 2018
@JackieMium JackieMium added the 问题 抓头 label Mar 9, 2018
@JackieMium JackieMium added this to the Migration milestone Mar 9, 2018
@JackieMium JackieMium added this to Linux in 博文分类 Jun 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Linux Linux related 软件 一些软件使用方法、体验和问题 问题 抓头
Projects
博文分类
  
Linux
Development

No branches or pull requests

1 participant