PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
266 stars 208 forks source link

Small issue with editor #127

Closed Alex-Jordan closed 9 years ago

Alex-Jordan commented 9 years ago

Currently, there is this in mathbook-latex.xsl:

<xsl:template match="author" mode="title-page">
    <xsl:text>{\Large </xsl:text>
    <xsl:apply-templates select="personname" />
    <xsl:text>}\\[0.5\baselineskip]&#xa;</xsl:text>
    <xsl:text>{\Large </xsl:text>
    <xsl:apply-templates select="institution" />
    <xsl:text>}\\[3\baselineskip]&#xa;</xsl:text>
</xsl:template>

<xsl:template match="editor" mode="title-page">
    <xsl:text>{\Large </xsl:text>
    <xsl:apply-templates select="personname" />
    <xsl:text>, </xsl:text>
    <xsl:call-template name="type-name">
        <xsl:with-param name="string-id" select="'editor'" />
    </xsl:call-template>
    <xsl:text>}\\[\baselineskip]&#xa;</xsl:text>
    <xsl:text>{\Large </xsl:text>
    <xsl:apply-templates select="institution" />
    <xsl:text>}\\[\baselineskip]&#xa;</xsl:text>
</xsl:template>

The spacing for <author> has been nicely tuned to 0.5\baselineskip after the name, and 3\baselineskip after the institution. I think that for any editors, this should be mirrored. Currently editor gets \baselinekip in both these places, and it looks wrong on the page where this show up.

Rather than fix this and submit a pull request, I though you might just want to incorporate it into one of your open branches.

Alex-Jordan commented 9 years ago

Oh, and I might as well mention this related issue. When there is one or more authors, plus at least one editor, the last author and first editor get mashed together on the cover page. So this modification inserts an \andappropriately. The only change to what is now in mathbook-latex.xsl is the insertion of the 2nd, 3rd, and 4th lines.

<xsl:template match="editor">
    <xsl:if test="preceding-sibling::author">
        <xsl:text>\and&#xa;</xsl:text>
    </xsl:if>
    <xsl:apply-templates select="personname" />
    <xsl:text>, </xsl:text>
    <xsl:call-template name="type-name">
        <xsl:with-param name="string-id" select="'editor'" />
    </xsl:call-template>
    <xsl:if test = "department">
        <xsl:text>\\&#xa;</xsl:text>
        <xsl:apply-templates select="department" />
    </xsl:if>
    <xsl:if test = "institution">
        <xsl:text>\\&#xa;</xsl:text>
        <xsl:apply-templates select="institution" />
    </xsl:if>
    <xsl:if test = "email">
        <xsl:text>\\&#xa;</xsl:text>
        <xsl:apply-templates select="email" />
    </xsl:if>
    <xsl:if test="position() != last()" >
        <xsl:text>&#xa;\and</xsl:text>
    </xsl:if>
    <xsl:text>&#xa;</xsl:text>
</xsl:template>
Alex-Jordan commented 9 years ago

Oops, the first issue mentioned here is https://github.com/rbeezer/mathbook/issues/117.

rbeezer commented 9 years ago

I have reworked this for just the title page of a book and been very careful about the vertical spacing, rather than inserting n-1 \ands for all possible combinations of zero, one or more authors and editors that sum to n.

I'm a bit more content to let LaTeX format the title, etc on an article.

Can you test on the lab manual and let me know before I close this and #117 ? I have tested but there are many combinations and I've not run through all of them.

At: a280d37c

Alex-Jordan commented 9 years ago

I can confirm that it looks OK in the lab manual now.

rbeezer commented 9 years ago

Excellent - thanks very much for checking.