大家好,我在使用 sharelatex 软件包中最近实现的词汇表时遇到了问题。使用词汇表标签时,它在文本中运行良好,但最后词汇表无法打印。我必须使用我大学的文件:
%
% University of Berne
%
% Bachelor thesis template
% Thomas Staub 14.04.2005
%
\documentclass[11pt,a4paper,twoside,openright]{rvsbachelor}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[a4paper,twoside]{geometry}
\sloppy
%% Additional packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% for source code highlighting
% \usepackage{listings}
% \lstloadlanguages{tcl, Perl}
% \lstset{language=tcl, commentstyle=\it, basicstyle=\tiny, keywordstyle=\bf, breaklines=true, frame=single}
% multiple figures with same general caption
\usepackage{subfigure}
\setcounter{lofdepth}{2}
% offers more possibilities in captions
\usepackage{caption}
% Commands for package caption
% - caption
\renewcommand{\captionfont}{\small}
\renewcommand{\captionlabelfont}{\bfseries}
% offers rotation of figures, ...
\usepackage{rotating}
% to support correct hyphenaten, add words with -
% \hyphenation{test-case}
% If a page has no content, make it an empty page (without page numbers ....)
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\thispagestyle{empty}
\newpage
\fi\fi}
\makeatother
% check whether we are running pdflatex
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse % we are not running pdflatex
\DeclareGraphicsExtensions{.eps}
\else
\pdfoutput=1 % we are running pdflatex
\pdfcompresslevel=9 % compression level for text and image;
\pdftrue
\DeclareGraphicsExtensions{.pdf}
\fi
\ifpdf
%to make table of contents and index appear in bookmarks
\usepackage{tocbibind}
%refs also as links
\usepackage[pdftex,plainpages=false]{hyperref}
%plainpages=false: enable links although page numbering is reset after title
%backref, pagebackref]{hyperref}
%\usepackage[pdftex]{color}
%\usepackage[pdftex]{thumbpdf}
\else
%url must be escaped. (this works fine in dvi)
\usepackage{url}
\fi
\usepackage[nomain, acronym, toc]{glossaries}
\author{Adrian Kurt}
\title{title of the thesis}
\date{2014}
\makeglossaries
\input{acronyms}
% document start
\begin{document}
\maketitle
\thispagestyle{empty}
\mbox{}
\newpage
\pagenumbering{roman}
\tableofcontents{}
\listoffigures{}
\listoftables{}
\cleardoublepage
\setcounter{page}{1} % Reset page numbering to 1
\pagenumbering{arabic} % Arabic page numbers
% Advice: split up your thesis in multiple files, i.e. one file for one section
\input{intro}
\input{theory}
\input{practical}
\input{discussion}
\input{th_bibliography}
\printglossary[title=List of Terms,toctitle=Terms and abbreviations]
\printglossary[title=some title, type=\acronymtype]
% no output here of the glossary
\end{document}
知道可能是什么问题吗?
答案1
感谢 ShareLatex 的好心人帮助我解决了这个问题。显然你不应该将文件放在文件夹中,也不要使用nomain
打包选项。这是没有必要的。
答案2
我在这里添加了针对此问题的最新解决方法(2017 年 6 月 2 日),该解决方法首先在 ShareLatex Github 中讨论https://github.com/sharelatex/sharelatex/issues/171最后https://github.com/sharelatex/sharelatex-docker-image/issues/6。
1)在项目根文件夹中添加一个.latexmkrc 文件2)放置代码:
add_cus_dep('glo', 'gls', 0, 'makeglo2gls'); sub makeglo2gls {
system("makeindex -s '$_[0]'.ist -t '$_[0]'.glg -o '$_[0]'.gls '$_[0]'.glo"); }
add_cus_dep('acn', 'acr', 0, 'makeacn2acr'); sub makeacn2acr {
system("makeindex -s \"$_[0].ist\" -t \"$_[0].alg\" -o \"$_[0].acr\" \"$_[0].acn\""); }
3)编译两次(我使用了 LaTex 编译器)
这似乎解决了我的问题!