Mensaje de error extraño "CARACTER DE CORRIENTE DE ARCHIVO EN BÚFER DE ENTRADA CERRADA" durante la indexación

Mensaje de error extraño "CARACTER DE CORRIENTE DE ARCHIVO EN BÚFER DE ENTRADA CERRADA" durante la indexación

Estoy usando la solución deIndexación con unidades binarias usando el paquete siunitx. Esto no sólo resolvió el problema específico que había publicado, sino que también pareció resolver muchos otros problemas. Sin embargo, parece que existe cierta dificultad si hay comillas dobles en el unexpandedparámetro, lo que da como resultado

Reading raw-index "/var/folders/70/.../T/N728p7zZMX"...
ERROR: READ: input stream #<CLOSED INPUT BUFFERED FILE-STREAM CHARACTER #P"/var/folders/70/.../T/N728p7zZMX" @3> ends within a string

donde ...hay una ruta generada aleatoriamente.

El MWE solo tiene una línea agregada a la solución en la pregunta mencionada

Código:

\documentclass{article}
\usepackage{imakeidx}
\usepackage{xparse}
\usepackage{siunitx}
\usepackage{xcolor}

%% https://tex.stackexchange.com/questions/50712/automatically-convert-quotations-in-the-form-of-abc-to-become-abc
\usepackage{csquotes}
\MakeOuterQuote{"}


\usepackage{hyperref}

\newcommand*\lettergroup[1]{\subsection{#1}}

\newcommand*{\IndexWithName}[2]{%
    % #1 = word to index
    % #2 = index name
    \index[#2]{#1}%
}

\NewDocumentCommand{\FormatIndexEntry}{mm}{%
    \textcolor{blue}{#1} #2%
}


%% Defer the binary units until AFTER \begin{document} as per
%% https://tex.stackexchange.com/questions/287579/how-to-overwrite-siunitxs-binary-prefixes
\sisetup{binary-units=true}
\AtBeginDocument{%
    \DeclareSIUnit\bit{\textcolor{red}{bit}}%
}

\NewDocumentCommand{\AddIndexEntry}{%
    O{}% #1 = index name
      m% #2 = word to index this under
      m% #3 = indexed term
      m% #4 = symbol
}{%
    \expandafter\IndexWithName\expandafter{%
        #2!#3@\FormatIndexEntry{#3}{\unexpanded{\unexpanded{#4}}}%
    }{#1}%
}
\newcommand{\indexopt}[2]{\index[#2]{#1}}

\makeindex[title={Main Index},columns=1,program=texindy]
\makeindex[title={Name Index},columns=1,program=texindy,name=Name]
\indexsetup{level=\section}

\begin{document}

\SI{1}{\bit}

\AddIndexEntry[Name]{Bytes}{Bit}{symbol: \si{\bit}}
\AddIndexEntry[Name]{Bytes}{Bit}{text using "quotes"}% <---- This is a problem.

\clearpage 
\setcounter{secnumdepth}{0}
\printindex[Name]
\end{document}

Respuesta1

El carácter "es especial en archivos de índice y debe citarse como

""

Por otro lado, "nunca debería usarse solo en un documento LaTeX, pero está bien con csquotes:

\documentclass{article}
\usepackage{imakeidx}
\usepackage{xparse}
\usepackage{siunitx}
\usepackage{xcolor}
\usepackage{csquotes}
\usepackage{hyperref}

\MakeOuterQuote{"}

\newcommand*\lettergroup[1]{\subsection{#1}}

\newcommand*{\IndexWithName}[2]{%
    % #1 = word to index
    % #2 = index name
    \index[#2]{#1}%
}

\NewDocumentCommand{\FormatIndexEntry}{mm}{%
    \textcolor{blue}{#1} #2%
}


%% Defer the binary units until AFTER \begin{document} as per
%% http://tex.stackexchange.com/questions/287579/how-to-overwrite-siunitxs-binary-prefixes
\sisetup{binary-units=true}
\AtBeginDocument{%
    \DeclareSIUnit\bit{\textcolor{red}{bit}}%
}

\NewDocumentCommand{\AddIndexEntry}{%
    O{}% #1 = index name
      m% #2 = word to index this under
      m% #3 = indexed term
      m% #4 = symbol
}{%
    \expandafter\IndexWithName\expandafter{%
        #2!#3@\FormatIndexEntry{#3}{\unexpanded{\unexpanded{#4}}}%
    }{#1}%
}
\newcommand{\indexopt}[2]{\index[#2]{#1}}

\makeindex[title={Main Index},columns=1,program=texindy]
\makeindex[title={Name Index},columns=1,program=texindy,name=Name]
\indexsetup{level=\section}

\begin{document}

\SI{1}{\bit}

\AddIndexEntry[Name]{Bytes}{Bit}{symbol: \si{\bit}}
\AddIndexEntry[Name]{Bytes}{Bitq}{text using ""quotes""}% <---- This is a problem.

\clearpage 
\setcounter{secnumdepth}{0}
\printindex[Name]
\end{document}

ingrese la descripción de la imagen aquí

información relacionada