starlink icon indicating copy to clipboard operation
starlink copied to clipboard

Issues with new latex style

Open timj opened this issue 10 years ago • 46 comments

In 289b69db59cf5af276f7014bec7fb96c340883f2 SUN/209 was converted to use the new latex style but there are two outstanding problems:

  1. The document comes with private SST-like commands that need to be updated to the new SST look and feel (currently they are squashed together)
  2. There are many unresolved label references that will cause "??" to appear in the HTML version.

timj avatar Dec 07 '14 17:12 timj

SSN/4 has trouble with Figure 2 as well (a latex diagram).

timj avatar Dec 08 '14 04:12 timj

I should rename this issue to track latex class file issues. SUN/92 has its Figure 1 messed up with the new class (also a latex diagram). Worked fine before I updated it.

timj avatar Dec 08 '14 22:12 timj

Many latex documents use a \noteroutine macro for printing out summaries of the API. Would be nice to unify these, maybe creating a \sstnoteroutine and then migrating the documents over.

timj avatar Dec 08 '14 22:12 timj

The subsections of the classified commands in SUN/95 are hard to see.

The size of the SST parameter headings look too small in html. They are smaller than the description that follows.

MalcolmCurrie avatar Dec 08 '14 23:12 MalcolmCurrie

Are they the things that use \noteroutine?

timj avatar Dec 08 '14 23:12 timj

No. I was going by the title.

MalcolmCurrie avatar Dec 08 '14 23:12 MalcolmCurrie

SUN/261(IRQ) is okay but @dsberry IRQ_ADDQN talks about IRQ_SETQC which is a subroutine that does not seem to exist (it triggers a latex warning).

timj avatar Dec 09 '14 00:12 timj

SUN/92: I think I've fixed the picture issue in commit eabdb704a338 It just required the unitlength to be set before creating the picture -- this was in one of the sections that starlink_fixup_perl removes. The appearance in the html output could probably be improved, it looks a bit low-res.

sfgraves avatar Dec 09 '14 00:12 sfgraves

Also @dsberry, Appendix P is not being created when make_sun238.csh executes in kaplibs.

timj avatar Dec 09 '14 00:12 timj

SSN/4 is also fixed I believe (same fix as for SUN/92)

sfgraves avatar Dec 09 '14 02:12 sfgraves

PS @dsberry I'm explicitly not upgrading the AST documents. I'm leaving those ones to you.

timj avatar Dec 09 '14 04:12 timj

OK - I'll do AST. Do you have a list of standard changes that need to be made to each doc, or do I work it out by looking at the commits you've been making? A cursory glance suggests it's a fairly involved process. BTW - I've made the IRQ and KAPLIBS changes you pointed out.

dsberry avatar Dec 09 '14 08:12 dsberry

There's a perl script in latexsupport that attempts to remove the most common bits of the prologue and put the correct class and various fix ups in.

I usually run that and then try to run pdflatex and see if it breaks anywhere. Most standard latex should be reasonable. The class file still needs some improvements though.

sfgraves avatar Dec 09 '14 09:12 sfgraves

regarding the script, you always have to clean up the prologue a bit when you are done and remove the abstract and stuff after scfrontmatter. Not hard though. Then you have to go and sort out any verbatim paragraphs and use small environments rather than \small. Then take a look at the PDF and tweak it a bit.

timj avatar Dec 09 '14 14:12 timj

@sfgraves we need to address the optional nature of \stardocversion and \stardocmanual. System Notes won't have a \stardocversion because they aren't generally talking about a library or application so it makes no sense. Abstracts are going to get a bit limited as well so we need to make these three items optional.

timj avatar Dec 09 '14 23:12 timj

This terminalv environment has turned each of my multi-line Fortran code extracts into a single long lines in Redman/Redmond style. Please @sfgraves can it respect line feeds and indentation.

MalcolmCurrie avatar Dec 10 '14 07:12 MalcolmCurrie

@MalcolmCurrie it does act exactly like a verbatim environment so I'm a bit confused. Can you send me an example of something that is not working. I've converted many documents by now and they all use terminalv.

