14

デフォルトの article ドキュメント クラスに多くの変更を加える必要はありません。私が欲しいのは:

  • ページ余白を再定義します (すべてのページで同じにする必要がありますが、既定値とは異なります)。
  • タイトル ページを使用します。
  • タイトル ページに要素を追加します ( titleauthordateだけでは十分ではありません。会社と会社のロゴもタイトル ページに表示する必要があります)。
  • section 、subsections、およびsubsubsectionsのスタイルを変更します数字を表示したくありません。そうでなければ、それらは良いです)。

おそらく、この場合に役立つパッケージがいくつかありますか?

4

3 に答える 3

15

あなたが探している結果を達成するのを助けることができる多くのパッケージがあります。以下で選択したパッケージは私が気に入っているものですが、それを行うには複数の方法があります。

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{paulius-article}[2009/02/25 v0.1 Paulius' modified article class]

% Passes and class options to the underlying article class
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions

% Load LaTeX's article class with the `titlepage' option so that \maketitle creates a title page, not just a title block
\LoadClass[titlepage]{article}

% Redefine the page margins
% TODO: Adjust margins to your liking
\RequirePackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}

% Remove the numbers from all the headings (\section, \subsection, etc.)
\setcounter{secnumdepth}{-1}

% To modify the heading styles more thoroughly use the titlesec package
%\RequirePackage{titlesec}

% Adjust the title page design
% NOTE: This is the default LaTeX title page -- free free to make it look like whatever you want.
% TODO: Add company name and logo somewhere in here.
\newcommand{\maketitlepage}{%
  \null\vfil
  \vskip 60\p@
  \begin{center}%
    {\LARGE \@title \par}%
    \vskip 3em%
    {\large
     \lineskip .75em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
      \vskip 1.5em%
    {\large \@date \par}%       % Set date in \large size.
  \end{center}\par
  \@thanks
  \vfil\null%
  \end{titlepage}%
}

% This some before-and-after code that surrounds the title page.  It shouldn't need to be modified.  
% I've pulled out the part the actually typesets the title page and placed it in the \maketitlepage command above.
\renewcommand\maketitle{\begin{titlepage}%
  \let\footnotesize\small%
  \let\footnoterule\relax%
  \let \footnote \thanks%
  \maketitlepage%
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}

% TODO: If there are any other article modifications required, add them here.

% That's all, folks!
\endinput

マージンを調整するには、ジオメトリパッケージのドキュメントを読むことをお勧めします。titlesecパッケージは、見出しの外観を変更する場合に使用できます(数字をオフにするだけではありません)。

タイトルページは、LaTeXのデフォルトのタイトルページです。会社名とロゴを追加するには、変更する必要があります。タイトルページに関連付けられている他のすべてのコードから「印刷するもの」を分離しました。コマンドを変更するだけで済みます\maketitlepage。ドキュメントで、を使用\maketitleしてタイトルページを印刷します。

\documentclass{paulius-article}

\title{My New Document Class}
\author{Paulius}

\usepackage{lipsum}% provides some filler text

\begin{document}
\maketitle% Actually makes a title page

\section{Section Heading}
\subsection{Look no numbers!}
\lipsum[1-10]

\end{document}

私があなたの要件のいずれかを逃したかどうか私に知らせてください。

于 2009-02-25T17:41:55.907 に答える
10

あなたはから始めます

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{classname}[2009/02/24]
\LoadClass{article}

その後、カスタマイズを追加します。

更新:クラスおよびパッケージの作成者向けに LaTeX2e を読むことをお勧めします: PDFHTML。セクション 3 (クラスまたはパッケージの構造) の例が役立つはずです。

于 2009-02-24T14:34:33.650 に答える
6

興味深いかもしれないいくつかのポイント:

  • ヘッダーのマージンを再定義できます(つまり、\begin{document}}の前に、などの制御長をリセット\setlength{\textwidth}{6.80in}\setlength{\oddsidemargin}{0.0in}ます。

  • \section*{...}すでに番号のないセクションが表示されます。同様に\subsection*\subsubsection*。このトリックを使用し、参照を機能させたい場合は、LaTeXで参照のテキストコンテンツを出力するにはどうすればよいですか?

  • あなたはtitlepage環境を見ましたか?

しかし、おそらく最も重要なのは、回想録クラスが、クラスをハッキングすることなく、必要なすべての制御を提供する可能性があることです。ドキュメントを確認してください。

または、CanBerkGüderの提案を使用してください。

于 2009-02-24T14:39:31.720 に答える