Skip to content

office Open xml: shared_math #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
263 changes: 263 additions & 0 deletions pydocx/openxml/shared_math/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
# coding: utf-8

from pydocx.openxml.shared_math.accent import Accent
from pydocx.openxml.shared_math.accent_properties import AccentProperties
from pydocx.openxml.shared_math.align import Align
from pydocx.openxml.shared_math.align_scripts import AlignScripts
from pydocx.openxml.shared_math.argument_properties import ArgumentProperties
from pydocx.openxml.shared_math.argument_size import ArgumentSize
from pydocx.openxml.shared_math.bar import Bar
from pydocx.openxml.shared_math.bar_properties import BarProperties
from pydocx.openxml.shared_math.base_justification import BaseJustification
from pydocx.openxml.shared_math.border_box import BorderBox
from pydocx.openxml.shared_math.border_box_properties import BorderBoxProperties
from pydocx.openxml.shared_math.box import Box
from pydocx.openxml.shared_math.box_properties import BoxProperties
from pydocx.openxml.shared_math.break_on_binary_operators import BreakOnBinaryOperators
from pydocx.openxml.shared_math.break_on_binary_subtraction import BreakOnBinarySubtraction
from pydocx.openxml.shared_math.brk import Break
from pydocx.openxml.shared_math.character import Character
from pydocx.openxml.shared_math.control_properties import ControlProperties
from pydocx.openxml.shared_math.default_justification import DefaultJustification
from pydocx.openxml.shared_math.degree import Degree
from pydocx.openxml.shared_math.delimiter_beginning_character import (
DelimiterBeginningCharacter
)
from pydocx.openxml.shared_math.delimiter_ending_character import (
DelimiterEndingCharacter
)
from pydocx.openxml.shared_math.delimiter_function import DelimiterFunction
from pydocx.openxml.shared_math.delimiter_properties import DelimiterProperties
from pydocx.openxml.shared_math.delimiter_separator_character import (
DelimiterSeparatorCharacter
)
from pydocx.openxml.shared_math.denominator import Denominator
from pydocx.openxml.shared_math.differential import Differential
from pydocx.openxml.shared_math.element import Element
from pydocx.openxml.shared_math.equation_array_function import EquationArrayFunction
from pydocx.openxml.shared_math.equation_array_properties import EquationArrayProperties
from pydocx.openxml.shared_math.fraction_function import FractionFunction
from pydocx.openxml.shared_math.fraction_properties import FractionProperties
from pydocx.openxml.shared_math.function_apply_function import FunctionApplyFunction
from pydocx.openxml.shared_math.function_name import FunctionName
from pydocx.openxml.shared_math.function_properties import FunctionProperties
from pydocx.openxml.shared_math.group_character_function import GroupCharacterFunction
from pydocx.openxml.shared_math.group_character_properties import GroupCharacterProperties
from pydocx.openxml.shared_math.grow import Grow
from pydocx.openxml.shared_math.hide_bottom import HideBottom
from pydocx.openxml.shared_math.hide_degree import HideDegree
from pydocx.openxml.shared_math.hide_left import HideLeft
from pydocx.openxml.shared_math.hide_placeholders import HidePlaceholders
from pydocx.openxml.shared_math.hide_right import HideRight
from pydocx.openxml.shared_math.sub_hide import SubHide
from pydocx.openxml.shared_math.sup_hide import SupHide
from pydocx.openxml.shared_math.hide_top import HideTop
from pydocx.openxml.shared_math.integral_limit_locations import IntegralLimitLocations
from pydocx.openxml.shared_math.inter_equation_spacing import InterEquationSpacing
from pydocx.openxml.shared_math.intra_equation_spacing import IntraEquationSpacing
from pydocx.openxml.shared_math.justification import Justification
from pydocx.openxml.shared_math.left_margin import LeftMargin
from pydocx.openxml.shared_math.limit import Limit
from pydocx.openxml.shared_math.literal import Literal
from pydocx.openxml.shared_math.lower_limit_function import LowerLimitFunction
from pydocx.openxml.shared_math.lower_limit_properties import LowerLimitProperties
from pydocx.openxml.shared_math.math_font import MathFont
from pydocx.openxml.shared_math.math_properties import MathProperties
from pydocx.openxml.shared_math.matrix_column import MatrixColumn
from pydocx.openxml.shared_math.matrix_column_count import MatrixColumnCount
from pydocx.openxml.shared_math.matrix_column_gap import MatrixColumnGap
from pydocx.openxml.shared_math.matrix_column_gap_rule import MatrixColumnGapRule
from pydocx.openxml.shared_math.matrix_column_justification import MatrixColumnJustification
from pydocx.openxml.shared_math.matrix_column_properties import MatrixColumnProperties
from pydocx.openxml.shared_math.matrix_column_spacing import MatrixColumnSpacing
from pydocx.openxml.shared_math.matrix_columns import MatrixColumns
from pydocx.openxml.shared_math.matrix_function import MatrixFunction
from pydocx.openxml.shared_math.matrix_properties import MatrixProperties
from pydocx.openxml.shared_math.matrix_row import MatrixRow
from pydocx.openxml.shared_math.maximum_distribution import MaximumDistribution
from pydocx.openxml.shared_math.nary_limit_location import NaryLimitLocation
from pydocx.openxml.shared_math.nary_operator_function import NaryOperatorFunction
from pydocx.openxml.shared_math.nary_properties import NaryProperties
from pydocx.openxml.shared_math.no_break import NoBreak
from pydocx.openxml.shared_math.normal_text import NormalText
from pydocx.openxml.shared_math.numerator import Numerator
from pydocx.openxml.shared_math.object_distribution import ObjectDistribution
from pydocx.openxml.shared_math.omath import OMath
from pydocx.openxml.shared_math.omath_paragraph import OMathParagraph
from pydocx.openxml.shared_math.omath_paragraph_properties import (
OMathParagraphProperties
)
from pydocx.openxml.shared_math.operator_emulator import OperatorEmulator
from pydocx.openxml.shared_math.phantom_function import PhantomFunction
from pydocx.openxml.shared_math.phantom_properties import PhantomProperties
from pydocx.openxml.shared_math.position import Position
from pydocx.openxml.shared_math.post_equation_spacing import PostEquationSpacing
from pydocx.openxml.shared_math.pre_equation_spacing import (
PreEquationSpacing
)
from pydocx.openxml.shared_math.pre_sub_superscript_function import (
PreSubSuperscriptFunction
)
from pydocx.openxml.shared_math.pre_sub_superscript_properties import (
PreSubSuperscriptProperties
)
from pydocx.openxml.shared_math.radical_function import RadicalFunction
from pydocx.openxml.shared_math.radical_properties import RadicalProperties
from pydocx.openxml.shared_math.right_margin import RightMargin
from pydocx.openxml.shared_math.row_spacing import RowSpacing
from pydocx.openxml.shared_math.row_spacing_rule import RowSpacingRule
from pydocx.openxml.shared_math.script import Script
from pydocx.openxml.shared_math.shape_delimiters import ShapeDelimiters
from pydocx.openxml.shared_math.show import Show
from pydocx.openxml.shared_math.small_fraction import SmallFraction
from pydocx.openxml.shared_math.strike_bltr import StrikeBLTR
from pydocx.openxml.shared_math.strike_h import StrikeH
from pydocx.openxml.shared_math.strike_tlbr import StrikeTLBR
from pydocx.openxml.shared_math.strike_v import StrikeV
from pydocx.openxml.shared_math.style import Style
from pydocx.openxml.shared_math.sub import Sub
from pydocx.openxml.shared_math.sub_superscript_function import SubSuperscriptFunction
from pydocx.openxml.shared_math.sub_superscript_properties import SubSuperscriptProperties
from pydocx.openxml.shared_math.subscript_function import SubscriptFunction
from pydocx.openxml.shared_math.subscript_properties import SubscriptProperties
from pydocx.openxml.shared_math.sup import Sup
from pydocx.openxml.shared_math.superscript import Superscript
from pydocx.openxml.shared_math.superscript_function import SuperscriptFunction
from pydocx.openxml.shared_math.superscript_properties import SuperscriptProperties
from pydocx.openxml.shared_math.transparent import Transparent
from pydocx.openxml.shared_math.type import Type
from pydocx.openxml.shared_math.upper_limit_function import UpperLimitFunction
from pydocx.openxml.shared_math.upper_limit_properties import UpperLimitProperties
from pydocx.openxml.shared_math.use_display_math_defaults import UseDisplayMathDefaults
from pydocx.openxml.shared_math.vertical_justification import VerticalJustification
from pydocx.openxml.shared_math.wrap_indent import WrapIndent
from pydocx.openxml.shared_math.wrap_right import WrapRight
from pydocx.openxml.shared_math.zero_ascent import ZeroAscent
from pydocx.openxml.shared_math.zero_descent import ZeroDescent
from pydocx.openxml.shared_math.zero_width import ZeroWidth


