Generate document configuration according to the content of the folder.

Currently, only the main TeX file is detected. This commit provides a
fix for the issue #78.