def pandoc_cmd(book):
    """Create the command to convert the files (listed in `book`)
    into a pdf. This is wrapped with echos that the build has started and
    is complete."""
    with open(book + '.txt') as f:
        return (
            'echo "Starting build of {book}.pdf" && pandoc {files} -f markdown-smart --table-of-contents --top-level-division=chapter -o {book}.pdf && echo "  {book}.pdf created."'
            .format(book=book, files=f.read().replace('\n', ' ')))
