Cómo obtener un número de página junto a una palabra automáticamente

Cómo obtener un número de página junto a una palabra automáticamente

Tengo un archivo de palabras. He utilizado el medio ambiente longtable. Me gustaría agregar números de página de algunas otras palabras a algunas palabras.

No sé cómo hacerlo automáticamente, porque puedo cambiar el formato de página o agregar algunas palabras nuevas y luego cambiaré la posición de las palabras y cambiaré los números de página. La siguiente tabla es a eso a lo que me refiero.

+--------+---------------+-----------------------------------------------+
| word_a | pronunciation | meaning, (the page number of the word word_g) |
| ...    | ...           | ...                                           |
| page 8                                                                 |
+--------+---------------+-----------------------------------------------+  
| ...    | ...           | ...                                           |
| page 9                                                                 |
+--------+---------------+-----------------------------------------------+
| word_g | pronunciation | meaning, (the page number of the word word_a),|
|        |               | (the page number of the word word_g)          |
| ...    | ...           | ...                                           |   
| page 10                                                                |
+--------+---------------+-----------------------------------------------+
| ...    | ...           | ...                                           | 
+--------+---------------+-----------------------------------------------+

MWE

\documentclass[10pt,a5paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[main=slovak,english]{babel}
\usepackage[a5paper, top=15mm, left=10mm, right=10mm, bottom=10mm,foot=5mm,marginparsep=0mm]{geometry}
\usepackage{longtable}
\usepackage{tipa}
\usepackage{ wasysym}
\usepackage{ amssymb }

%skratky
%---
\newcommand*{\podm}{\textit{\small [noun]} }
\newcommand*{\pridm}{\textit{\small [adj]} }
\newcommand*{\zamen}{\textit{\small [pronoun]} }
\newcommand*{\pris}{\textit{\small [adverb]} }
\newcommand*{\cislo}{\textit{\small [number]} }
\newcommand*{\slo}{\textit{\small [verb]} }
\newcommand*{\pred}{\textit{\small [preposition]} }
\newcommand*{\spoj}{\textit{\small [conjunction]} }
\newcommand*{\cit}{\textit{\small [exclamation]} }
%---
\newcommand*{\jedc}{\textit{\small [singular]} }
\newcommand*{\mnoc}{\textit{\small [plural]} }
\newcommand*{\poc}{\textit{\small [C]} }
\newcommand*{\nep}{\textit{\small [U]} }
\newcommand*{\CU}{\textit{\small [C, U]} }
\newcommand*{\jed}{\textit{\small [S]} }
\newcommand*{\slot}{\textit{\small [T]} }
\newcommand*{\sloi}{\textit{\small [I]} }
\newcommand*{\ubn}{\textit{\small [usually before noun]} }
\newcommand*{\us}{\textit{\small [usually singular]} }
\newcommand*{\up}{\textit{\small [usually plural]} }
\newcommand*{\nbn}{\textit{\small [not before noun]} }
\newcommand*{\obn}{\textit{\small [only before noun]} }
\newcommand*{\bn}{\textit{\small [before noun]} }
\newcommand*{\nubn}{\textit{\small [not usually before noun]} } 
%---
\newcommand*{\UK}{{\small (UK) }}
\newcommand*{\US}{{\small (US) }}
\newcommand*{\SR}{{\small (SR) }}
%---
\newcommand*{\fone}{\fontfamily{qag}\selectfont} % Eng word
\newcommand*{\ftwo}{\fontfamily{phv}\selectfont} % pronunciation
\newcommand*{\fthree}{\fontfamily{ccr}\selectfont} %
\newcommand*{\ffour}{\fontfamily{pag}\selectfont} % 
%--
\newcommand*{\tm}{\small \fontfamily{ccr}\selectfont} % komentar
%---
\newcommand*{\frm}{\textit{\small (formal)} }
\newcommand*{\ifrm}{\textit{\small (informal)} }
\newcommand*{\app}{\textit{\small (approving)} } 
\newcommand*{\pc}{\textit{\small (computing)} }
\newcommand*{\osh}{\textit{\small (old-fashioned)} }
\newcommand*{\slg}{\textit{\small (slang)} }
\newcommand*{\mat}{\textit{\small (mathematics)} }
\newcommand*{\chem}{\textit{\small (chemistry)} }
\newcommand*{\lit}{\textit{\small (literary)} }
\newcommand*{\mus}{\textit{\small (music)} } 
\newcommand*{\fin}{\textit{\small (finance)} }
\newcommand*{\gem}{\textit{\small (geometry)} }
\newcommand*{\gmm}{\textit{\small (grammar)} } 
\newcommand*{\bus}{\textit{\small (business)} } 
\newcommand*{\law}{\textit{\small (law)} } 
\newcommand*{\phs}{\textit{\small (physics)} } 
\newcommand*{\frrm}{\textit{\small (rather formal)} }
\newcommand*{\irrm}{\textit{\small (rather informal)} }
\newcommand*{\sth}{\textit{\small sth }}
\newcommand*{\stb}{\textit{\small sb }}
\newcommand*{\tboo}{\textit{\small (taboo)} }
\newcommand*{\sla}{\textit{\small (slang)} }
\newcommand*{\odi}{\textit{\small (often disapproving)} }
\newcommand*{\bis}{\textit{\small (business)} }
\newcommand*{\diss}{\textit{\small (disapproving)} }
\newcommand*{\ling}{\textit{\small (linguistics)} }

\begin{document}
\catcode`\-=12
\sloppy

\begin{longtable}{llp{5cm}}
  {\fone lime } & {\ftwo [\textipa{laIm }] } & \podm \nep vápno $\square$ \CU limetka $\square$ \poc {\fone lime tree, linden tree } {\ftwo [\textipa{\textprimstress lIn.d@n }] } lipa \\
  {\fone avenue } & {\ftwo [\textipa{\textprimstress \ae [email protected]: }] } & \podm \poc avenue, alej, bulvár \textit{\tm (Ave., Av.)}  \\
  {\fone lane } & {\ftwo [\textipa{leIn }] } & \podm \poc poľná cesta $\square$ \poc jazdný pruh, dopravný pás \\
  {\fone grove } & {\ftwo [\textipa{gr@Uv }] } & \podm \poc háj, lesík \\

  %---
  \newpage
  %---

  {\fone ancient } & {\ftwo [\textipa{\textprimstress eIn.S\super @nt }] } & \pridm staroveký $\square$ starý, starobylý, starodávny $\square$ \mnoc {\fone the ancients } staroveké národy  \\
  {\fone navigation } & {\ftwo [\textipa{\textsecstress n\ae v. I\textprimstress geI.S\super @n }] } & \podm \nep navigácia $\square$ riadenie lode, let  \\
  {\fone sailor } & {\ftwo [\textipa{\textprimstress seI.l@\super r }] } & \podm \poc námorník, lodník $\square$    \\

  %---
  \newpage
  %---

  {\fone compass } & {\ftwo [\textipa{\textprimstress k2m.p@s }] } & \podm \poc kompas  \\
  {\fone approximate } & {\ftwo [\textipa{@\textprimstress pr6k.sI.m@t }] } & \pridm približný  \\
  {\fone exact$^{1000}$} & {\ftwo [\textipa{Ig\textprimstress z\ae kt }] } & \pridm presný, bezchybný, exaktný   \\ 
\end{longtable}


\end{document}

Respuesta1

Como se indica en los comentarios, usar glossarieses probablemente la mejor solución. Sin embargo, si desea mantener su enfoque original, puede utilizar combinaciones de labely pageref, para las cuales el segundo mostrará el número de página del primero.

MWE:

\documentclass{article}
\usepackage[a6paper,landscape]{geometry}
\usepackage{longtable}

\begin{document}
\begin{longtable}{|l|l|}
\hline
word a & meaning a (see also page \pageref{wordb})\\\hline
\newpage
\hline
word b\label{wordb} & meaning b\\\hline
\end{longtable}
\end{document}

Resultado:

ingrese la descripción de la imagen aquí

información relacionada