루프 내부의 목록 요소에 액세스하는 가장 간단한 방법

루프 내부의 목록 요소에 액세스하는 가장 간단한 방법

루프 내부의 목록 요소에 액세스하고 싶습니다. 다음은 최소한의 예입니다.

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{pgffor}

\begin{document}

\def\numbers{1, 2, 3, 4}
\def\MaFFNs{0.19230259, 0.18361065, 0.18027213, 0.17801571}
\def\MaNFNs{0.49030635, 0.49140458, 0.49246621, 0.49363557}

\begin{frame}
  \frametitle{TITLE}
  Text above
  \begin{columns}[onlytextwidth]
  \foreach \number [count=\n] in \numbers
  {
    \begin{column}{0.25\textwidth}
      \centering

      Ma $\approx$ \MaFFNs{\number}

      \begin{figure}
        \centering
        \includegraphics[width=\textwidth]{../figures/porous-FFN-\number}
      \end{figure}

      Ma $\approx$ \MaNFNs{\number}

      \begin{figure}
        \centering
        \includegraphics[width=\linewidth]{../figures/porous-NFN-\number}
      \end{figure}
    \end{column}
  }
  \end{columns}
  Text below
\end{frame}

\end{document}

위의 코드는 그림에는 작동하지만 목록의 요소에는 작동하지 않습니다. 사용 가능한 솔루션https://tex.stackexchange.com/a/21566나에게는 효과가 없습니다(알겠습니다 ! Missing = inserted for \ifnum.). 실제로 언급된 솔루션에서는 목록의 요소가 루프 내에서 액세스되지 않습니다.

내가 원하는 것을 달성하는 가장 좋은(가장 간단한) 방법을 찾는 데 도움을 줄 수 있는 사람이 있습니까?

정말 감사합니다,

편집: 아래 David Carlisle이 지적한 것처럼 솔루션은 간단합니다. \numbersfor \ids\numberfor 을(를 ) 교체하면 \id다음 솔루션이 제공됩니다.https://tex.stackexchange.com/a/21566공장.

답변1

지역 변수로 사용하지 마십시오 \number. 이는 tex 원시이므로 이상한 낮은 수준의 오류가 발생합니다.

관련 정보