# LaTeX PDF 1.7 Namespace Schema v1.7b

namespace latexSE = ""
namespace latexSEbook = ""
namespace html = ""
namespace latexH1 = ""

## PDF/UA-1

include "document-pdf-ua1.rnc"

## Default Article Namespace

### old form
Title |= element latexSE:part       {attribute rolemaps-to {"Div"}, sechead.content}
H1 |= element latexSE:section       {attribute rolemaps-to {"H1"}, sechead.content}
H2 |= element latexSE:subsection    {attribute rolemaps-to {"H2"}, sechead.content}
H3 |= element latexSE:subsubsection {attribute rolemaps-to {"H3"}, sechead.content}
H4 |= element latexSE:paragraph     {attribute rolemaps-to {"H4"}, sechead.content}
H5 |= element latexSE:subparagraph  {attribute rolemaps-to {"H5"}, sechead.content}

### new form

heading0 = element latexSE:part-heading          {pdf2-attributes, attribute rolemaps-to {"Div"}, sechead.content}
heading1 = element latexSE:section-heading       {pdf2-attributes, attribute rolemaps-to {"H1"}, sechead.content}
heading2 = element latexSE:subsection-heading    {pdf2-attributes, attribute rolemaps-to {"H2"}, sechead.content}
heading3 = element latexSE:subsubsection-heading {pdf2-attributes, attribute rolemaps-to {"H3"}, sechead.content}
heading4 = element latexSE:paragraph-heading     {pdf2-attributes, attribute rolemaps-to {"H4"}, sechead.content}
heading5 = element latexSE:subparagraph-heading  {pdf2-attributes, attribute rolemaps-to {"H5"}, sechead.content}
part = element latexSE:part                  {pdf2-attributes,attribute rolemaps-to {"Part"}, heading0,(bookchapter|section|Sect.content)*}
section = element latexSE:section            {pdf2-attributes,attribute rolemaps-to {"Sect"}, heading1,(subsection|Sect.content)*}
subsection = element latexSE:subsection      {pdf2-attributes,attribute rolemaps-to {"Sect"}, heading2,(subsubsection|Sect.content)*}
subsubsection = element latexSE:subsubection {pdf2-attributes,attribute rolemaps-to {"Sect"}, heading3,(paragraph|Sect.content)*}
paragraph = element latexSE:paragraph        {pdf2-attributes,attribute rolemaps-to {"Sect"}, heading4,(subparagraph|Sect.content)*}
subparagraph = element latexSE:subparagraph  {pdf2-attributes,attribute rolemaps-to {"Sect"}, heading5,(Sect.content)*}
Part |= part
Sect |= section

## LaTeX Book structure Namespace

### old form
H1 |= element latexSEbook:chapter   {attribute rolemaps-to {"H1"}, sechead.content}
H2 |= element latexSE:section       {attribute rolemaps-to {"H2"}, sechead.content}
H3 |= element latexSE:subsection    {attribute rolemaps-to {"H3"}, sechead.content}
H4 |= element latexSE:subsubsection {attribute rolemaps-to {"H4"}, sechead.content}
H5 |= element latexSE:paragraph     {attribute rolemaps-to {"H5"}, sechead.content}
H6 |= element latexSE:subparagraph  {attribute rolemaps-to {"H6"}, sechead.content}

### new form

bookheading1 = element latexSEbook:chapter-heading       {pdf2-attributes, attribute rolemaps-to {"H1"}, sechead.content}
bookheading2 = element latexSEbook:section-heading       {pdf2-attributes, attribute rolemaps-to {"H2"}, sechead.content}
bookheading3 = element latexSEbook:subsection-heading    {pdf2-attributes, attribute rolemaps-to {"H3"}, sechead.content}
bookheading4 = element latexSEbook:subsubsection-heading {pdf2-attributes, attribute rolemaps-to {"H4"}, sechead.content}
bookheading5 = element latexSEbook:paragraph-heading     {pdf2-attributes, attribute rolemaps-to {"H5"}, sechead.content}
bookheading6 = element latexSEbook:subparagraph-heading  {pdf2-attributes, attribute rolemaps-to {"H6"}, sechead.content}
bookchapter = element latexSEbook:chapter            {pdf2-attributes,attribute rolemaps-to {"Sect"}, bookheading1,(booksection|Sect.content)*}
booksection = element latexSE:section            {pdf2-attributes,attribute rolemaps-to {"Sect"}, bookheading2,(booksubsection|Sect.content)*}
booksubsection = element latexSE:subsection      {pdf2-attributes,attribute rolemaps-to {"Sect"}, bookheading3,(booksubsubsection|Sect.content)*}
booksubsubsection = element latexSE:subsubsection {pdf2-attributes,attribute rolemaps-to {"Sect"}, bookheading4,(bookparagraph|Sect.content)*}
bookparagraph = element latexSE:paragraph        {pdf2-attributes,attribute rolemaps-to {"Sect"}, bookheading5,(booksubparagraph|Sect.content)*}
booksubparagraph = element latexSE:subparagraph  {pdf2-attributes,attribute rolemaps-to {"Sect"}, bookheading6,(Sect.content)*}

