diff --git a/PyTeX/format/formatting_config.py b/PyTeX/format/formatting_config.py index 656765c..7e54af6 100644 --- a/PyTeX/format/formatting_config.py +++ b/PyTeX/format/formatting_config.py @@ -53,31 +53,35 @@ class FormattingConfig(Config): header = filled_content[YAML_HEADER] extra = header[YAML_EXTRA] self._include_extra_header = extra[YAML_INCLUDE_EXTRA_HEADER] - self._extra_header = GenericText( - extra[YAML_PATH] if extra[YAML_PATH] else extra[YAML_TEXT] - ) + if extra[YAML_PATH] or extra[YAML_TEXT]: + self._extra_header = GenericText( + extra[YAML_PATH] if extra[YAML_PATH] else extra[YAML_TEXT] + ) repo = header[YAML_REPO] self._include_repo_info_text = repo[YAML_INCLUDE_INFO_TEXT] self._include_repo_version = repo[YAML_INCLUDE_VERSION] - self._repo_info_text = GenericText( - repo[YAML_PATH] if repo[YAML_PATH] else repo[YAML_TEXT] - ) + if repo[YAML_PATH] or repo[YAML_TEXT]: + self._repo_info_text = GenericText( + repo[YAML_PATH] if repo[YAML_PATH] else repo[YAML_TEXT] + ) pytex = header[YAML_PYTEX] self._include_pytex_info_text = pytex[YAML_INCLUDE_INFO_TEXT] self._include_pytex_version = pytex[YAML_INCLUDE_VERSION] - self._pytex_info_text = GenericText( - pytex[YAML_PATH] if pytex[YAML_PATH] else pytex[YAML_TEXT] - ) + if pytex[YAML_PATH] or pytex[YAML_TEXT]: + self._pytex_info_text = GenericText( + pytex[YAML_PATH] if pytex[YAML_PATH] else pytex[YAML_TEXT] + ) self._include_time = header[YAML_INCLUDE_TIME] license_ = header[YAML_LICENSE] self._include_license = license_[YAML_INCLUDE_LICENSE] - self._license = GenericText( - license_[YAML_PATH] if license_[YAML_PATH] else license_[YAML_TEXT] - ) + if license_[YAML_PATH] or license_[YAML_TEXT]: + self._license = GenericText( + license_[YAML_PATH] if license_[YAML_PATH] else license_[YAML_TEXT] + ) docstrip = filled_content[YAML_DOCSTRIP] self._include_drv = docstrip[YAML_INCLUDE_DRV]