Ipelib: ipe::Latex Class Reference

Ipelib

Classes | Public Member Functions | Friends | List of all members
ipe::Latex Class Reference

`#include <ipelatex.h>`

## Public Member Functions
| Latex (const Cascade *sheet, LatexType latexType)
| ~Latex ()
int | scanObject (const Object *obj)
int | scanPage (Page *page)
void | addPageNumber (int pno, int vno, int npages, int nviews)
int | createLatexSource (Stream &stream, String preamble)
bool | readPdf (DataSource &source)
bool | updateTextObjects ()
PdfResources * | takeResources ()

## Friends
class | ipe::TextCollectingVisitor

## Detailed Description

Object that converts latex source to PDF format.

This object is responsible for creating the PDF representation of text objects.

## Constructor & Destructor Documentation

## ◆ Latex()

Latex::Latex | ( | const Cascade * | sheet,
|  | LatexType | latexType
| ) |  |

Create a converter object.

## ◆ ~Latex()

Latex::~Latex | ( |  | ) |

Destructor.

## Member Function Documentation

## ◆ scanObject()

int Latex::scanObject | ( | const Object * | obj | ) |

Scan an object and insert all text objects into Latex's list. Returns total number of text objects found so far.

References ipe::Object::accept().

Referenced by ipe::Document::runLatex().

## ◆ scanPage()

int Latex::scanPage | ( | Page * | page | ) |

Scan a page and insert all text objects into Latex's list. Returns total number of text objects found so far.

References ipe::Object::accept(), ipe::Text::accept(), ipe::Page::applyTitleStyle(), ipe::Page::count(), ipe::Page::invalidateBBox(), ipe::Page::object(), and ipe::Page::titleText().

Referenced by ipe::Document::runLatex().

## ◆ addPageNumber()

void Latex::addPageNumber | ( | int | pno,
|  | int | vno,
|  | int | npages,
|  | int | nviews
| ) |  |

Create Text object to represent the page number of this view.

References ipe::Text::ELabel, ipe::String::empty(), ipe::StyleSheet::PageNumberStyle::iColor, ipe::StyleSheet::PageNumberStyle::iHorizontalAlignment, ipe::AllAttributes::iHorizontalAlignment, ipe::StyleSheet::PageNumberStyle::iPos, ipe::StyleSheet::PageNumberStyle::iSize, ipe::AllAttributes::iStroke, ipe::StyleSheet::PageNumberStyle::iText, ipe::AllAttributes::iTextSize, ipe::StyleSheet::PageNumberStyle::iVerticalAlignment, ipe::AllAttributes::iVerticalAlignment, ipe::PdfResources::SPageNumber::page, ipe::Text::size(), ipe::PdfResources::SPageNumber::text, and ipe::PdfResources::SPageNumber::view.

Referenced by ipe::Document::runLatex().

## ◆ createLatexSource()

int Latex::createLatexSource | ( | Stream & | stream,
|  | String | preamble
| ) |  |

Create a Latex source file with all the text objects collected before. The client should have prepared a directory for the Pdflatex run, and pass the name of the Latex source file to be written by Latex.

Returns the number of text objects that did not yet have an XForm, or a negative error code.

References ipe::Rect::addPoint(), ipe::Rect::bottomLeft(), ipe::PdfDict::count(), ipe::PdfObj::dict(), ipe::EColor, ipe::ELabelStyle, ipe::String::empty(), ipe::ETextSize, ipe::ETextStretch, ipe::ETextStyle, ipe::PdfDict::get(), ipe::PdfDict::getInteger(), ipe::PdfDict::getNumber(), ipe::PdfDict::getNumberArray(), ipe::Text::getXForm(), ipe::Text::XForm::iBBox, ipe::Color::iBlue, ipe::Text::XForm::iDepth, ipe::Color::iGreen, ipe::Text::XForm::iName, ipe::Color::iRed, ipe::Text::XForm::iRefCount, ipe::Color::isGray(), ipe::Text::isMinipage(), ipe::Attribute::isNumber(), ipe::Text::XForm::iStretch, ipe::Text::XForm::iTranslation, ipe::PdfDict::key(), ipe::Luatex, ipe::Fixed::mult(), ipe::Attribute::number(), ipe::PdfObj::ref(), ipe::String::size(), ipe::Attribute::string(), ipe::Text::stroke(), ipe::Text::style(), ipe::String::substr(), ipe::Text::text(), ipe::Fixed::toDouble(), ipe::PdfRef::value(), ipe::PdfDict::value(), and ipe::Text::width().

Referenced by ipe::Document::runLatex().

## ◆ readPdf()

bool Latex::readPdf | ( | DataSource & | source | ) |

Read the PDF file created by Pdflatex.

Must have performed the call to Pdflatex, and pass the name of the resulting output file.

References ipe::PdfObj::array(), ipe::PdfArray::count(), ipe::PdfDict::count(), ipe::PdfObj::dict(), ipe::PdfDict::get(), ipe::PdfDict::key(), ipe::PdfArray::obj(), ipe::PdfObj::ref(), ipe::PdfRef::value(), and ipe::PdfDict::value().

Referenced by ipe::Document::runLatex().

## ◆ updateTextObjects()

bool Latex::updateTextObjects | ( |  | ) |

Notify all text objects about their updated PDF code.

Returns true if successful.

References ipe::String::z().

Referenced by ipe::Document::runLatex().

## ◆ takeResources()

PdfResources * Latex::takeResources | ( |  | ) |

Return the newly created PdfResources and pass ownership to caller.

References ipe::Group::begin(), ipe::Group::end(), ipe::TextCollectingVisitor, and ipe::Text::size().

Referenced by ipe::Document::runLatex().

## Friends And Related Function Documentation

## ◆ ipe::TextCollectingVisitor

friend class ipe::TextCollectingVisitor
| friend

Referenced by takeResources().

The documentation for this class was generated from the following files:

- ipelatex.h
- ipelatex.cpp