Sect |= bookchapter


heading-number = element (latexSE:heading-number | latexSE:section-number) {
  attribute rolemaps-to {"Lbl"|"Span"},			
  pdf2-attributes,
  (text|NonStruct|Private|Note|Code|Sub|Em|Strong|Span|Quote|Link|Reference|Annot|Form|Ruby|Warichu|FENote|BibEntry|Figure|Formula|Artifact|
mathse)*
}

heading-fragment = element latexSE:heading-fragment {
  attribute rolemaps-to {"Span"},
pdf2-attributes,
(text|NonStruct|Private|Note|Code|Sub|Lbl|Em|Strong|Span|Quote|Link|Reference|Annot|Form|Ruby|Warichu|FENote|BibEntry|Figure|Formula|Artifact)*
}

heading-parbox = element (latexSE:heading-parbox|latexSE:heading-minipage) {
  attribute rolemaps-to {"Span"},
pdf2-attributes,
(text|NonStruct|Private|Note|Code|Sub|Lbl|Em|Strong|Span|Quote|Link|Reference|Annot|Form|Ruby|Warichu|FENote|BibEntry|Figure|Formula|Artifact)*
}

Lbl |= heading-number
Span |= heading-fragment|heading-parbox

# LaTeX NS

document.1 &= figures?
           & tables?
	   & title-block?

title-block = element latexSE:title-block {
  attribute rolemaps-to {"Div"},
   pdf2-attributes,
   ((title-text|h1|h1title-text)|title-author|title-date)*
 }

title-text = element latexSE:title-text {
  attribute rolemaps-to {"Title"|"P"},
   pdf2-attributes,
   (text|Span)*
 }

h1title-text = element latexH1:title-text {
  attribute rolemaps-to {"H1"},
   pdf2-attributes,
   (text|Span)*
 }

h1 = element html:h1 {
  attribute rolemaps-to {"Title"},
   pdf2-attributes,
   (text|Span)*
 }


h2 = element html:h2 {
  attribute rolemaps-to {"H1"},
   pdf2-attributes,
   sechead.content
 }

h1section-heading = element latexH1:section-heading {
  attribute rolemaps-to {"H2"},
   pdf2-attributes,
   sechead.content
 }

H1 |= h2
heading1 |= h2
heading1 |= h1section-heading

h3 = element html:h3 {
  attribute rolemaps-to {"H2"},
   pdf2-attributes,
   sechead.content
 }

h1subsection-heading = element latexH1:subsection-heading {
  attribute rolemaps-to {"H3"},
   pdf2-attributes,
   sechead.content
 }

H2 |= h3
heading2 |= h3
heading2 |= h1subsection-heading

title-author = element latexSE:title-author {
  attribute rolemaps-to {"P"},
   pdf2-attributes,
   (text|text-fragment|footnotemark|Link)*
 }
title-date = element latexSE:title-date {
  attribute rolemaps-to {"P"},
   pdf2-attributes,
   (text)
 }


figures = element latexSE:figures {
  attribute rolemaps-to {"Sect"},
  attribute id {text}?,
  showtags-attributes,
  float*
 }

tables = element latexSE:tables {
  attribute rolemaps-to {"Sect"},
  attribute id {text}?,
  showtags-attributes,
  float*
 }

float = element latexSE:float {
  attribute rolemaps-to {"Aside"|"Note"},
  attribute id {text}?,
  showtags-attributes,
  (text|Caption|Part|Div|Figure|\text|Formula)*
 }
Aside |= float


theorem-like = element latexSE:theorem-like {
  attribute rolemaps-to {"Sect"},
  attribute id {text}?,
  showtags-attributes,
  P?,Caption?,
  Lbl?,
  (Part|P)*
}
Sect |= theorem-like


text-unit = element (latexSE:text-unit | latexSE:semantic-para) {
  attribute rolemaps-to {"Part"},
  pdf2-attributes,
   (title|Title)?,Caption?,(H4|H5|Div|Sect|P|Aside|float|Figure|Table|Formula|quote|quotation|\text|itemize|description|enumerate|verbatim|\list|Part|FENote)*}
