Class: Antex::SetBox
- Inherits:
-
Measurable
- Object
- Measurable
- Antex::SetBox
- Defined in:
- lib/antex/set_box.rb
Overview
Encapsulates calculations and results for perfectly typesetting the SVG vectorial conversion of a TeX box.
Three files are required by #load for initialization:
YAMLfile containingTeXmeasures-
We obtain this by using
TeXdirectly to measure the box and write to file. Required metrics areht,dpandwd(naturally expressed in pts). SVGpicture fittingtfmmetrics-
We obtain this by converting the
DVIrendition of the box toSVGusing /dvisvgm. SVGpicture fitting the ink-
We obtain this by converting the
DVIrendition of the box toSVGusing /dvisvgmwith the--exactflag.
After the initialization the calculations are performed immediatly. Six metrics become available:
-
mt,mr,mlandml(the margins, positive or negative) -
wdandht(width and height) -
ex(the default unit)
Defined Under Namespace
Classes: InvalidMeasure
Instance Attribute Summary
Attributes inherited from Measurable
Instance Method Summary collapse
-
#load(yml:, tfm:, fit:) ⇒ TexBox
Returns
selfafter loading.
Methods inherited from Measurable
Constructor Details
This class inherits a constructor from Antex::Measurable
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Antex::Measurable
Instance Method Details
#load(yml:, tfm:, fit:) ⇒ TexBox
Returns self after loading
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/antex/set_box.rb', line 32 def load(yml:, tfm:, fit:) @tex = TexBox.new.load yml @tfm = SVGBox.new.load tfm @fit = SVGBox.new.load fit @tex.default_unit = :ex check_measures! self.measures = compute_measures self.default_unit = :ex self end |