SGML vs (La)TeX

Giorgos Keramidas keramida at ceid.upatras.gr
Wed Jul 24 13:47:01 EEST 2002


On 2002-07-23 01:36 +0000, V13 wrote:
> xrisimopoio to latex kai blepo oti h sgml exei arketa megali sxesi
> me ayto...

Einai kai ta duo "markup" ergaleia.  An xrhsimopoieis to TeX san
markup ergaleio ki oxi san font/style editor, tote h SGML einai mias
meras diabasma gia na matheis na tin xrhsimopoieis (eite me kapoio
etoimo Document Type Description, eite me entelos diko sou DTD).

An mexri tora ta macros pou ftiaxneis / xrhsimopoieis sto TeX den
einai ths morfhs:

	\def\boldtext{{\bd ...}}

alla einai "markup apo logika tmhmata tou keimenou" opws:

	\def\chaptertitle
	\def\documenttitle klp.

h metabash apo to markup pou einai me tetoio styl:

	\chaptertitle Foo.

sto stul ths SGML

	<chapter>
	  <title>...</title>

den einai tipota.

> par'ola ayta den exoy doylepsei me SGML pote, alla nomizo oti
> linei/metatopizei to basikotero 'problima' toy latex gia toys
> ellines xoris kopo...

Gia thn akribeia to "prosperna".  Mporeis na dhloseis oti ena tag exei
th dunatothta na periexei "CDATA" (character data) kai na agnohseis to
olo thema me ta character sets kai sunafh "terata".

Definitions:

	SGML tag
		To basiko markup antikeimeno ths SGML.
		Paradeigma:	<title> , </title>

	SGML element
		Kati pou apoteleitai apo ena "start tag", apo
		periexomena tou "element", kai apo ena "end tag".
		Paradeigma:      <title>Prasina korakia</title>

Einai problhma tou DSSSL stylesheet sou kai twn ergaleiwn pou tha
xrhsimopoihseis to pws apo ta SGML elements tou stul

	<chapter>
	  <title>Prasina korakia</title>

	  <para>Ta xrwmata den exoun shmasia&hellip;</para>
	</chapter>

tha katalhkseis se ena sugkekrimeno "formatted" output, opws gia
paradeigma to:

	.SH "Prasina korakia"
	.LP
	Ta xrwmata den exoun shmasia\&.&.\&.

h akoma kai sto:

	<html>
	<head>
	<title>Prasina korakia...</title>
	</head>
	<body>
	<h1>Prasina korakia...</h1>
	<p>Ta xrwmata den exoun shmasia...</p>
	</body>
	</html>

> anyway.. exei kaneis na pei kati endiaferon pano se ayth ti
> sygkrisi? (esto kai me private mail) Me endiaferei arketa to thema.

Den einai polu duskolo na ftiajeis ena sxetika periploko kai arketa
eksezhthmeno "framework" me ergaleia opws to jade, pou tha sou dinei
th dunatothta na metatrepseis keimena apo SGML se oti format theleis.
To pio periergo kommati den einai to pws tha grapseis SGML, alla to
pws xrhsimopoiwntas to diko sou DSSSL stylesheet tha metatrepseis ta
SGML elements se kati pou na exei nohma gia to diko sou "formatting"
ergaleio, to opoio mporei aneta na einai to TeX, to troff, to Lyx, to
StarOffice, h oti allo thes.

Exei kapoia meionekthmata omws h SGML, pou den niotho 100% sigouros
oti mporoun eukola na jeperastoun xoris na xalaseis auto to "logical
markup" pragma pou einai to kalutero xarakthristiko ths gia mena.
Otan kaneis logical markup den kaneis "selidopoihsh".  Opote den einai
eukolo na oriseis se SGML pragmata opws:

	+ Auto pou blepeis edo paei sto pano aristera meros ths
	  selidas, ki oxi mesa sto sunexes keimeno tou bibliou
	  (page layout control).

	+ Epeidh auto einai listing apo kwdika, mporeis se "auto" to
	  shmeio an thes na kopseis thn selida kai na pas sthn epomenh
	  an deis oti me th roh pou exei to keimeno tha ksemeinei sto
	  pano meros ths epomenhs selidas mia grammh kwdika monh ths
	  (orphan & widow line control).

Ola auta mporeis na ta kaneis, peirazontas to DSSSL stylesheet sou,
alla h SGML den tha exei pragmatika kamia idea gia to ti "apatewnies"
kaneis me ta elements pou sou passarei gia na morfopoihseis.  An
arxiseis na bazeis sthn SGML sou entities, tags & elements opws
(prosoxh sta &allow.*; entities parakato):

	<programlisting>
	/*
	 * $FreeBSD: $
	 */
	&allow.pagebreak;
	#include <stdio.h>
	&allow.pagebreak;
	int
	main(void) {
	...
	}</programlisting>

pleon den kaneis "logical markup" kai exeis katebasei to epipedo ths
SGML sxedon sto idio shmeio pou einai kai to TeX otan to xrhsimopoieis
san "text beautifier" anti gia document markup ergaleio.

Autaaa,

- Giorgos




More information about the Linux-greek-users mailing list