使用 ShareLaTeX 添加词汇表

使用 ShareLaTeX 添加词汇表

我正在尝试在 ShareLaTeX 中为一篇文章添加词汇表,但如果在编译时不使用,整个\makeglossaries命令似乎不起作用makeglossaries document_name(正如它所说 这里)。

有什么办法可以强制编译器执行该操作(我的意思是 shareLaTeX 在线编译器)?

编辑:

6 天前,我收到了 ShareLaTeX 团队的一封简讯,他们在其中解释了他们在编译器中所做的最新添加的功能;其中包括使用词汇表包的可能性,而无需 shell 调用,makeglossaries所以我尝试了一下:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{glossaries}
\title{EjGlos}
\newglossaryentry{bitcoin}
{
  name=Bitcoin,
  description={(\btc)  is a peer-to-peer payment system and digital currency introduced as open source software in 2009 by pseudonymous developer Satoshi Nakamoto. It is a cryptocurrency, so-called because it uses cryptography to control the creation and transfer of money}
}
\makeglossaries
\begin{document}
\maketitle
\section{How does Bitcoin work?}
From a user perspective, \gls{bitcoin} is nothing more than a mobile app or computer program that provides a personal Bitcoin wallet and allows a user to send and receive bitcoins with them. This is how Bitcoin works for most users.
\printglossaries
\end{document}

而且它似乎运行正常:

分享LaTeX_glossaries

答案1

分享LaTeX 维基说:

ShareLaTeX 目前不支持词汇表,但计划在不久的将来进行改变。

在此更改发生之前,您无法使用外部索引应用程序在 ShareLaTeX 中生成词汇表。但是,您可以使用 TeX 执行排序和整理,而无需调用外部索引应用程序。这可以使用 来完成datagidx。示例:

\documentclass{article}

\usepackage{datagidx}

\newgidx{glossary}{Glossary}
\DTLgidxSetDefaultDB{glossary}

\newterm[description={a collection of objects}]{set}
\newterm[description={number of objects in a set}]{cardinality}

\begin{document}

% page 1:
\gls{set}.

\newpage
% page 2:
\gls{set}, \gls{cardinality}.

\newpage
% page 3:
\gls{set}.

\newpage
% page 4:
\gls{cardinality}.

\printterms[columns=1,style=align]

\end{document}

词汇表显示为:

生成的词汇表的图像

由于排序和整理由 TeX 执行,因此不必担心 shell 转义,因此可以在 ShareLaTeX 上的文档中使用。

进一步阅读:

编辑:

您现在还可以使用 TeX 包执行排序和整理glossaries

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{glossaries}

\makenoidxglossaries

\title{EjGlos}
\newglossaryentry{bitcoin}
{
  name=Bitcoin,
  description={a peer-to-peer payment system and digital
currency introduced as open source software in 2009 by pseudonymous
developer Satoshi Nakamoto. It is a cryptocurrency, so-called
because it uses cryptography to control the creation and transfer of
money}
}

\begin{document}
\maketitle
\section{How does Bitcoin work?}
From a user perspective, \gls{bitcoin} is nothing more than a mobile
app or computer program that provides a personal Bitcoin wallet and
allows a user to send and receive bitcoins with them. This is how
Bitcoin works for most users.

\printnoidxglossaries
\end{document}

这至少需要 4.04 版glossaries。(这是在引言部分词汇表用户指南。)

相关内容