mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
btex: macrodef
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
|
||||
<chapter>Introduction</chapter>
|
||||
|
||||
<p><index id="btex language"/><btex/> is a markup language based on XML, with a resemblance of the <latex/>.
|
||||
<p><index id="btex language"/><btex/> (pronounced as /biːtɛk/) is a markup language based on XML, with a resemblance of the <latex/>.
|
||||
<btex/> abstracts away the meticulous styling and typesetting configurations, so you can focus on
|
||||
actually writing your texts than debugging the <latex/> macros. This does come with a downside of
|
||||
not being able to change the given style.</p>
|
||||
@@ -74,23 +74,23 @@
|
||||
<chapter>The Cover</chapter>
|
||||
|
||||
<p><index id="cover"/>The Cover defines the text on the cover of the book. If your text has no cover, this part can be omitted. Its syntax is as follows:</p>
|
||||
<callout align="left" class="code"><index id="cover (tag)"/><index id="title (tag)"/><index id="subtitle (tag)"/><index id="author (tag)"/><index id="edition (tag)"/><cover><br/>
|
||||
<title>Title of your book</title><br/>
|
||||
<subtitle>Subtitle if necessary</subtitle><br/>
|
||||
<author>Who wrote this book</author><br/>
|
||||
<edition>Edition information if necessary</edition><br/>
|
||||
<callout align="left" class="code"><index id="cover (tag)"/><index id="title (tag)"/><index id="subtitle (tag)"/><index id="author (tag)"/><index id="edition (tag)"/><cover hue="358"><br/>
|
||||
<title>Title of your book&zwsp;</title><br/>
|
||||
<subtitle>Subtitle if necessary&zwsp;</subtitle><br/>
|
||||
<author>Who wrote this book&zwsp;</author><br/>
|
||||
<edition>Edition information if necessary&zwsp;</edition><br/>
|
||||
</cover>
|
||||
</callout>
|
||||
<p>Only the <code>title</code> tag is mandatory. Cover texts will be printed using a special font that has wider
|
||||
gaps between characters. The title text will be printed in a double-size.</p>
|
||||
|
||||
<p>The cover can have different colour with the <code>hue</code> attribute, which takes a number between 0 and 360.</p>
|
||||
|
||||
<chapter>The Table of Contents</chapter>
|
||||
|
||||
<p><index id="table of contents"/>The contents of the Table of Contents is filled in automatically by reading through your manuscript;
|
||||
parts, chapters and sections will be added. Its syntax is as follows:</p>
|
||||
|
||||
<callout align="left" class="code"><index id="tocpage (tag)"/><tocpage title="Custom page name if necessary"><tableofcontents/></tocpage>
|
||||
<callout align="left" class="code"><index id="tocpage (tag)"/><tocpage title="Custom page name if necessary">&zwsp;<tableofcontents/>&zwsp;</tocpage>
|
||||
</callout>
|
||||
|
||||
<p>The optional <code>title</code> attribute allows a custom name can be given to this page.
|
||||
@@ -132,7 +132,7 @@
|
||||
<li><code>I</code> — use majuscule Roman numeral for the number (I, II, III, …)</li>
|
||||
<li><code>1</code> — use numbers (1, 2, 3)</li>
|
||||
</ul>
|
||||
<p>By default, parts use majuscule Roman numerals and others use just numbers.</p>
|
||||
<p>By default, parts use majuscule Roman numerals and others use just numbers. Alternative styling for the <code>part</code> and the <code>chapter</code> can be defined using the <a href="macro definition">Macro Definition</a>.</p>
|
||||
|
||||
|
||||
<section>Paragraph Styling</section>
|
||||
@@ -159,7 +159,7 @@
|
||||
<p><index id="index page"/>The contents of the Index Page is filled in automatically by reading through your manuscript.
|
||||
All the usage of <code>index</code> tags will be shown here. Its syntax is as follows:</p>
|
||||
|
||||
<callout align="left" class="code"><index id="indexpage (tag)"/><indexpage title="Custom page name if necessary"><tableofindices/></indexpage>
|
||||
<callout align="left" class="code"><index id="indexpage (tag)"/><indexpage title="Custom page name if necessary">&zwsp;<tableofindices/>&zwsp;</indexpage>
|
||||
</callout>
|
||||
|
||||
<p>The optional <code>title</code> attribute allows a custom name can be given to this page. If unspecified,
|
||||
|
||||
176
assets/mods/basegame/books/btex_ko.xml
Normal file
176
assets/mods/basegame/books/btex_ko.xml
Normal file
@@ -0,0 +1,176 @@
|
||||
<!DOCTYPE btexdoc SYSTEM "btexdoc.dtd">
|
||||
<btexdoc cover="hardcover" inner="standard" papersize="standard">
|
||||
<macrodef>
|
||||
<pair key="thepart" value="제%1$s부"/>
|
||||
<pair key="thechapter" value="%1$s장"/>
|
||||
</macrodef>
|
||||
<cover>
|
||||
<title>문자를 모아 책을 찍어내어 엮는 머나먼 여정으로의 소개</title>
|
||||
<subtitle>책 쓰고 찍어내는 법</subtitle>
|
||||
<author>Terran Publishing</author>
|
||||
<edition>시험판</edition>
|
||||
</cover>
|
||||
|
||||
<tocpage title="목차"><tableofcontents/></tocpage>
|
||||
|
||||
<manuscript>
|
||||
<part type="1">책</part>
|
||||
|
||||
<chapter>책이란 무엇인가</chapter>
|
||||
|
||||
<p>본 견본은 책 조판 언어의 예시를 위해 제작되었다.</p>
|
||||
|
||||
<section hide="1">책이란 정말 무엇인가</section>
|
||||
|
||||
<p><index id="책"/>책 조판 시스템에서 책이란 페이지 번호와 그림과 <a href="하이퍼링크">하이퍼링크</a>와 같은 요소를 포함하여 가독성 좋게 편집된 글의 뭉치를 말한다.</p>
|
||||
<p>책은 ‘엮인’ 글로 취급되어 두 페이지가 한번에 보여진다.</p>
|
||||
|
||||
<chapter>타자기를 사용한 집필</chapter>
|
||||
|
||||
<p><index id="타자기"/>타자기는 글 쓰기의 시작을 빠르고 편리하게 해 준다. 타자기를 클릭하면 바로 작성이 가능하다.</p>
|
||||
<p>하지만 타자기를 사용할 때는 여러 문자 사용 불가, 사진 첨부 불가, 하이퍼링크 사용 불가, 너덜너덜해 못생긴 문단과 같은 크나큰 단점이 따라온다.</p>
|
||||
<p>타자기로 찍은 문서는 ‘엮이지 않은’ 글로 취급되어 한번에 한 페이지만 보여진다.</p>
|
||||
<p>위와 같은 이유로 타자기로는 책다운 책을 만들 수 없다.</p>
|
||||
|
||||
<chapter>출판사와 인쇄소를 이용한 집필</chapter>
|
||||
|
||||
<p>출판사를 통하면 진짜배기 책의 모든 장점을 담은 책다운 책을 고작 한 권도 아닌 여러 권을 원하는 만큼 찍어낼 수 있다.</p>
|
||||
<p>책을 인쇄하려면 원고를 출판사로 보내야 한다. 책을 찍어내기 위한 원고는 <btex/>이라는 특수한 언어로 작성되어야 한다.</p>
|
||||
<p><btex/>을 통하며 책 전체의 생김새를 간단히 기술할 수 있다. 사용할 수 있는 스타일은 조판 시스템이 지원하는 범위 안에서 제약이 없다. 타자기로 찍어낸 듯한 글도 원한다면 얼마든지 인쇄되도록 할 수 있다.</p>
|
||||
|
||||
|
||||
<part type="1"><btex/></part>
|
||||
|
||||
<chapter>소개</chapter>
|
||||
|
||||
<p><index id="btex 언어"/><btex/>(발음: [비ː텍])은 <latex/>과 유사하게 설계된 XML 기반의 마크업 언어이다.
|
||||
<btex/>은 세세한 스타일 정의문과 조판 설정을 추상화하여, 글을 쓰면서 <latex/> 매크로를 디버깅하는 등의 일 없이 글쓰기에 집중할 수 있도록 설계되었다. 다만 이러한 이유로 미리 정의된 스타일을 뜯어고치는 것은 어렵다.</p>
|
||||
<p><btex/> 문서는 다음의 다섯 부분으로 나뉘어진다. <a href="btexdoc">스타일 정의문</a>,
|
||||
<a href="표지 정의문">표지 정의문</a>, <a href="목차 정의문">목차 정의문</a>, <a href="원고">원고</a>, <a href="색인 페이지">색인 페이지</a>. 이 중 스타일 정의문과 원고는 필수로 존재하여야 하는 부분이다.</p>
|
||||
|
||||
|
||||
<chapter>스타일 정의문</chapter>
|
||||
|
||||
<p><index id="btexdoc"/>스타일 정의문은 <btex/> 문서의 가장 첫 부분이다. 스타일 정의문의 구조는 다음과 같다.</p>
|
||||
|
||||
<callout align="left" class="code"><index id="btexdoc (태그)"/><btexdoc cover="hardcover" inner="standard" papersize="standard">
|
||||
</callout>
|
||||
|
||||
<p><code>btexdoc</code> 태그는 다음의 속성을 지원한다.</p>
|
||||
<ul>
|
||||
<li><code>cover</code> — 표지의 스타일을 지정함. 지원하는 값: <code>hardcover</code>, <code>none</code></li>
|
||||
<li><code>inner</code> — 내용의 스타일을 지정함. 지원하는 값: <code>standard</code>, <code>typewriter</code></li>
|
||||
<li><code>papersize</code> — 판형을 지정함. 지원하는 값: <code>standard</code></li>
|
||||
</ul>
|
||||
|
||||
<chapter>표지 정의문</chapter>
|
||||
|
||||
<p><index id="표지 정의문"/><code>cover</code> 태그는 책의 표지를 지정한다. 표지가 없는 책이라면 이 부분은 생략 가능하다. 표지 정의문의 구조는 다음과 같다.</p>
|
||||
<callout align="left" class="code"><index id="cover (태그)"/><index id="title (태그)"/><index id="subtitle (태그)"/><index id="author (태그)"/><index id="edition (태그)"/><cover hue="358"><br/>
|
||||
<title>책 제목&zwsp;</title><br/>
|
||||
<subtitle>필요한 경우 부제목&zwsp;</subtitle><br/>
|
||||
<author>누가 이 책을 집필하였는가&zwsp;</author><br/>
|
||||
<edition>필요한 경우 판본 정보&zwsp;</edition><br/>
|
||||
</cover>
|
||||
</callout>
|
||||
<p>이 중 <code>title</code> 태그만이 필수 태그이다. 표지의 문구는 글자간 간격이 넓게 인쇄된다. 책 제목은 두배 큰 크기로 인쇄된다.</p>
|
||||
<p>표지의 색깔은 <code>hue</code> 속성을 사용해 바꿀 수 있다. 0에서 360 사이의 숫자를 사용할 수 있다.</p>
|
||||
|
||||
|
||||
<chapter>목차 정의문</chapter>
|
||||
|
||||
<p><index id="목차 정의문"/>목차 페이지의 내용은 원고를 읽어 자동으로 채워진다. 목차 정의문의 구조는 다음과 같다.</p>
|
||||
|
||||
<callout align="left" class="code"><index id="tocpage (태그)"/><tocpage title="목차 혹은 필요한 다른 제목">&zwsp;<tableofcontents/>&zwsp;</tocpage>
|
||||
</callout>
|
||||
|
||||
<p><code>title</code> 속성은 목차 페이지의 장제목을 지정한다. 지정하지 않았으면 “Table of Contents”가 인자된다.</p>
|
||||
<p><code><tableofcontents/></code> 태그는 조판 시스템이 내부적으로 사용하는 태그이다.</p>
|
||||
|
||||
|
||||
<chapter>원고</chapter>
|
||||
|
||||
<p><index id="원고"/><index id="태그 목록"/>원고는 실제 책의 본문이 담긴 부분을 말한다. 본문에는 다음의 태그를 사용할 수 있다.</p>
|
||||
<ul>
|
||||
<li><index id="part (태그)"/><code>part</code> — inserts part separation page to your book</li>
|
||||
<li><index id="chapter (태그)"/><index id="section (태그)"/><code>chapter</code>, <code>section</code> — inserts a new chapter/section. If an alternative name is required on the Table of Contents, the <code>alt</code> attribute can be used. If the chapter/section needs to be hidden on the Table of Contents, add the <code>hide="1"</code> attribute. If the chapter must start on a new page, simply add <code>newpage</code> in front of the chapter tag</li>
|
||||
<li><index id="p (태그)"/><code>p</code> — inserts a new paragraph. The body texts must be written inside this tag. All paragraphs will have a 16-pixel indentation, with the following exceptions: first <code>p</code> of the part/chapter/section; first <code>p</code> after <code>br</code>, <code>newpage</code>, <code>callout</code>, <code>ul</code>, <code>ol</code> or <code>anonbreak</code></li>
|
||||
<li><index id="span (태그)"/><code>span</code> — allows changing the colour of the texts. The colour must be specified in the <code>colour</code> attribute. Six-digit hex code, three-digit hex code and CSS Colors Level 4 named colours are supported. Note that all the colours will be rounded to the nearest three-digit hex code</li>
|
||||
<li><index id="emph (태그)"/><code>emph</code> — is a special case of the <code>span</code> tag. The resulting text will be <emph>red</emph></li>
|
||||
<li><index id="itemname (태그)"/><code>itemname</code> — is a special case of the <code>span</code> tag used to highlight the name of the ingame item. The resulting text will be <itemname>blue</itemname></li>
|
||||
<li><index id="targetname (태그)"/><code>targetname</code> — is a special case of the <code>span</code> tag used to highlight the name of an arbitrary target or goals. The resulting text will be <targetname>green</targetname></li>
|
||||
<li><index id="code (태그)"/><code>code</code> — is a special case of the <code>span</code> tag used to highlight the code element in-line. The resulting text will be <code>surrounded in a grey box</code></li>
|
||||
<li><index id="br (태그)"/><code>br</code> — self-closing tag; inserts an anonymous line break</li>
|
||||
<li><index id="newpage (태그)"/><code>newpage</code> — self-closing tag; inserts an anonymous page break</li>
|
||||
<li><index id="anonbreak (태그)"/><code>anonbreak</code> — self-closing tag; inserts a paragraph break in the text. The break will be in a form of a long straight line on the centre of the text. Useful for typesetting novels</li>
|
||||
<li><index id="callout (태그)"/><code>callout</code> — is a paragraph box that holds a text in a grey box, a style similar to the <code>code</code> tag</li>
|
||||
<li><index id="ul (태그)"/><index id="li (태그)"/><code>ul</code> — starts an unordered list. List elements are defined using the <code>li</code> tag</li>
|
||||
<li><index id="ol (태그)"/><code>ol</code> — starts an ordered list. List elements are defined using the <code>li</code> tag</li>
|
||||
<li><index id="fullpagebox (태그)"/><code>fullpagebox</code> — is used to typeset its child tags into a box that fills an entire page, with its contents centred on the page. Must be used after the <code>newpage</code></li>
|
||||
<li><index id="btex (태그)"/><code>btex</code> — self-closing tag; inserts an inline form of the <btex/> logo in the text</li>
|
||||
</ul>
|
||||
<p>스스로 닫는 태그는 하위 내용을 담을 수 없다. 스스로 닫는 태그는, 예를 들어 tagname이라는 태그가 있으면, 다음과 같이 쓴다. <code><tagname/></code>.</p>
|
||||
|
||||
|
||||
<section>장절제목 스타일</section>
|
||||
|
||||
<p>부와 장과 절은 <code>type</code> 속성을 사용해 번호가 찍히는 스타일을 지정할 수 있다. 지원하는 스타일은 다음과 같다.</p>
|
||||
<ul>
|
||||
<li><code>a</code> — 번호로 알파벳을 사용함 (a, b, c, …)</li>
|
||||
<li><code>A</code> — 번호로 알파벳 대문자를 사용함 (A, B, C, …)</li>
|
||||
<li><code>i</code> — 번호로 로마 숫자를 사용함 (i, ii, iii, …)</li>
|
||||
<li><code>I</code> — 번호로 로마 숫자 대문자를 사용함 (I, II, III, …)</li>
|
||||
<li><code>1</code> — 번호를 사용함 (1, 2, 3)</li>
|
||||
</ul>
|
||||
<p>기본값은, 부는 로마 숫자 대문자, 장과 절은 그냥 번호를 사용한다. “Part I”로 찍히는 것을 “제1절”로 변경하는 등의 심화된 스타일은 <a href="macro definition">매크로 정의문</a>에서 정의할 수 있다.</p>
|
||||
|
||||
|
||||
<section>문단 스타일</section>
|
||||
|
||||
<p><code>p</code>와 <code>callout</code> 태그는 <code>align</code> 속성을 지원한다. 지원하는 스타일은 다음과 같다.</p>
|
||||
<ul>
|
||||
<li><code>left</code> — 문단을 좌측정렬함</li>
|
||||
<li><code>justify</code> — 문단을 양끝정렬함. 기본값</li>
|
||||
</ul>
|
||||
<p><code>p</code>, <code>span</code>, <code>callout</code> 태그는 추가로 <code>class="code"</code> 속성을 지원한다. 이 속성이 적용된 문구는 <code>코드꼴(code font)</code>을 사용해 인자된다.</p>
|
||||
|
||||
|
||||
<section>하이퍼링크</section>
|
||||
|
||||
<p><index id="하이퍼링크"/>하이퍼링크는<code>index</code>와 <code>a</code> 태그를 사용해 적용할 수 있다.</p>
|
||||
<ul>
|
||||
<li><index id="index (태그)"/><code>index</code> — 링크의 목적지를 정의함. 링크의 이름은 문서 전체에서 유일하여야 하며, <code>id</code> 속성에 작성함</li>
|
||||
<li><index id="a (태그)"/><code>a</code> — 태그 내부의 문구를 클릭 가능하게 함. 링크의 목적지는 (index 태그의 id) <code>href</code> 속성에 작성함</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<chapter>색인 페이지</chapter>
|
||||
|
||||
<p><index id="색인 페이지"/>색인 페이지의 내용은 원고를 읽어 자동으로 채워진다.
|
||||
문서에 사용된 모든 <code>index</code> 태그가 이 페이지에 인쇄된다. 색인 페이지의 구조는 다음과 같다.</p>
|
||||
|
||||
<callout align="left" class="code"><index id="indexpage (태그)"/><indexpage title="색인 혹은 필요한 다른 제목">&zwsp;<tableofindices/>&zwsp;</indexpage>
|
||||
</callout>
|
||||
|
||||
<p><code>title</code> 속성은 색인 페이지의 장제목을 지정한다. 지정하지 않았으면 “Index”가 인자된다.</p>
|
||||
|
||||
|
||||
<chapter>문서 끝맺기</chapter>
|
||||
|
||||
<p><btex/> 문서는 <code>btexdoc</code> 태그로 시작되었으니, 반드시 같은 태그로 끝나야 한다. <code></btexdoc></code>을 써 넣어 문서를 마무리하자.</p>
|
||||
|
||||
|
||||
<chapter>마무리</chapter>
|
||||
|
||||
<p><btex/>으로 작성된 최종 원고는 출판사에 도착한 후 인쇄가 시작된다. 원고에 오류가 없다면 주문한 부수대로 책이 인쇄되어 합리적인 영업일 내에 우편으로 배송된다. 즐거운 글쓰기가 되길!</p>
|
||||
|
||||
<newpage/>
|
||||
|
||||
<fullpagebox>
|
||||
<p><span colour="#666">이 페이지는 의도적으로 비워 두었습니다</span></p>
|
||||
</fullpagebox>
|
||||
|
||||
</manuscript>
|
||||
|
||||
<indexpage title="색인"><tableofindices/></indexpage>
|
||||
</btexdoc>
|
||||
@@ -1,5 +1,6 @@
|
||||
<!ENTITY nbsp " ">
|
||||
<!ENTITY money "¤">
|
||||
<!ENTITY zwsp "​">
|
||||
|
||||
<!ENTITY % ULStyle "(disc|square|circle)">
|
||||
<!ENTITY % Number "CDATA">
|
||||
@@ -53,16 +54,17 @@
|
||||
<!ENTITY % block "p | %heading; | %lists; | %blocktext;">
|
||||
<!ENTITY % Flow "(#PCDATA | %block; | %inline;)*">
|
||||
|
||||
<!ELEMENT btexdoc (cover?,tocpage?,manuscript,indexpage?)>
|
||||
<!ELEMENT btexdoc (macrodef?,cover?,tocpage?,manuscript,indexpage?)>
|
||||
<!ATTLIST btexdoc
|
||||
%BTeXcover;
|
||||
%BTeXinner;
|
||||
%BTeXpapersize;
|
||||
%BTeXdefs;
|
||||
>
|
||||
<!ELEMENT macrodef (pair)*>
|
||||
|
||||
<!-- COVER tag specification -->
|
||||
<!ELEMENT cover (title?, subtitle?, author?, edition?)>
|
||||
<!ELEMENT cover (title?,subtitle?,author?,edition?)>
|
||||
<!ELEMENT title %Inline.meta;>
|
||||
<!ELEMENT subtitle %Inline.meta;>
|
||||
<!ELEMENT author %Inline.meta;>
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.xml.sax.helpers.DefaultHandler
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
import java.io.StringReader
|
||||
import java.util.regex.Pattern
|
||||
import javax.xml.parsers.SAXParserFactory
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.reflect.KFunction
|
||||
@@ -137,6 +138,17 @@ object BTeXParser {
|
||||
|
||||
private val bodyTextShadowAlpha = 0.36f
|
||||
|
||||
private val macrodefs = hashMapOf(
|
||||
"thepart" to "Part %1\$s",
|
||||
"thechapter" to "%1\$s"
|
||||
)
|
||||
|
||||
private fun invokeMacro(name: String, vararg args: String): String {
|
||||
val name = name.lowercase()
|
||||
val template = macrodefs[name] ?: throw IllegalArgumentException("No macro '$name' exists")
|
||||
return String.format(template, *args)
|
||||
}
|
||||
|
||||
|
||||
private fun Int.toListNumStr(style: String) = when (style) {
|
||||
"I" -> this.toRomanNum()
|
||||
@@ -675,11 +687,16 @@ object BTeXParser {
|
||||
|
||||
@OpenTag // reflective access is impossible with 'private'
|
||||
fun processElemPAIR(handler: BTeXHandler, doc: BTeXDocument, uri: String, attribs: HashMap<String, String>) {
|
||||
if (tagStack.size == 3 && tagStack.getOrNull(1) == "blocklut") {
|
||||
if (tagStack.size == 3 && tagStack.getOrNull(1) == "BLOCKLUT") {
|
||||
blockLut[attribs["key"]!!] = attribs["value"]!!
|
||||
}
|
||||
else if (tagStack.size == 3 && tagStack.getOrNull(1) == "MACRODEF") {
|
||||
val key = attribs["key"]!!
|
||||
val value = attribs["value"]!!
|
||||
macrodefs[key.lowercase()] = value
|
||||
}
|
||||
else {
|
||||
throw BTeXParsingException("<pair> used outside of <blocklut>")
|
||||
throw BTeXParsingException("<pair> used outside of <blocklut> or <macrodef>")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -873,10 +890,11 @@ object BTeXParser {
|
||||
val heading = if (part == null && cpt == null && sect == null)
|
||||
""
|
||||
else if (part != null && cpt == null && sect == null)
|
||||
"Part $part${glueToString(HEADING_NUM_TITLE_GAP)}"
|
||||
"${invokeMacro("thepart", part)}${glueToString(HEADING_NUM_TITLE_GAP)}"
|
||||
else if (cpt != null && sect == null)
|
||||
"${invokeMacro("thechapter", cpt)}${glueToString(HEADING_NUM_TITLE_GAP)}"
|
||||
else
|
||||
listOfNotNull(cpt, sect).joinToString(".") + "${glueToString(HEADING_NUM_TITLE_GAP)}" +
|
||||
(if (cpt != null && cpt.length < 2 && cpt.isNum()) "${glueToString(HEADING_NUM_TITLE_GAP)}" else "")
|
||||
"$cpt.$sect${glueToString(HEADING_NUM_TITLE_GAP)}"
|
||||
|
||||
typesetTOCline("$heading", name, pg, handler, indent, tocPage)
|
||||
}
|
||||
@@ -1103,7 +1121,7 @@ object BTeXParser {
|
||||
val cptSectInfo = cptSectStack.removeLast()
|
||||
val partNumStr = partOrder.toListNumStr(cptSectInfo.style)
|
||||
|
||||
typesetPartHeading(partNumStr, thePar, handler)
|
||||
typesetPartHeading(invokeMacro("thepart", partNumStr), thePar, handler)
|
||||
if (!cptSectInfo.type.endsWith("-hidden"))
|
||||
cptSectMap.add(CptSectInfo("part", cptSectInfo.alt ?: thePar, doc.currentPage, partNumStr, null, null))
|
||||
|
||||
@@ -1123,7 +1141,7 @@ object BTeXParser {
|
||||
val partNumStr = partOrder.toListNumStr(cptSectStack.findLast { it.type.startsWith("part") }?.type ?: "1")
|
||||
val cptNumStr = cptOrder.toListNumStr(cptSectInfo.style)
|
||||
|
||||
typesetChapterHeading(cptNumStr, thePar, handler, 16)
|
||||
typesetChapterHeading(invokeMacro("thechapter", cptNumStr), thePar, handler, 16)
|
||||
if (!cptSectInfo.type.endsWith("-hidden"))
|
||||
cptSectMap.add(CptSectInfo("chapter", cptSectInfo.alt ?: thePar, doc.currentPage, partNumStr, cptNumStr, null))
|
||||
|
||||
@@ -1241,7 +1259,7 @@ object BTeXParser {
|
||||
}
|
||||
|
||||
private fun typesetPartHeading(num: String, thePar: String, handler: BTeXHandler, indent: Int = PAR_INDENTATION, width: Int = doc.textWidth) {
|
||||
typesetParagraphs("${ccDefault}⁃ Part $num ⁃", handler, align = "left")
|
||||
typesetParagraphs("${ccDefault}⁃ $num ⁃", handler, align = "left")
|
||||
typesetParagraphs(" ", handler, align = "left")
|
||||
// typesetParagraphs(getTitleFont(), "$ccDefault$thePar", handler)
|
||||
typesetParagraphs(getSubtitleFont(), "$ccDefault$thePar", handler, align = "left")
|
||||
|
||||
@@ -26,7 +26,7 @@ import kotlin.system.measureTimeMillis
|
||||
*/
|
||||
class BTeXTest : ApplicationAdapter() {
|
||||
|
||||
val filePath = "btex.xml"
|
||||
val filePath = "btex_ko.xml"
|
||||
// val filePath = "test.xml"
|
||||
// val filePath = "literature/en/daniel_defoe_robinson_crusoe.xml"
|
||||
// val filePath = "literature/ruRU/anton_chekhov_palata_no_6.xml"
|
||||
|
||||
Reference in New Issue
Block a user