I'm learning LaTex but have a strong programming background. My document consist of several .tex files I will \input at entry .tex file. I would like to add a lettrine to every one of them, but would rather not edit the separate .tex files. Instead, I would love if I could, somehow, get the first word of the file, then get the first letter of that first word, and then dynamically insert the lettrine{H}{eya} and append the rest of the file.
Is there any way to do this? Thanks!
EDIT:
In addition, I'm using a new command to perform certain operations before actually inputting the file, so the actual call to \input is done using a command argument, like this \input{#2}. The only answers solves my problem when calling input outside other command, but not inside the command.
\def\dolettrine #1#2 {\lettrine{#1}{#2} }passes only the first two letters, and not the first letter and then the rest of the word. – Lorenzo Peña Feb 02 '16 at 17:52#1is the first letter and#2is the rest of the first word. Note that#1is undelimited parameter and#2is delimited parameter with space delimiter. Note the space after#2declaration. – wipet Feb 02 '16 at 19:09\newcommand, it's advised to enclose the definition in\makeatletterand\makeatother, to make it work seamlessly. @wipet, please consider adding your comments regarding this, for the sake of completion. – Lorenzo Peña Feb 18 '16 at 14:33