0

since none of my issues could be solved yet ( Define special sorting for Lualatex glossaries in Japanese? ) ( Bib2Gls doesn't compile CJK characters correctly ) and I won't be able to turn in my paper with an unsorted glossary, I am quite desperate for help (or I'll have to get back to MS Office :( .. )
I would need a manual sorting (at least) for my glossary using glossaries package (as the glossaries-extra package doesn't work for me with CJK character (s. 2nd issue with compiling issues of bib2gls) with LuaLaTeX, because this combination is the only, that worked "somewhat". Since I am using CJK characters and the current list appears to be random to me, I would need to be able to manually change the order of the glossary (according to japanese order). Is there any way I can manually sort them with the glossaries package? Thank you!

I know it is annoying that similar questions are being asked repeatedly, but I need to come to some solution somehow, to be able to turn in the paper :/ I spent the last weeks trying to figure things out and as a LaTeX noob that wasn't always easy. (Although I think I found some clues, which didn't help me solve the overall issues in the other questions though). (MWE in case it is of help:)


\documentclass{scrreprt}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}
\usepackage{libertine}
\usepackage{libertinust1math}
\usepackage[match,ipaex]{luatexja-preset}
\setmainjfont{IPAexMincho}
\usepackage{luatexja-ruby}
\ltjsetparameter{jacharrange={-3}} %    punctuation is Latin
\usepackage[acronym, toc, nopostdot]{glossaries}
\glsnoexpandfields
\makeglossaries
\input{glossary}

\begin{document}
\gls{oilshock}
\gls{serienfertigung}
\gls{afghanistanintervention}
\gls{sozialistischewirtschaft}\gls{kommunistischepartei}
\printglossary
\end{document}

Glossary entries:

\newglossaryentry{oilshock}{name={\cjkname{オイルショック}},
  description={Ölpreiskrise}
  }
\newglossaryentry{serienfertigung}{name={\cjkname{\ltjruby[]{多|品|種少|生産}{た|ひんしゅ|しょう|せいさん}}},
  description={Serienfertigung}
  }
\newglossaryentry{afghanistanintervention}{name={\cjkname{アフガン\ltjruby{侵|攻}{しん|こう}}},
  description={Intervention in Afghanistan}  
  }
\newglossaryentry{kommunistischepartei}{name={\cjkname{ソ\ltjruby{連|共産|党}{れん| きょうさん|とう}}},
  description={Kommunistische Partei der Sowjetunion}
}
\newglossaryentry{sozialistischewirtschaft}{name={\cjkname{\ltjruby{社会|主義|経済}{しゃかい|しゅぎ|けいざい}}},
  description={sozialistische Wirtschaft}
  }
  • You are mixing pdflatex methods (\cjkname, cjkut8) and lualatex methods (luatexja). This can only give chaos. – Ulrike Fischer Feb 19 at 15:34
  • I know, but if I don't and do not use the sort key, the glossary will not compile correctly, unfortunately (it will create the following error: (./config.gls [1{C:/Users/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.m ap}](load cache: C:/Users/AppData/Local/MiKTeX/2.9/luatexja/extra_ipaexgo thic.luc) ! String contains an invalid utf-8 sequence. l.8 \glsgroupheading{ �}\}\relax \glsresetentrylist % ? ) – user168390 Feb 19 at 17:59
1

Assuming that you want to use lualatex, remove all the pdflatex stuff and add sort keys everywhere. Then it should compile:

\documentclass{scrreprt}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}
\usepackage{libertine}
\usepackage{libertinust1math}
\usepackage[match,ipaex]{luatexja-preset}
\setmainjfont{IPAexMincho}
\usepackage{luatexja-ruby}
\ltjsetparameter{jacharrange={-3}} %    punctuation is Latin
\usepackage[acronym, toc, nopostdot]{glossaries}
\glsnoexpandfields
\makeglossaries
\newglossaryentry{oilshock}{name={オイルショック},
  description={Ölpreiskrise},
  sort=xxx
  }
\newglossaryentry{serienfertigung}{name={\ltjruby[]{多|品|種少|生産}{た|ひんしゅ|しょう|せいさん}},
  description={Serienfertigung},sort=aaa
  }
\newglossaryentry{afghanistanintervention}{name={アフガン\ltjruby{侵|攻}{しん|こう}},
  description={Intervention in Afghanistan},sort=bbb
  }
\newglossaryentry{kommunistischepartei}{name={ソ\ltjruby{連|共産|党}{れん| きょうさん|とう}},
  description={Kommunistische Partei der Sowjetunion},sort=ccc
}
\newglossaryentry{sozialistischewirtschaft}{name={\ltjruby{社会|主義|経済}{しゃかい|しゅぎ|けいざい}},
  description={sozialistische Wirtschaft},sort=ddd
  }

\begin{document}
\gls{oilshock}
\gls{serienfertigung}
\gls{afghanistanintervention}
\gls{sozialistischewirtschaft}\gls{kommunistischepartei}
\printglossary
\end{document}

enter image description here

  • oh my god it worked! Thank you so much, really!! (Just on a side note: why using "aaa", "bbb", instead of "a" ,"b" for example? Would I be able to further narrow it down to "aaa" "aab" "aac"..."aba" ect.? – user168390 Feb 19 at 16:04

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.