def init_context(self) -> None: self.context = DEFAULT_SETTINGS.copy() # Add special settings for latex_engine self.context.update(ADDITIONAL_SETTINGS.get(self.config.latex_engine, {})) # Add special settings for (latex_engine, language_code) if self.config.language: key = (self.config.latex_engine, self.config.language[:2]) self.context.update(ADDITIONAL_SETTINGS.get(key, {})) # Apply extension settings to context self.context['packages'] = self.usepackages # Apply user settings to context self.context.update(self.config.latex_elements) self.context['release'] = self.config.release self.context['use_xindy'] = self.config.latex_use_xindy if self.config.today: self.context['date'] = self.config.today else: self.context['date'] = format_date(self.config.today_fmt or _('%b %d, %Y'), language=self.config.language) if self.config.latex_logo: self.context['logofilename'] = path.basename(self.config.latex_logo) # for compatibilities self.context['indexname'] = _('Index') if self.config.release: # Show the release label only if release value exists self.context.setdefault('releasename', _('Release'))
def init_context(self): # type: () -> None self.context = DEFAULT_SETTINGS.copy() # Add special settings for latex_engine self.context.update( ADDITIONAL_SETTINGS.get(self.config.latex_engine, {})) # for xelatex+French, don't use polyglossia by default if self.config.latex_engine == 'xelatex': if self.config.language: if self.config.language[:2] == 'fr': self.context['polyglossia'] = '' self.context['babel'] = r'\usepackage{babel}' # Apply user settings to context self.context.update(self.config.latex_elements) self.context['release'] = self.config.release self.context['use_xindy'] = self.config.latex_use_xindy # for compatibilities self.context['indexname'] = _('Index') if self.config.release: # Show the release label only if release value exists self.context['releasename'] = _('Release')
def init_context(self): # type: () -> None self.context = DEFAULT_SETTINGS.copy() # Add special settings for latex_engine self.context.update( ADDITIONAL_SETTINGS.get(self.config.latex_engine, {})) # for xelatex+French, don't use polyglossia by default if self.config.latex_engine == 'xelatex': if self.config.language: if self.config.language[:2] == 'fr': self.context['polyglossia'] = '' self.context['babel'] = r'\usepackage{babel}' # Apply extension settings to context self.context['packages'] = self.usepackages # Apply user settings to context self.context.update(self.config.latex_elements) self.context['release'] = self.config.release self.context['use_xindy'] = self.config.latex_use_xindy if self.config.today: self.context['date'] = self.config.today else: self.context['date'] = format_date(self.config.today_fmt or _('%b %d, %Y'), language=self.config.language) if self.config.latex_logo: self.context['logofilename'] = path.basename( self.config.latex_logo) # for compatibilities self.context['indexname'] = _('Index') if self.config.release: # Show the release label only if release value exists self.context.setdefault('releasename', _('Release'))
def init_context(self): # type: () -> None self.context = DEFAULT_SETTINGS.copy() # Add special settings for latex_engine self.context.update(ADDITIONAL_SETTINGS.get(self.config.latex_engine, {})) # for xelatex+French, don't use polyglossia by default if self.config.latex_engine == 'xelatex': if self.config.language: if self.config.language[:2] == 'fr': self.context['polyglossia'] = '' self.context['babel'] = r'\usepackage{babel}' # Apply user settings to context self.context.update(self.config.latex_elements) self.context['release'] = self.config.release self.context['use_xindy'] = self.config.latex_use_xindy # for compatibilities self.context['indexname'] = _('Index') if self.config.release: # Show the release label only if release value exists self.context['releasename'] = _('Release')