__all__ = [
'Accent',
'AccentProperties',
'Align',
'AlignScripts',
'ArgumentProperties',
'ArgumentSize',
'Bar',
'BarProperties',
'BaseJustification',
'BorderBox',
'BorderBoxProperties',
'Box',
'BoxProperties',
'BreakOnBinaryOperators',
'BreakOnBinarySubtraction',
'Break',
'Character',
'ControlProperties',
'DefaultJustification',
'Degree',
'DelimiterBeginningCharacter',
'DelimiterEndingCharacter',
'DelimiterFunction',
'DelimiterProperties',
'DelimiterSeparatorCharacter',
'Denominator',
'Differential',
'Element',
'EquationArrayFunction',
'EquationArrayProperties',
'FractionFunction',
'FractionProperties',
'FunctionApplyFunction',
'FunctionName',
'FunctionProperties',
'GroupCharacterFunction',
'GroupCharacterProperties',
'Grow',
'HideBottom',
'HideDegree',
'HideLeft',
'HidePlaceholders',
'HideRight',
'SubHide',
'SupHide',
'HideTop',
'IntegralLimitLocations',
'InterEquationSpacing',
'IntraEquationSpacing',
'Justification',
'LeftMargin',
'Limit',
'Literal',
'LowerLimitFunction',
'LowerLimitProperties',
'MathFont',
'MathProperties',
'MatrixColumn',
'MatrixColumnCount',
'MatrixColumnGap',
'MatrixColumnGapRule',
'MatrixColumnJustification',
'MatrixColumnProperties',
'MatrixColumnSpacing',
'MatrixColumns',
'MatrixFunction',
'MatrixProperties',
'MatrixRow',
'MaximumDistribution',
'NaryLimitLocation',
'NaryOperatorFunction',
'NaryProperties',
'NoBreak',
'NormalText',
'Numerator',
'Numerator',
'ObjectDistribution',
'OMath',
'OMathParagraph',
'OMathParagraphProperties',
'OperatorEmulator',
'PhantomFunction',
'PhantomProperties',
'Position',
'PostEquationSpacing',
'PreEquationSpacing',
'PreSubSuperscriptFunction',
'PreSubSuperscriptProperties',
'RadicalFunction',
'RadicalProperties',
'RightMargin',
'RowSpacing',
'RowSpacingRule',
'Script',
'ShapeDelimiters',
'Show',
'SmallFraction',
'StrikeBLTR',
'StrikeH',
'StrikeTLBR',
'StrikeV',
'Style',
'Sub',
'SubSuperscriptFunction',
'SubSuperscriptProperties',
'SubscriptFunction',
'SubscriptProperties',
'Sup',
'Superscript',
'SuperscriptFunction',
'SuperscriptProperties',
'Transparent',
'Type',
'UpperLimitFunction',
'UpperLimitProperties',
'UseDisplayMathDefaults',
'VerticalJustification',
'WrapIndent',
'WrapRight',
'ZeroAscent',
'ZeroDescent',
'ZeroWidth'
]
18 changes: 18 additions & 0 deletions pydocx/openxml/shared_math/accent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)

