Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add a Glossary? #27

Open
erikbgithub opened this issue Jan 31, 2014 · 3 comments
Open

How to add a Glossary? #27

erikbgithub opened this issue Jan 31, 2014 · 3 comments

Comments

@erikbgithub
Copy link
Contributor

Hi Jeff,

I'd like to add a glossary in the way you would do it. Here's what I did so far:

As in most of my sphinx projects I have a glossary.rst file. But the only way to add it, is via the toc.txt file. The problem is that by this way it becomes a chapter, but it should belong to the preamble sections like acknowledgements.

I got sphinxtr to already build a glossary.inc, but it doesn't get included in the final document. Trying to overwrite all appearances of dedication (which I don't need anyway in a Master thesis) with s/dedication/glossary/g in the ._tex files resulted in it not being able to build a pdf. Not sure how to continue with that goal. Any hints?

@erikbgithub
Copy link
Contributor Author

I might have found a solution, although it feels more like a quick&dirty hack (deadline is in 10 days, therefore quick&dirty is probably all I can do for now):

I changed the \makefrontmatter in the puthesis.cls:

\newcommand*{\makefrontmatter}{
\frontmatter\maketitlepage\makecopyrightpage\makeabstract
\makeacknowledgements\makededication\maketoc
\makelot\clearpage\makelof\clearpage\makelos\clearpage
%% here comes the new stuff
\phantomsection
\addcontentsline{toc}{section}{Glossary}
%% delete: \mainmatter
}

my glossary.rst file now looks like this:

.. _chap-glossary:

.. raw: latex

    \section*{Glossary}

.. glossary::

    a term
        and its definition

.. raw: latex

    \clearpage\mainmatter

Other hacks I tried resulted in the terms not being referenced correctly by the :term: directive. What do you think about that?

@jterrace
Copy link
Owner

jterrace commented Feb 4, 2014

I'd have to look in more detail and unfortunately don't have much time right now, sorry :(

@erikbgithub
Copy link
Contributor Author

Don't worry. I have a workaround for now and my deadline is next week. So implementing a general purpose solution right now is impossible for me as well. We'll look more into it when we both have more time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants