答案1
使用datatool
阅读、排序和迭代单词。如何处理它们在很大程度上取决于您(除了任何列式内容都不会跨页)。如果这个单词表真的很长,我会将排序移至外部工具。对datatool
100 个左右的单词列表进行排序似乎很慢。摘自 128 页的 PDF:
\documentclass{beamer}
% https://en.wikipedia.org/wiki/Most_common_words_in_English
\begin{filecontents*}{\jobname.txt}
time
person
year
way
day
thing
man
world
life
hand
part
child
eye
woman
place
work
week
case
point
government
company
number
group
problem
fact
be
have
do
say
get
make
go
know
take
see
come
think
look
want
give
use
find
tell
ask
work
seem
feel
try
leave
call
good
new
first
last
long
great
little
own
other
old
right
big
high
different
small
large
next
early
young
important
few
public
bad
same
able
to
of
in
for
on
with
at
by
from
up
about
into
over
after
beneath
under
above
the
and
a
that
I
it
not
he
as
you
this
but
his
they
her
she
or
an
will
my
one
all
would
there
their
\end{filecontents*}
% Get data and sort it
\usepackage{datatool}
\DTLloaddb[noheader,keys={word}]{words}{\jobname.txt}
\dtlsort{word=ascending}{words}{\dtlletterindexcompare}
\begin{document}
\begin{frame}[allowframebreaks]
\frametitle{Just a bunch of sorted words}
\DTLforeach{words}{%
\word=word}{
\word}
\DTLforeach{words}{%
\word=word}{
\word}
\end{frame}
\begin{frame}[allowframebreaks]
\frametitle{An itemized list}
\begin{itemize}
\DTLforeach{words}{%
\word=word}{
\item \word}
\end{itemize}
\end{frame}
\DTLforeach{words}{%
\word=word}{
\begin{frame}
\frametitle{One word per frame: \word}
\word
\end{frame}
}
\end{document}