eelbrain.fmtxt.FMText

class eelbrain.fmtxt.FMText(content=None, tag=None, options=None, rasterize=False)

List of FMTextElement items

Parameters
  • content (FMTextLike) – Any item with a string representation (str, FMText, scalar, …) or an object that iterates over such items (e.g. a list of FMText).

  • tag (str) – Formatting tag.

  • options (dict) – Options for HTML tags.

  • rasterize (bool) – Try to rasterize images in content.

Notes

The property argument is primarily used for TeX commands; for example, txt = FMText('Brie', r'\textbf') will result in the following TeX representation: r”textbf{Brie}”. Some properties are automatically translated into HTML; thus, the HTML representation of txt would be “<b>Brie</b>”. The following are additional proprties that don’t exist in TeX:

‘paragraph’

A <p> tag in HTML, and simple line breaks in TeX.

Methods

append(content)

Append content to the FMText item

copy_pdf()

Copy PDF to clipboard

copy_tex()

Copy TeX to clipboard

get_html(env)

Complete HTML representation

get_rtf([env])

rtype

str

get_str([env])

String representation

get_tex(env)

TeX representation

save_html([path, embed_images, meta])

Save in HTML format

save_pdf([path])

Save in PDF format

save_rtf([path])

Save in Rich Text format

save_tex([path])

Save in TeX format

save_txt([path])

Save as plain text file