LaTeX만을 사용하여 콘텐츠 특정 환경 읽기

LaTeX만을 사용하여 콘텐츠 특정 환경 읽기

\begin{thebibliography}....\end{thebibliography}LaTeX2e 또는 LaTeX3 매크로를 사용하여 예제(6dashes)와 같은 환경 텍스트 에서 텍스트를 찾고 싶습니다. 컴파일할 때 ------표시됩니다 .LaTeX GeneriorError

LaTeX filename.tex

내 MWE는 다음과 같습니다.

\documentclass{article}
        \usepackage{amsmath}
        \usepackage{ragged2e}
        
        \begin{document}
        \title{Book Title}
        \author{Author Name}
        \maketitle
        
    To address these issues, \textit{WordMelodies} a mobile application to support children in the acquisition of basic literacy skills.
    The app was designed to be inclusive for children with and without VIB, thus promoting interaction between them.
    \textit{WordMelodies} also supports children in exercising basic touchscreen interactions on mobile devices.
    
\begin{thebibliography}{}

\bibitem{bib1}
Author N., ``Revisiting the Foundations of Network Analysis,'' {\em Science}, {325},~414--416.

\bibitem{bib2}
``Diagnosing Multicollinearity ------ Random Graph Models,'' {\em Research}, {50},~491--530.

\end{thebibliography}
\end{document}

나는 확인했다LaTeX2e 매크로를 사용하여 전체 LaTeX 파일을 읽으려면\thebibliography환경 에서 일하지 않습니다 .

이것을 달성하는 방법은 무엇입니까?

답변1

귀하가 실제 오류를 생성하려는지(귀하의 질문을 이해하려는 불확실한 시도에 따라) 또는 조판 출력에 비슷한 것을 포함할지 여부 LaTeX GenericError(귀하가 수락한 링크된 답변에서 알 수 있듯이)가 확실하지 않습니다. 후자에 대한 코드가 이미 있으므로 수정했습니다.카보하의 대답전자를 제공합니다.

\documentclass{article}
\usepackage{amsmath}
\usepackage{ragged2e}

% ateb: https://tex.stackexchange.com/a/705721/ addaswyd o ateb cabohah: https://tex.stackexchange.com/a/705318/
\NewEnvironmentCopy{thebibliographyorig}{thebibliography}
\ExplSyntaxOn
\tl_new:N \l__kavi_bibbody_tl
\RenewDocumentEnvironment { thebibliography } { +b }
{
  \tl_set:Nn \l__kavi_bibbody_tl { #1 }
  \tl_replace_all:Nnn \l__kavi_bibbody_tl { ------ } { \PackageError{kavi}{ LaTeX ~ GenericError }{Don't ~ use ~ six ~ hyphens ~ in ~ a ~ row! } }
  \expandafter
  \thebibliographyorig
  \l__kavi_bibbody_tl
  \endthebibliographyorig
}{}
\ExplSyntaxOff

\begin{document}
\title{Book Title}
\author{Author Name}
\maketitle

To address these issues, \textit{WordMelodies} a mobile application to support children in the acquisition of basic literacy skills.
The app was designed to be inclusive for children with and without VIB, thus promoting interaction between them.
\textit{WordMelodies} also supports children in exercising basic touchscreen interactions on mobile devices.
    
\begin{thebibliography}{}

\bibitem{bib1}
Author N., ``Revisiting the Foundations of Network Analysis,'' {\em Science}, {325},~414--416.

\bibitem{bib2}
``Diagnosing Multicollinearity ------ Random Graph Models,'' {\em Research}, {50},~491--530.

\end{thebibliography}
\end{document}

관련 정보