diff --git a/bopytex/bopytex.py b/bopytex/bopytex.py index 937623d..0d21994 100755 --- a/bopytex/bopytex.py +++ b/bopytex/bopytex.py @@ -133,7 +133,16 @@ def produce_and_compile(options): dest = working_dir / Path(template.replace("tpl", infos["num"])) logger.debug(f"Feeding template toward {dest}") tex_files.append(dest) - pytex.feed(working_dir / template, {"infos": infos}, output=dest, force=1) + if options.crazy: + while True: + try: + pytex.feed(working_dir / template, {"infos": infos}, output=dest, force=1) + except: + pass + else: + break + else: + pytex.feed(working_dir / template, {"infos": infos}, output=dest, force=1) logger.debug(f"{dest} fed") if not options.no_compil: @@ -248,6 +257,13 @@ def main(): dest="corr", help="Create and compile correction while making subjects", ) + parser.add_option( + "-C", + "--crazy", + action="store_true", + dest="crazy", + help="Crazy mode. Tries and tries again until template feeding success!", + ) (options, _) = parser.parse_args()