0

is there any easy way (Iʼm not a programmist) how to build and print Czech-sorted index in document which contains more \include files? I donʼt know how to put here a minimal example. so Iʼm working with this:

\documentclass[10pt]{article}
\usepackage{geometry}
\usepackage{ebgaramond}
\usepackage{polyglossia}
\setmainlanguage{czech}

\usepackage[xindy={language=czech, codepage=utf8}, style=altlist]{glossaries}
\usepackage[xindy]{imakeidx}
\makeglossaries
\def\xindylangopt{-M lang/czech/utf8-lang}
\makeindex[title=Jmenný rejstřík,options=\xindylangopt]

\begin{document}
\include{lahodova}
%.
%.
%.
\printglossary
\printindex
\end{document}

and compiling and building index with this:

lualatex sample.tex

makeglossaries sample

lualatex -shell-escape sample.tex

without \include files everything works perfectly

here are some lines in Lahodova file:

Generační zasazení je dle Mannheima\index{Mannheim, Karl} dáno (stejně jako demografické vytyčení pojmu) především biologickými aspekty.

Literární historik Vlastimil Válek\index{Válek, Vlastimil} memoárovou literaturu označil jako literaturu.

Silvia Nürneberger\index{Nürneberger, Silvia} na příkladu holokaustu uvádí.
  • Can you please include some more specifications? Give please a sample of lines you included in the 'lahadova' file. – Paolo Polesana Nov 15 '16 at 16:06
  • I added them to my post – Ashrak Nov 15 '16 at 19:12
  • Not a solution to your exact question, but what happens if you use \input rather than include? I always \input rather than \include chapters or sections and find it fast enough. It also reduces auxiliary file clutter. – Michael Palmer Nov 15 '16 at 19:19
  • thanks for the advice, but it doesnʼt work – Ashrak Nov 15 '16 at 19:51
  • Do I understand you correctly that the error is caused by the use of \input or \include, and does not happen if the content of the included files in inlined? Do you have the latexpand script installed? If so, you can use it to inline all the included files. If you do so (latexpand main.tex > expanded.tex) and compile the expanded file, does that suppress the error? – Michael Palmer Nov 15 '16 at 20:40
2

The following example code is based on your code and includes some glossary entries and some index entries:

\documentclass[10pt]{article}
\usepackage{inputenc}
\usepackage{polyglossia}
\setmainlanguage{czech}

\usepackage[xindy={language=czech, codepage=utf8}, style=altlist]{glossaries}    

\usepackage[xindy]{imakeidx}

\loadglsentries{defns}

\makeglossaries 

\def\xindylangopt{-M lang/czech/utf8-lang}

\makeindex[title=Jmenný rejstřík,options=\xindylangopt]

\begin{document}

Here’s my \gls{ex} term.
First use: \gls{svm}. Second use: \gls{svm}. \gls{Oxf} is a fence containing \glspl{ox}. Not to be confused with a \Gls{ford} car carrying \glspl{ox}. The \gls{Oxf} fence contains\index{contain, to} also the \gls{OxfU} for \gls{el} cows.

\input{song}

Generační zasazení je dle Mannheima\index{Mannheim, Karl} dáno (stejně jako demografické vytyčení pojmu) především biologickými aspekty.

Literární historik Vlastimil Válek\index{Válek, Vlastimil} memoárovou literaturu označil jako literaturu.

Silvia Nürneberger\index{Nürneberger, Silvia} na příkladu holokaustu uvádí.

\printglossaries 

\printindex

\end{document}

where the file song.tex is

\begin{verse}
Quanto è dolce, o Salvatore\index{Gesù, Cristo Salvatore}\\
di servire a te\\
ed offrire con amore\\
questo \gls{Oxf} a te.

Prendi\index{Prendere, verbo} pure la mia vita\\
io la dono a te.\\
La tua grazia\index{Grazia, increata} mai largita\\
l'hai donata a me.

\end{verse}

and the file defns.tex contains this:

\newacronym{svm}{SVM}{support vector machine}
\newglossaryentry{ex}{name={sample},description={an example}}
\newglossaryentry{ox}{name={ox},description={a bovin}}
\newglossaryentry{ford}{name={ford},description={a car}}
\newglossaryentry{Oxf}{name={Oxford},description={a city}}
\newglossaryentry{OxfU}{name={Oxford University},description={a place where studying}}
\newglossaryentry{el}{name={élite},description={a restricted group of people}}

If you compile with these commands:

lualatex sample.tex

makeglossaries sample

texindy -M lang/czech/utf8-lang sample.idx

lualatex sample.tex

than you obtain this text:

enter image description here

followed by the glossary

enter image description here

and on another page the index

enter image description here

As you can see the entries in the included files are also present.

  • Paolo, thank you very much. your code works perfectly. I finally found out what was the problem: PATH to my files with accents letters: c:\Users\user\Disk Google\práce\sborníky\objetí 2\sazba\ – Ashrak Nov 16 '16 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.