Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am corresponding with a mathematician colleague who typesets his documents in what is apparently quite old software called "The Publisher". It creates an array of LaTeX related files as part of the publication process including a .tex file. However the grammar of these files is nothing like contemporary .tex grammar, so it won't compile with TeXLive, nor is Lyx able to parse it.

I cannot find information on this software anywhere. I am enclosing some sample text from it with redacted contents in case the grammar looks familiar to anyone? Can these files be converted to Lyx or modern TeX?

\Para[\ParaType{B}]\tyxtstxit[]Remark\tyxtstxendit[] 1. The preceding
approach [redacted] \newlinetag[]
\Endpara[]

While an equation looks like:

\InlEqn[]\LmthEqn[]
\Gamma _{0} [redacted]
\LmthEndeqn[]\EndInlEqn[]

Update:

I was provided with an old utility called "pub2latex" which still worked in Linux, provided the .pub doc was exported as an .sgml file. The conversion is not to straight LaTeX though but to some combination of LaTeX and XML. A sample is here:

<topic>\subsection{Purposes}
\par
The object of interest [redacted]
<inline-equation>
<f>
Y</f>
</inline-equation> with piecewise smooth boundary <inline-equation>
<f>
<g>6</g>Y</f>
</inline-equation> of class <inline-equation>
<f>
C<sup>1</sup></f>
</inline-equation> in three dimensional space <inline-equation>
<f>
<blkbd>R</blkbd><sup>3</sup></f>
</inline-equation>.

I am wondering if anyone has seen a TeX / XML combination like this so that this document could now be parsed and converted?

Additional historical info: The Publisher runs on Sun Sparc workstations. Perhaps it was the only TeX client to operate on a Sparc?

share|improve this question
3  
My guess is that is an old format, not one of the 'big three' (plain, LaTeX, ConTeXt). Presumably your colleague has more detail of this, if he is still using the software. It might be best to ask him for as much information as possible. –  Joseph Wright Jun 25 '13 at 11:30
1  
Wow... the program dates to at least 1988. Here's a website from UBC in 1994 describing their local licensed copy: astro.ubc.ca/resources/Computing/WordProc/publisher.html –  Willie Wong Jun 25 '13 at 13:05
1  
Lastly, this seems to be the basic help file for the program written in its own markup language. The last paragraph states "ArborText was founded in 1982 by David L. Rodgers, James J. Sterken, and Paul B. Grosso." The syntax looks to be something similar to XML; presumably it is not too hard to write a PanDoc parser to convert the mark-up to LaTeX or HTML + MathJax. –  Willie Wong Jun 25 '13 at 13:15
6  
arbortext (an early commercial venture -- 1980s -- based in ann arbor, michigan) developed a product called "the publisher" using tex as the underlying engine. also in the 1980s, advent publishing (in the uk) developed an application called 3b2. through a number of mergers and other convolutions, these are now combined under a much-transmogrified arbortext label. check out this wikipedia article for more details. as far as conversion to (la)tex goes, i have no useful information –  barbara beeton Jun 25 '13 at 13:15
3  
We have several old documents written using The Publisher, or just Publisher. After converting the .pub files to sqml, it is doable to convert it into usable LaTeX. I was given a sgml to latex tool, that seemed to fail in many cases so I ended up writing a series of Perl scripts, that ends up giving reasonable results. The result will need a lot of manual editing though. –  daleif Jun 26 '13 at 11:10

1 Answer 1

up vote 10 down vote accepted

Given its age, The Publisher is actually a quite impressive programme.

Ok, Here is a write up of our experiences. First I'll present our experiences dealing with the described procedure from the Publisher manual. And then I'll write a bit about what I've ended up doing.

I got a description from one of our main Publisher users. He ha just retired and is working on converting some of his important things into LaTeX, for later generations to use.

In his description one needed

publisher (the program)
sgmlmap   (a programme)
atoutput.tex
attable.tex
booklat.mac
booklat.def (with our own additions)

We will ignore the two .tex files as they just provide some default macros the .sgml was mapped onto. We changed most of those via booklat.def.

There are several cleanup things one can do from within publisher, but since I'm going to go through the LaTeX code afterwards by hand, I ended up with just two required commanded to be executed from with in publisher:

  • source grkmap
  • sgmrek

This converts the .pub into .sgml, in the process it converts the greek letters into some codes handable for later.

In theory one should now be able to convert to LaTeX via

sgmlmap -sgml file.sgml -def booklat

In practice there is some of caveats:

  • <> comes out as &lt; and &gt;
  • & as &amp;
  • The output is LaTeX209
  • Included images are lost!

And no, it almost never compiles without problems.

Let us go back to the SGML format. In it one will find (like HTML) tags (<...>...</...>) and entities (&...;), which marks the formatting of the document.

Let us have a look at the SGML from the post

<inline-equation>
<f>Y</f>
</inline-equation> 

<inline-equation> is just sugar (and mapped to nothing), <f>...</f> already mean inline equation.

<f><g>6</g>Y</f>

This is a greek letter and then a Y, when one looks it up, the 6 is mapped to \partial.

<f>C<sup>1</sup></f>

is simple super script.

On the other hand

<blkbd>R</blkbd>

is not defined in the appendix of the manual that I have, but from prints of the corresponding Publisher output, we know this should be mapped to \mathbb{R}.

So dealing with this kind of stuff is an interesting challenge.

If we go back to

sgmlmap -sgml file.sgml -def booklat

then the booklat.def contains some kind of list of conversions, i.e. how to map entities onto LaTeX symbol macros, how to map tags onto something meaning full (remember that not all tags are closed!). For example

<fr><nu>1</nu><de>2</de></dr>

gets mapped as

#deftag fr      "\frac"                         /fr
#deftag /fr     null
#deftag nu      "{"                             /nu
#deftag /nu     "}"
#deftag de      "{"                             /de             
#deftag /de     "}"

-- that is the normal fraction.

An interesting caveat of sgmlmap is that it does not allow for tags and entities to share the name. So to use sgmlmap, then in general one has to preprocess the SGML, rename some stuff and add those new tags or entities to booklat.def.

We have no idea about the syntax used in booklat.def or how it can do syntax checking.

In the end, I've written my own perl script, which makes all the substitutions described in booklat.def (and then some).

Even after the sgml to tex conversion, still use an extra script to clean up the generated LaTeX code (I had it already for documents made via sgmlmap, and did not both to add it into the conversion script.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.