GeneralProblems with own LaTeX style

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Jolly Roger
Posts: 1
Joined: Fri Sep 14, 2007 10:45 pm

Problems with own LaTeX style

Post by Jolly Roger »

Hello!
Recently I decided to upgrade my skills in writing classes and styles packages for LaTeX. As a start I began to write the *.sty which provides title page for abstract.
Title page of the abstract in Ukraine is usually has following markup(see attached example):

Code: Select all

Text "MINISTRY OF EDUCATION AND SCIENCE OF UKRAINE", centered
Name of the Institute/University/school/etc, centered
Title of the abstract, bold, 36pt, centered, a little higher than center of the page

Some vskip.

(The following is right aligned)
Composed by: (student's name)
             (student's group)

Checked by:  (teacher's name)
             (teacher's department)

Some vskip.

City and year, centered(for example: Kyiv - 2007)
For this purpose I made file abstract.sty:

Code: Select all

% abstract

\def\filename{abstract}
\def\fileversion{v0.3}
\def\filedate{2002/10/20}

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{\filename}

%Name of school/University/Institute
\newcommand{\uchzav}{\renewcommand{\@uchzav}}
\newcommand{\@uchzav}{}

%"Checked by" field
\newcommand{\checkedby}{\renewcommand{\@checkedby}}
\newcommand{\@checkedby}{}

% Title page
\renewcommand{\@maketitle}
{
  \begin{titlepage}
    \let \footnotesize \small
    \let \footnoterule \relax
    \newpage \null
    \vskip 1em
    \let \footnote \thanks
    \begin{center}
      \large \@uchzav
    \end{center}
    \vskip 10.5em
    \begin{center}
      \lineskip 1.2ex
      \textbf{\Huge{\@title}}
    \end{center}
    \vskip 10em
    \begin{flushright} 
      \begin{tabular}[t]{lr}
        \begin{tabular}[t]{r}
          \fontseries{b}\selectfont Composed by: 
        \end{tabular} &
        \begin{tabular}[t]{r}
          \fontseries{m}\selectfont \itshape \@author \\ \null
        \end{tabular} \\
        \begin{tabular}[t]{r}
          \fontseries{b}\selectfont Checked by: 
        \end{tabular} &
        \begin{tabular}[t]{r}
          \fontseries{m}\selectfont \itshape \@checkedby 
        \end{tabular}
      \end{tabular}
    \end{flushright}
    \vfill
    \begin{center}
      \large \@date
    \end{center}
    \vskip 1.5em
  \end{titlepage}
}
I prepared some test document

Code: Select all

\documentclass[ukrainian]{article}
\usepackage[T1]{fontenc}
\usepackage[koi8-u]{inputenc}
\usepackage{abstract}
\usepackage{babel}

\begin{document}
\uchzav{\noun{ministry of science and education of ukraine} \newline %
National Aviation University \newline %
Control Systems Faculty}

\checkedby{Anatoly Kozlov \newline CIC Department}
\author{Andriy Senkovych \newline Group 508}

\title{My Test Title}

\maketitle

This is a test sentence. 

\section{Test 1}
This is a test sentence. This is a test sentence. 
\begin{eqnarray*}
x^{2}-y & = & \sqrt{z^{2}-y^{2}}\\
0 & = & 0\end{eqnarray*}

This is a test sentence. This is a test sentence. This is a test sentence.

\section{Test 2.5}

\tableofcontents{}
\end{document}
The most interesting begins from this.
1) Generated dvi file looks different in xdvi and kdvi. kdvi also shows some big red squares in thumbnails but they disappear in .ps file.
2) I need multiple lines in \author and \checkedby command , but I don't know how make such
3) commands like \uchzav, \author, \checkedby work only if \title is placed after them, but not before.
Attachments
titlepage.pdf
Example title page
(48.03 KiB) Downloaded 239 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
pumpkinegan
Posts: 91
Joined: Thu May 03, 2007 10:29 pm

Problems with own LaTeX style

Post by pumpkinegan »

There are many things to be concerned about in your style file.

If you are going to use a titlepage, then the documentclass has to be defined

Code: Select all

\documentclass[ukrainian,titlepage]{article}
\begin{document}
\begin{titlepage}
\end{titlepage}
Document text
\end{document}
and the \maketitle command is defunct.

Experiment with something like

Code: Select all

\newcommand{\checkedby}[2]{\noindent #1 \newline #2}
to get multiple line commands.

Other than that, I see an overly complicated definition of a title page. There are skips, fills, tabulars, and font definitions all over the place, and I wonder do you really want them. Keep things simple.
Post Reply