from pydocx.models import XmlModel, XmlCollection
from pydocx.openxml.shared_math.accent_properties import AccentProperties
from pydocx.openxml.shared_math.element import Element


class Accent(XmlModel):
XML_TAG = 'acc'

children = XmlCollection(
AccentProperties,
Element
)
18 changes: 18 additions & 0 deletions pydocx/openxml/shared_math/accent_properties.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)

from pydocx.models import XmlModel, XmlCollection, XmlChild
from pydocx.openxml.shared_math.character import Character
from pydocx.openxml.shared_math.control_properties import ControlProperties


class AccentProperties(XmlModel):
XML_TAG = 'accPr'

chr = XmlChild(type=Character, attrname='val')
children = XmlCollection(
ControlProperties
)
11 changes: 11 additions & 0 deletions pydocx/openxml/shared_math/align.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)

from pydocx.models import XmlModel


class Align(XmlModel):
XML_TAG = 'aln'
11 changes: 11 additions & 0 deletions pydocx/openxml/shared_math/align_scripts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)

from pydocx.models import XmlModel


class AlignScripts(XmlModel):
XML_TAG = 'alnScr'
14 changes: 14 additions & 0 deletions pydocx/openxml/shared_math/argument_properties.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)

from pydocx.models import XmlModel, XmlChild
from pydocx.openxml.shared_math.argument_size import ArgumentSize


class ArgumentProperties(XmlModel):
XML_TAG = 'argPr'

arg_sz = XmlChild(type=ArgumentSize, attrname='val')
11 changes: 11 additions & 0 deletions pydocx/openxml/shared_math/argument_size.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)

from pydocx.models import XmlModel


class ArgumentSize(XmlModel):
XML_TAG = 'argSz'
17 changes: 17 additions & 0 deletions pydocx/openxml/shared_math/bar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)

from pydocx.models import XmlModel, XmlCollection
from pydocx.openxml.shared_math.bar_properties import BarProperties
from pydocx.openxml.shared_math.element import Element


class Bar(XmlModel):
XML_TAG = 'bar'
children = XmlCollection(
BarProperties,
Element
)
18 changes: 18 additions & 0 deletions pydocx/openxml/shared_math/bar_properties.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)

from pydocx.models import XmlModel, XmlCollection, XmlChild
from pydocx.openxml.shared_math.control_properties import ControlProperties
from pydocx.openxml.shared_math.position import Position


class BarProperties(XmlModel):
XML_TAG = 'barPr'

pos = XmlChild(type=Position, attrname='val')
children = XmlCollection(
ControlProperties
)
Loading