Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.text.misc > #113
| From | ram@zedat.fu-berlin.de (Stefan Ram) |
|---|---|
| Newsgroups | de.comp.text.misc |
| Subject | Textformatierer |
| Date | 2026-02-01 16:45 +0000 |
| Organization | Stefan Ram |
| Message-ID | <Formatierer-20260201172958@ram.dialup.fu-berlin.de> (permalink) |
Heute habe ich nun den Kern eines Textformatierers fertiggestellt,
also eines Programm wie RUNOFF.
Hier ein Beispieleingabe:
< ¶graphs
< &par
< &segment [We often remind ourselves of the good ship Vasa. ]
[It was to be the pride of the Swedish navy and was built to ]
[be the biggest and most beautiful battleship ever. ]
[Unfortunately, to accommodate enough statues and guns it ]
[underwent major redesigns and extension during construction. ]
[The result was that it only made it half way across Stockholm ]
[harbor before a gust of wind blew it over and it sank killing ]
[about 50 people.] >
>
>
. Der Text wurde nur für dieses Posting manuell auf mehrere
Zeilen aufgeteilt und ist in Wirklichkeit eine lange Zeile
(von "We" bis "people.").
Das syntaktische Grundgerüst besteht aus einer Folge von Absätzen,
oben ist es ein einzelner Absatz.
Das Programm erzeugt aus dieser Eingabe:
We often remind ourselves of the good ship Vasa. It was to be the
pride of the Swedish navy and was built to be the biggest and most
beautiful battleship ever. Unfortunately, to accommodate enough stat-
ues and guns it underwent major redesigns and extension during con-
struction. The result was that it only made it half way across Stock-
holm harbor before a gust of wind blew it over and it sank killing
about 50 people.
. Der Text wurde also neu umbrochen.
Derzeit gibt es noch keine weiteren Kommandos, aber immerhin
wird der Absatz schon mit globaler Optimierung und automatischer
Worttrennung umbrochen.
Relativ bald werde ich zu den einzelnen Absätzen Kommandos zur
Festlegung der Sprache (Englisch oder Deutsch) von Textteilen und
der Einrückung und Breite (Form, parshape) von Absätzen hinzufügen.
Während meine obige Eingabesprache XML-ähnlich ist, soll es später
auch eine Markdown-ähnliche Eingabemöglichkeit geben, in der die
vielen eckigen Klammern entfallen würden.
Die nächste größere Hürde des Projektes ist die Implementation
einfacher Formeln. Ich stelle mir vor, daß man beispielsweise
2
x^2 schreiben kann, und dann daraus etwas wie x wird. Allerdings
sehen Exponenten mit Lücken in Absätzen - wie hier zu sehen -
nicht gut aus, so daß es auch die Möglichkeit geben sollte,
Potenzen in der Schreibweise wie "x^2" einzeilig auszugeben.
Das Programm wird bis auf weiteres nur intern von mir verwendet.
Ein spätere Veröffentlichung ist geplant, aber derzeit muß das
Programm erst einmal weiter aufgebaut werden.
Back to de.comp.text.misc | Previous | Next | Find similar
Textformatierer ram@zedat.fu-berlin.de (Stefan Ram) - 2026-02-01 16:45 +0000
csiph-web