0

I hope it's okay to start a new question, as there are similar ones, but not this exact one (afaik).

It all started with this guide, which is exactly what I need for my paper :) Glossaries with CJK characters and which I tried to restructure to use it with LuaLaTeX instead of the original pdfLaTeX: Define special sorting for Lualatex glossaries in Japanese?

Now, I am facing a way more basic issue, which I would like to tackle first, before trying to build that "dual glossary beast" (in a positive way :D), since it didn't work for me and I was trying to get to the problem's roots.

I tried using the most simple MWE of the first link using glossaries-extra (compiling as pdflatex).

\documentclass{article}

\usepackage{CJKutf8}
\usepackage[record,style=indexgroup]{glossaries-extra}

\newrobustcmd{\cjkname}[1]{\begin{CJK}{UTF8}{min}#1\end{CJK}}
\glsnoexpandfields

\newcommand{\bibglslettergrouptitle}[4]{\unexpanded{\cjkname{#1}}}

\GlsXtrLoadResources[
  src=testcjk,% bib file
  sort={ja-JP}% locale
]

\begin{document}

\begin{CJK}{UTF8}{min}ルート\end{CJK}

\gls{squareroot}

\printunsrtglossaries
\end{document}

with the bib file

@dualentry{squareroot,
  name={\cjkname{ルート}},
  description={square root}
}

The problem is now, when I run Bib2Gls, it creates a glstex file with wrong characters. Instead of

ルート

it compiles (this is just a section of the whole glstex file, which includes the wrong character)

\bibglssetlettergrouptitle{{繝}{繝}{350879744}{}}
\bibglssetlettergrouptitle{{S}{s}{6422528}{}}

\bibglssetlastgrouptitle{\bibglslettergroup}{{繝}{繝}{350879744}{}}
\providecommand*{\bibglsflattenedhomograph}[2]{#1}
\providecommand{\bibglsnewdualentry}[4]{%
 \longnewglossaryentry*{#1}{name={#3},#2}{#4}%
}

\bibglsnewdualentry{dual.squareroot}%
{descriptionplural={\cjkname{繝ォ繝シ繝�}s},
plural={square roots},
sort={square|root|},
group={\bibglslettergroup{S}{s}{6422528}{}}}%
{square root}%
{\cjkname{繝ォ繝シ繝�}}


\bibglsnewdualentry{squareroot}%
{descriptionplural={square roots},
plural={\cjkname{繝ォ繝シ繝�}s},
location={\glsnoidxdisplayloc{}{page}{glsnumberformat}{1}},
sort={繝|ォ|繝|シ|繝|},
group={\bibglslettergroup{繝}{繝}{350879744}{}}}%
{\cjkname{繝ォ繝シ繝�}}%
{square root}

Thus, if I then recompile pdflatex, it gives me result

I realise, the question relates to the questions asked in the links above, however, this one is more precise in the problem I am facing and the other ones could not really solve my problem.

Thank you and sorry!

Your Answer

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

Browse other questions tagged or ask your own question.