GeneralError for Glossaries in Subfile

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
merelda
Posts: 4
Joined: Sat Apr 14, 2012 7:36 pm

Error for Glossaries in Subfile

Post by merelda »

I'm using the Glossaries package to generate acronyms and glossaries.

I defined the acronyms in a separate file as acronyms.tex.

My file structure is as follows (ch2.tex is one folder in of main.tex):

Main Folder
- Ch.2 Folder
-- ch2.tex
- main.tex

I have a main file main.tex and a subfile ch2.tex:

in main.tex:

Code: Select all

\usepackage[acronym]{glossaries}
\usepackage{subfiles}
\makeglossaries
\loadglsentries[acronyms]{acronyms.tex}
in ch2.tex:

Code: Select all

\documentclass[../main.tex]{subfiles} 
However, I can build the main.tex and get the correct list of glosseries, but when I only build ch2.tex I get the following error:

../main.tex:20: LaTeX Error: File `acronyms.tex' not found. [\loadglsentries[acronyms]{acronyms.tex}]


But it was clearly found when I build main.tex?

I tried to add

Code: Select all

\loadglsentries[acronyms]{../acronyms.tex}
in ch2.tex, but no luck.

By the way, if I don't put the glossaries in an extra file but do all the definition in main.tex then it compiles fine for ch2.tex. So I figured it's probably some relative path issues, but I tried all the combinations I could think of but still no luck.

Any ideas?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply