Para ler o arquivo LaTeX completo usando macros LaTeX2e

Para ler o arquivo LaTeX completo usando macros LaTeX2e

Sou novo na plataforma LaTeX (aprendizado) e gostaria de ler o arquivo LaTeX completo usando macros LaTeX2e e farei algumas substituições.

Meu 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{quote}
        The AI for the expected number of XXXX to ZZZZ transitive triads is generally very narrow. Since this statistic reflects relatively high-order structures (because more ties are involved), its range of possible values given the number of edge counts or mutual.
    \end{quote}    
    
    We previously presented a evaluation with visual impairments to assess app usability and accessibility XXXX and ZZZZ.
    Study results unveiled that the app is indeed accessible and usable by people with VIB.
    After the publication remote collection of app usage data, aiming to investigate how end users interact with the system.

\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}

Obrigatório:

  1. Se LaTeXo arquivo tiver XXXXtexto, eu gostaria de obter algo LaTeX Compile Errorcomo LateX Error?.
  2. Se LaTeXo arquivo tiver ZZZZtexto, eu gostaria de alterar \texttt{ZZZZ}.
  3. Se LaTeXo arquivo estiver ------em \begin{thebibliography}...\end{thebibliography}texto, eu gostaria de obter algo LaTeX Compile Errorcomo LateX Error?.

Como fazer usando LaTeXonly e não use of XeLaTeX/LuaLaTeX?

Agradecendo antecipadamente e seu apoio.

Minha bibliografia Macro:

\makeatletter
\renewenvironment{thebibliography}[1]{%
 \bibsection
 \parindent\z@
 \bibpreamble
 \bibfont
 \list{\@biblabel{\the\c@NAT@ctr}}{\@bibsetup{#1}\global\c@NAT@ctr\z@}%
 \ifNAT@openbib
   \renewcommand\newblock{\par}%
 \else
   \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
 \fi
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.\@m
 \let\NAT@bibitem@first@sw\@firstoftwo
    \let\citeN\cite \let\shortcite\cite
    \let\citeasnoun\cite
}{%
 \bibitem@fin
 \bibpostamble
 \def\@noitemerr{%
  \PackageWarning{natbib}{Empty `thebibliography' environment}%
 }%
 \endlist
 \bibcleanup
}%
\makeatother

Responder1

Se você deseja apenas substituir tokens dentro do quoteambiente, você pode redefini-lo usando \NewEnvironmentCopyo argumento type +b, que representa o corpo do ambiente. Agora usando l3você pode substituir tokens dentro do corpo por outros, por exemplo:

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

\NewEnvironmentCopy{latexquote}{quote}
\ExplSyntaxOn
\tl_new:N \l__quotebody_tl
\RenewDocumentEnvironment { quote } { +b }
  {
    \tl_set:Nn \l__quotebody_tl { #1 }
    \tl_replace_all:Nnn \l__quotebody_tl { XXXX } { \LaTeX{}~Compile~Error }
    \tl_replace_all:Nnn \l__quotebody_tl { ZZZZ } { \textit{\texttt{ZZZZ}} }
    \latexquote
    \l__quotebody_tl
    \endlatexquote
  }
  {
  }
\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{quote}
    The AI for the expected number of XXXX to ZZZZ transitive triads is generally very narrow. Since this statistic reflects relatively high-order structures (because more ties are involved), its range of possible values given the number of edge counts or mutual.
\end{quote}    

We previously presented a evaluation with visual impairments to assess app usability and accessibility XXXX and ZZZZ.
Study results unveiled that the app is indeed accessible and usable by people with VIB.
After the publication remote collection of app usage data, aiming to investigate how end users interact with the system.

\end{document}

insira a descrição da imagem aqui

Para mais informações sobre expl3sintaxe e funções do LaTeX3 como tl_replace_all:Nnn(ou talvez até \regex_replace_all:nnN) veja a documentação doKernel LaTeX3.

No entanto, não creio que algo assim realmente faça muito sentido. Como David disse em um comentário: Se você quiser espaços reservados em seu texto, eles devem ser substituídos, faria mais sentido definir esses espaços reservados como macros e usar estas macros:

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

\newcommand*\XXXX{XXXX}
\newcommand*\ZZZZ{ZZZZ}

\AddToHook{env/quote/begin}{%
  \renewcommand*\XXXX{%
    \GenericError{}
      {LaTeX Error: \string\XXXX\space used}
      {Don't do it.}
      {Usage of \string\XXXX\space inside quote is not allowed.}%
  }%
  \renewcommand*\ZZZZ{\textit{\texttt{ZZZZ}}}%
}

\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{quote}
    The AI for the expected number of \XXXX{} to \ZZZZ{} transitive triads is generally very narrow. Since this statistic reflects relatively high-order structures (because more ties are involved), its range of possible values given the number of edge counts or mutual.
\end{quote}    

We previously presented a evaluation with visual impairments to assess app usability and accessibility \XXXX{} and \ZZZZ{}.
Study results unveiled that the app is indeed accessible and usable by people with VIB.
After the publication remote collection of app usage data, aiming to investigate how end users interact with the system.

\end{document}

informação relacionada