diff --git a/example.pdf b/example.pdf new file mode 100644 index 0000000..1129be1 Binary files /dev/null and b/example.pdf differ diff --git a/example.tex b/example.tex new file mode 100644 index 0000000..27af8ee --- /dev/null +++ b/example.tex @@ -0,0 +1,90 @@ +\documentclass{omgrpt} +\usepackage{lipsum} + +\begin{document} +\oclHeadingOne{Introduction}\label{sec:ocl-1:introduction} +The \LaTeX{} style \texttt{omg.sty} tries to mimic the layout used by +the OMG for the UML/OCL standard documents. To achieve this, the style +\begin{itemize} +\item sets the paper size to 8.28x11 inch +\item sets the text size to 6.7x8 inch +\item uses the PostScript fonts Times Roman, Helvetica, and Courier +\item formats paragraphs without initial indentation and ragged + right formatting +\end{itemize} +Note that this style works only in combination with one of the +KomaScript classes, e.g., \texttt{scrbook} (replaces \texttt{book}) or +\texttt{scrreprt} (replaces \texttt{report}). As shorthands, this +package also provides the \texttt{omgrpt} class. + +Moreover, \texttt{omg.sty} provides the following \LaTeX-commands: +\begin{itemize} +\item New commands for chapters/sections: +\begin{itemize} +\item \verb|\oclHeadingOne{Examples}| for top-level sections + (chapters), e.g., \autoref{ocl-1:examples} or ``9 Concrete + Syntax''% in~\cite{omg:ocl:2014}. +\item \verb|\oclHeadingTwo{Examples}| for second-level sections, + e.g., \autoref{ocl-2:examples} or ``9.1 Structure of the Concrete + Syntax''% in~\cite{omg:ocl:2014}. +\item \verb|\oclHeadingThree{Examples}| for third-level sections, + e.g., \autoref{ocl-3:examples} or ``9.2.1 Parsing''% in~\cite{omg:ocl:2014}. +\item \verb|\oclHeadingFour{Examples}| for fourth-level sections, + e.g., \autoref{ocl-4:examples} (should be used carefully). +\item \verb|\oclHeadingZero{Examples}| for fourth-level sections + without numbering, + e.g., \autoref{ocl-0:examples} or ``Abstract syntax mapping'' (in + ``9.4.1 ExpressionInOclCS'')% in~\cite{omg:ocl:2014}). + \end{itemize} +\item New environments +% ocl-definition e.g. "ExpressionInOclCS.ast : OclExpression" as in 9.3.1 + \begin{itemize} + \item \verb| \begin{oclDefintion} \ldots \end{oclDefinition}| for + OCL definitions, e.g., ``ExpressionInOclCS.ast : OclExpression'' + as in 9.3.1% in~\cite{omg:ocl:2014}. + \begin{oclDefinition} + ExpressionInOclCS.ast : OclExpression + \end{oclDefinition} + \end{itemize} +\item New styles for emphasizing or highlighting texts + \begin{itemize} + \item \verb|\oclEmph{declaration}| (italics) for declarations and segments of +OCL text, e.g., \oclEmph{declaration}. + \end{itemize} +\end{itemize} + +\oclHeadingOne{Examples}\label{ocl-1:examples} +\lipsum[1] + +\begin{figure} + \centering + \centerline{\Large\textbf{Example Figure}} + \caption{This is an example figure caption} +\end{figure} + +\begin{table} + \centering + \centerline{\Large\textbf{Example Table}} + \caption{This is an example table caption} + \label{tab:asdf} +\end{table} + +\oclHeadingTwo{Lore Ipsum}\label{ocl-2:examples} +\lipsum[2-3] + +\oclHeadingThree{Lore Ipsum}\label{ocl-3:examples} +\lipsum[2-3] + +\oclHeadingFour{Lore Ipsum}\label{ocl-4:examples} +\lipsum[2-3] + +\oclHeadingZero{Lore Ipsum}\label{ocl-0:examples} +\lipsum[2-3] + +\end{document} + + + +\end{document} + + diff --git a/omg.sty b/omg.sty new file mode 100644 index 0000000..31d24b7 --- /dev/null +++ b/omg.sty @@ -0,0 +1,37 @@ +%% Copyright (C) 2016 Achim D. Brucker, https://www.brucker.ch +%% +%% License: +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt; either +%% version 1 of the License, or any later version. +%% OR +%% The 2-clause BSD-style license. +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{omg} + [2014/11/10 OMG Layout.] +\usepackage{fixltx2e} +\usepackage[T1]{fontenc} +\KOMAoptions{paper=8.28in:11in,fontsize=10pt,twoside=semi,headings=openany} +\areaset{6.7in}{8in} +\usepackage{mathptmx} % rm & math +\usepackage[scaled=0.90]{helvet} % ss +\usepackage{courier} % tt +\usepackage[fleqn]{amsmath} +\usepackage{mathastext} +\normalfont +\usepackage[document]{ragged2e} +\setcounter{secnumdepth}{4} +\newcommand{\oclHeadingOne}[1]{\chapter{#1}}% +\newcommand{\oclHeadingTwo}[1]{\section{#1}}% +\newcommand{\oclHeadingThree}[1]{\subsection{#1}}% +\newcommand{\oclHeadingFour}[1]{\subsubsection{#1}}% +\newcommand{\oclHeadingZero}[1]{\subsubsection*{#1}}% +\newcommand{\oclEmph}[1]{\emph{#1}} +% +\newenvironment{oclDefinition}{\csname gather*\endcsname}{\csname endgather*\endcsname} + +\addtokomafont{caption}{\sffamily\bfseries} +\addtokomafont{captionlabel}{\sffamily\bfseries} +\renewcommand*{\captionformat}{\ --\ \ } +\setcapwidth[l]{\textwidth} diff --git a/omgrpt.cls b/omgrpt.cls new file mode 100644 index 0000000..658161a --- /dev/null +++ b/omgrpt.cls @@ -0,0 +1,15 @@ +%% Copyright (C) 2016 Achim D. Brucker, https://www.brucker.ch +%% +%% License: +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt; either +%% version 1 of the License, or any later version. +%% OR +%% The 2-clause BSD-style license. +\NeedsTeXFormat{LaTeX2e}\relax +\ProvidesClass{omgrpt}[2014/10/11] +\LoadClass{scrreprt} +\usepackage{omg} +\usepackage[pdfpagelabels, pageanchor=false, bookmarksnumbered, plainpages=false]{hyperref} +