Part |= text-unit

verbatim = element latexSE:verbatim {
  attribute rolemaps-to {"P"|"Code"},
  pdf2-attributes,
  codeline*
}
P |= verbatim

codeline = element latexSE:codeline {
  attribute rolemaps-to {"Sub"|"Span"},
  pdf2-attributes,
  (text|Em|Formula|Lbl)*
}




\list = element latexSE:list {
 attribute rolemaps-to {"L"},
  pdf2-attributes,
  list-attributes,
  LI*
}
L |= \list

itemize = element latexSE:itemize {
  attribute rolemaps-to {"L"},
  pdf2-attributes,
  list-attributes,
  LI*
}
L |= itemize

enumerate = element latexSE:enumerate {
  attribute rolemaps-to {"L"},
  pdf2-attributes,
  list-attributes,
  LI*
}
L |= enumerate

quote = element latexSE:quote {
 attribute rolemaps-to {"BlockQuote"},
 pdf2-attributes,
 (Part|P)*
}

quotation = element latexSE:quotation {
 attribute rolemaps-to {"BlockQuote"},
 pdf2-attributes,
 (Part|Art|Div|Sect|TOC|BlockQuote|NonStruct|Private|P|Note|Code|Hn|Title|Lbl|Link|Reference|Annot|Form|FENote|Index|L|Table|Figure|Formula|Artifact)*
}

description= element latexSE:description {
 attribute rolemaps-to {"L"},
 pdf2-attributes,
 list-attributes,
 LI*
}

item = element latexSE:item {
  pdf2-attributes,
  attribute rolemaps-to {"LI"},
  (itemlabel?,itembody?)
}

LI |= item

itemlabel = element latexSE:itemlabel {
  pdf2-attributes,
  attribute rolemaps-to {"Lbl"},
  (text|text-unit|Formula|Em|Strong|Span|Link|\text)*
}

itembody = element latexSE:itembody {
  pdf2-attributes,
  attribute rolemaps-to {"LBody"},
  (H?&Caption?&
(text|Part|Art|Div|Sect|Aside|BlockQuote|NonStruct|Private|P|Note|Code|Hn|Sub|Em|Strong|Span|Quote|Link|Reference|Annot|Form|Ruby|Warichu|FENote|Index|L|BibEntry|Table|Figure|Formula|Artifact)*)
 }


LBody |= itembody


title = element latexSE:title {
 attribute rolemaps-to {"Title"},
 pdf2-attributes,
 (Span|\text)*
 }


\text = element (latexSE:text | latexSE:text-block) {
 attribute rolemaps-to {"P"},
 pdf2-attributes,
 (text|Figure|Span|Link|Lbl|Reference|Em|Strong|FENote|Formula|Ruby|Form|Code|Annot)*
}
P |= \text

text-fragment = element latexSE:text-fragment {
attribute rolemaps-to {"Span"},
pdf2-attributes,
(text|NonStruct|Private|Note|Code|Sub|Lbl|Em|Strong|Span|Quote|Link|Reference|Annot|Form|Ruby|Warichu|FENote|BibEntry|Figure|Formula|Artifact)*
}

Span |= text-fragment

footnotemark = element latexSE:footnotemark {
 attribute rolemaps-to {"Lbl"},
 pdf2-attributes,
(text|Link|Span)*
}
Lbl |= footnotemark

FENote |= element latexSE:footnote {
  attribute rolemaps-to {"FENote"|"Note"},
  pdf2-attributes,
  footnotelabel,(Part|\text)*
}

footnotelabel = element latexSE:footnotelabel {
 attribute rolemaps-to {"Lbl"},
 pdf2-attributes,
 (text|Span|NonStruct)*
}

text-minipage =  element (latexSE:text-minipage|latexSE:text-parbox) {
  attribute rolemaps-to {"Div"},
  pdf2-attributes,
(Document|DocumentFragment|Part|Art|Div|Sect|TOC|TOCI|Aside|BlockQuote|NonStruct|Private|P|Note|Code|Hn|H|Title|Sub|Lbl|Em|Strong|Span|Quote|Link|Reference|Annot|Form|Ruby|RB|RT|RP|Warichu|WT|WP|FENote|Index|L|LI|LBody|BibEntry|Table|TR|TH|TD|THead|TBody|TFoot|Caption|Figure|Formula|Artifact)*
}

Div |= text-minipage
