On 11/16/2010 02:05 PM, Tim Wescott wrote:
On 11/15/2010 08:46 AM, Tim Wescott wrote:
I want to make myself an article template that's otherwise normal, but with a custom title page. Basically, I want something that goes

(Nifty graphics with my company logo)

   title
   author
   abstract

(More nifty graphics)

This is for when I need to make a white paper for a customer, or to post on the web, etc.

I tried to do this as a one-off within LyX, and couldn't even get as far as inserting nifty graphics ahead of the title. So it appears I don't even know where to start.

Where do I start? Is this something that can be done fairly easily? Do I need a template in LaTeX? If so, how do I bind/import/convert/whatever it to work with LyX?

TIA

I forgot to reply to the list. You both have my private thanks -- here they are publicly.

Liviu's direction got me going with a custom "finger-painted" title page; once I have that working well and I get the time to wrap my head around LaTeX programming I'll take a stab at making my own article class.

If you can fingerpaint it, then it is easy to transform it into something concrete for a documentclass. Printing the titlepage is usually the job of the \maketitle macro, which you just need to redefine. Here it is from article.cls, with some comments interspersed:

  \...@titlepage

So we are going to do what follows if we are supposed to make a separate title page. The alternative will follow.

  \newcommand\maketitle{%

As said, it is the \maketitle macro that actually prints the title page. LyX issues this for you.

  \begin{titlepage}%

See below for the definition of this environment. It doesn't do that much.

  \let\footnotesize\small
  \let\footnoterule\relax
  \let \footnote \thanks

Those commands redefine some footnote related stuff just for the titlepage.

  \null\vfil

This \vfil together with the one below centers the rest vertically on the page.

  \vskip 60\p@

Skip us down the page a bit.

What follows is what really sets up the title page.

  \begin{center}%

Centered....

    {\LARGE \...@title \par}%

...print title LARGE...

    \vskip 3em%

...skip more space...

    {\large
     \lineskip .75em%
      \begin{tabular}[t]{c}%
        \...@author
      \end{tabular}\par}%

and that mess is for printing multiple authors.

      \vskip 1.5em%
    {\large \...@date \par}%       % Set date in \large size.
  \end{center}\par

Skipped more space, printed date.

  \...@thanks
  \vfil\null
  \end{titlepage}%

Now we restore everything and undefine many of the commands we used, so they can't be used again. (No double \maketitle.)

  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\l...@thanks\@empty
  \global\l...@author\@empty
  \global\l...@date\@empty
  \global\l...@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}

What follows is the version you get without a separate titlepage.

\else
\newcommand\maketitle{\par
  \begingroup

More footnote redefining, so you get "*", e.g., for the "thanks" footnote.

    \renewcommand\thefootnot...@fnsymbol\c@footnote}%
    \d...@makefnmark{\rlap{\@textsuperscript{\normalfo...@thefnmark}}}%
    \long\d...@makefntext##1{\parindent 1em\noindent
            \...@xt@1.8em{%
                \h...@textsuperscript{\normalfont\@thefnmark}}##1}%

What follows is designed to get the title into the right column, I think. You can probably just copy it over to a custom class.

    \...@twocolumn
      \ifnum \...@number=\@ne
        \...@maketitle
      \else
        \twocolum...@maketitle]%
      \fi

What follows is what you get if (a) no separate titlepage and (b) single column.

    \else
      \newpage
      \glob...@topnum\z@   % Prevents figures from going at top of page.
      \...@maketitle

So what you get in that case is just \...@maketitle. Indeed, you can see that the real action is just in \...@maketitle for this case.

    \fi
    \thispagestyle{plai...@thanks
  \endgroup
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\l...@maketitle\relax
  \global\l...@thanks\@empty
  \global\l...@author\@empty
  \global\l...@date\@empty
  \global\l...@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}

All the same resetting there.

The real action:

\d...@maketitle{%
  \newpage
  \null
  \vskip 2em%

Make sure we start on a new page, and skip down a bit.

  \begin{center}%
  \let \footnote \thanks
    {\LARGE \...@title \par}%
    \vskip 1.5em%
    {\large
      \lineskip .5em%
      \begin{tabular}[t]{c}%
        \...@author
      \end{tabular}\par}%
    \vskip 1em%
    {\large \...@date}%
  \end{center}%
  \par
  \vskip 1.5em}
\fi

You can see that that is pretty much the same layout as before.

Here's the titlepage environment.

\newenvironment{titlepage}
    {%
      \...@twocolumn
        \...@restonecoltrue\onecolumn
      \else
        \...@restonecolfalse\newpage
      \fi
      \thispagestyle{empty}%
      \setcounter{pag...@ne
    }%
    {...@restonecol\twocolumn \else \newpage \fi
     \...@twoside\else
        \setcounter{pag...@ne
     \fi
    }

As you can see, what it mostly does is just turn off two column, if we have it, and set a variable so we remember to restore it at the end.

Richard


Reply via email to