Skip to content

gridmicrotex 0.1.0

Choose a tag to compare

@adayim adayim released this 21 Aug 15:11
  • Text inside \text{} is drawn a line at a time rather than a letter at a time, so kerning is applied, PDF/SVG output can be searched for a phrase, and files are several times smaller. Text given a max_width is drawn a word at a time, since the spaces are where it breaks.
  • Right-to-left text renders in the correct order, including across emphasis, colour and other font changes, and with or without max_width.
  • New markdown_grob() and grid.markdown() render inline markdown with LaTeX math; markdown_box_grob() renders a block document.
  • New geom_markdown() and element_markdown() for ggplot2, both taking style. A title containing headings or lists is laid out as blocks, not flattened.
  • Markdown covers headings, lists, task lists, quotes, code, tables, images, footnotes, display $$…$$, links and inline HTML. A fenced code block keeps its indentation and is syntax-highlighted when it names a language.
  • New register_highlighter() and available_highlighters(). R, Python, SQL, shell, C++, YAML, JSON, Stan, Julia and LaTeX are built in, along with the usual GitHub aliases; token colours are CSS classes (.kw, .co, .st, …), the names knitr already writes into HTML output. Grammars are KDE syntax XML files.
  • New markdown_style() and md_style() style markdown through a CSS cascade of HTML tag names; the body rule styles the box itself.
  • New latex_options(markdown_style = ) sets a document-wide default.
  • New "github" style preset, shipped as a CSS file.
  • <div class=> and <div style=> style a chunk of markdown; <span class=> styles an inline run.
  • New justify and line_break arguments control paragraph line breaking.
  • New \gmfontfamily{family}{content} sets the font for one run of text.
  • \includegraphics[width=,height=,scale=,keepaspectratio]{file} draws PNG, JPEG and SVG images inline in a formula; it previously parsed and drew nothing. The extension may be omitted and \graphicspath{} is searched, as in LaTeX. An SVG is drawn as real vector, so it stays sharp at any output resolution.
  • New p{len} column type gives tabular fixed-width, wrapping cells.
  • \url{} and \href{}{} render as styled text instead of literally.
  • load_font() is renamed load_math_font(); the old name is deprecated.
  • check_fonts() is renamed check_math_fonts(); the old name is deprecated.
  • Bug fix: \rotatebox past a quarter turn drew text and glyphs 180 degrees out, so a \rotatebox{90} label came out upside down.
  • Bug fix: \textrm{} now returns text to gp$fontfamily; it previously did nothing.
  • Bug fix: \texttt{} drew in the body font instead of a monospace one.
  • Bug fix: max_width is now honoured by content containing \\ line breaks.
  • Bug fix: in "mixed" mode a line break was kept inside the text rather than breaking the formula, so anything after it was drawn beside the whole block instead of on its own line. A pasted \caption landed to the left of its table, and math following a line break sat between the lines.
  • Bug fix: LaTeX tick labels measured 0 x 0, so ggplot2 reserved no room and they overlapped the axis title.
  • Bug fix: reloading the package corrupted MicroTeX's macro registry, so a later large formula could crash R.
  • Bug fix: \- offered a line break but drew no hyphen at it.
  • Bug fix: an & in text was read as an alignment tab and everything after it was dropped, so "Treatment & Control" rendered as "Treatment ".
  • Bug fix: tabular* failed to parse, reporting an invalid alignment; its width argument is now dropped along with the star.
  • Bug fix: a layout measured on one graphics device could be reused on another, placing text at the wrong widths — the layout cache now keys on the device.