Since there is no --recursive option, I wonder how to recursively format all entries in \input{} present in the main .tex file.
Asked
Active
Viewed 113 times
1
Rubem Pacelli
- 994
1 Answers
1
Due to lack of apparent solution for this this issue, the following shell command forces latexindent to run for every \input{} entry found in the main .tex file:
grep -oP "(?<=\\\\input{)[^}]+" main.tex | while read file; do
latexindent --silent --overwrite ${file}
done
where main.tex is the main latex file with your \input{} entries. That is a ad-hoc solution, though. I would like to have a more elegant way out.
Rubem Pacelli
- 994
latexindentcan format multiple files in one call, so for example,latexindent *.texto format all.texfiles in the current directory – cmhughes May 29 '23 at 20:30.texfiles are not necessarily in the root directory – Rubem Pacelli May 29 '23 at 23:55latexindent dir1/*.tex dir2/*.tex– cmhughes May 30 '23 at 07:00latexindentshould run. – Rubem Pacelli May 30 '23 at 15:56