def get_quote(self, max_width=FRAME_WIDTH - 1): text_mobject_kwargs = { "alignment": "", "arg_separator": self.quote_arg_separator, } if isinstance(self.quote, str): quote = TextMobject("``%s''" % self.quote.strip(), **text_mobject_kwargs) else: words = ["\\Large ``"] + list(self.quote) + ["''"] quote = TextMobject(*words, **text_mobject_kwargs) ##TODO, make less hacky if self.quote_arg_separator == " ": quote[0].shift(0.2 * RIGHT) quote[-1].shift(0.2 * LEFT) for term, color in self.set_colored_quote_terms.items(): quote.set_color_by_tex(term, color) quote.to_edge(UP) if quote.get_width() > max_width: quote.scale_to_fit_width(max_width) return quote