단어 옆에 페이지 번호를 자동으로 얻는 방법

단어 옆에 페이지 번호를 자동으로 얻는 방법

나는 단어 파일을 가지고 있습니다. 나는 환경을 이용했다 longtable. 일부 단어에 다른 단어의 페이지 번호를 추가하고 싶습니다.

자동으로 수행하는 방법을 모르겠습니다. 페이지 형식을 변경하거나 새 단어를 추가한 다음 위치 단어를 변경하고 페이지 번호를 변경할 수 있기 때문입니다. 아래 표가 제가 의미하는 바입니다.

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

답변1

의견에서 언급했듯이 사용하는 것이 glossaries아마도 가장 좋은 해결책일 것입니다. 그러나 원래 접근 방식을 유지하려면 두 번째 페이지에 첫 번째 페이지 번호가 표시되는 label및 의 조합을 사용할 수 있습니다.pageref

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}

결과:

여기에 이미지 설명을 입력하세요

관련 정보