timj avatar Dec 10 '14 13:12 timj

I've got the PCS docs ready to go pending resolution of the stardocversion and stardocmanual issue. SUN/61 (TRN) is also ported but the conversion to HTML doesn't work properly with the heavy math usage and latex diagrams. I can push what I have of TRN if people want to take a look (it does do the conversion, just not very well).

timj avatar Dec 10 '14 21:12 timj

I've added in a 'noabs' class option, and set stardocversion and stardocmanual to default to a space. We may want to tweak the title formatting a bit at some point, but this seems to look okay.

If a lot of documents really shouldn't have an abstract, we could also do something more clever and detect if the content of \stardocabstract is blank. Not sure its worth it though.

sfgraves avatar Dec 10 '14 22:12 sfgraves

@timj I'd be interested in knowing where SUN/61 is breaking, particularly with the maths.

sfgraves avatar Dec 10 '14 22:12 sfgraves

@timj http://www.starlink.ac.uk/devdocs/sun114.htx/node13.html, but something else has gone wrong with that build in that the navigation controls are late2xhtml style.

MalcolmCurrie avatar Dec 10 '14 23:12 MalcolmCurrie

Note that the old latex2html files are not deleted when you rerun with the new style. node13.html is a latex2html output file isn't it? tex4ht does not use that naming scheme.

timj avatar Dec 10 '14 23:12 timj

You want this URL: http://www.starlink.ac.uk/devdocs/sun114.htx/sun114se5.html#x6-140007 for that page.

timj avatar Dec 10 '14 23:12 timj

Yup -- if you are in an existing install, there's no process to clean out the old html pages. It looks odd because when you view them you pick up the css from the new version, but the html from the old version.

sfgraves avatar Dec 11 '14 00:12 sfgraves

Yes I hadn't noticed the old style last night, but it was obvious today but got to the correct version starting from the top (sun114.html).

We need the make world and make install to clean up previous versions.

MalcolmCurrie avatar Dec 11 '14 00:12 MalcolmCurrie

@sfgraves for SC/3 487eaf0534bedb85ea987efb3a336affb930d9d9 I had to use negative \vspace in the title picture element to compensate for the extra space taken up by the lack of software version and manual type.

timj avatar Dec 11 '14 05:12 timj

@sfgraves I'm looking at SUN/259 (in SMURF) and pdflatex refuses to deal with underscores in equations:

\begin{equation}
MAP\_WDTH \,=\, NO\_Y\_MAP\_PNTS \times CELL\_Y
\end{equation}

The command just hangs there until I ctrl-C:

) [1]^C
! Interruption.
l.335 NSCAN \times NO\_
                       SCAN\_PNTS
? 

If I remove the \_ everything works. Obviously this all worked before I switched to the starlink class. Any thoughts? I'm using:

This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode

timj avatar Dec 12 '14 04:12 timj

Damn, yes, I know what this is.

Previously, we didn't use any hyperrefs inside the latex document, and the sst routine didn't turn the title of the routine into a label when running latex. Now of course we are providing hyperlinks inside the pdf, so I set a label and an xlabel with the name of the title of the routine (as was always done in html), and all the references link to that

Unfortunately, our routine titles have lots of escaped underscores in them, and (pdf?)latex can't handle escaped underscores in labels/refs.

I got around this by putting in a line in starstyle.sty to force _ to be a \string_ , and I think this is now what's breaking _ in math mode.

I think I can fix this in this case easily by adding an 'ifmath' check to that renewcommand -- I'll commit that now if it works.

I'm a bit worried we'll come up against other issues based on this though. I'm not sure this method of handling it is really ideal...

sfgraves avatar Dec 12 '14 20:12 sfgraves

SUN/259 now works for me.

timj avatar Dec 12 '14 20:12 timj

I haven't looked at the style file, to see what's happening where, but if you set \catcode```\_=11 at a suitable place, then underscore will become just a plain character, as opposed to an subscript indicator. However that character won't appear as an actual underscore in a roman font, so there are other games necessary.

If you can prepare a minimal test case, I might be able to work something out.

nxg avatar Dec 12 '14 20:12 nxg