In order to count easily words in a text, i'd like to display for each word its "number",
Context : I'm teaching my students to copy a text and to evaluate them I count how many words they successfully copied.
It's not necessary that the counting is done automatically, I'm using the same text,
This is what I've tried for now :
\documentclass{article}
\usepackage{amsmath,stackengine}
\stackMath
\newcommand{\wordcount}[2]{\stackunder{\text{#1}}{\scriptstyle \text{#2}}}
\[
\setstackgap{S}{3pt}
\wordcount{Jusqu'}{5}
\wordcount{au}{6}
\wordcount{{\fontsize{14}{11}\selectfont XII}}{7}
\wordcount{siècle}{8}
\]
\end{document}
Which give this result :
My problem are multiple :
- The code is "heavy" I have a long text, ideally I'd like a simple command...
- It's in math mode
- Spacing is a nightmare (the 6 and 7 are higher than the 5 and no space between words)...
Any help is appreciated (sorry for any mistake, french here),
Thanks !
\documentclass
. Also, no undefined macros like\ieme
. You can edit your existing question. Welcome to the site.\renewcommand\stacktype{L}
. Then you can adjust the baselineskip with\setstackgap{L}{<dimen>}
.