Page LayoutCustomized newsletter sections and table of contents

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
HowieCohl
Posts: 1
Joined: Thu Apr 16, 2015 3:48 pm

Customized newsletter sections and table of contents

Post by HowieCohl »

I just became an editor for a bi-monthly Newsletter and we have built XeLaTeX code to generate the newsletter. This Newsletter was previously generated using Microsoft Word. We want to maintain the organization of Newsletter as was previously done, but we want to do it with (Xe)LaTeX instead of Microsoft Word. I want to optimize our XeLaTeX code to make formatting easier.

Here is how the Newsletter is organized. There is a title banner, followed by some text and then there is a table of contents. The table of contents only lists the title of the topics as a numbered list. There are no page numbers in the table of contents. Then there is a Calendar of events which are listed and then there is a listing of all information related to the Topics. These should be numbered appropriately, and match up to the topic titles in the table of contents. Currently I am setting the numbers of the topics manually. I would like XeLaTeX to
automatically generate the numbers of the topics and also the table of contents in exactly the place I want it, near the top of the PDF file. I would like to use something like `\section` to give the information such as Title1, personA, etc., and I want XeLaTeX to generate the numbers.

Here is a sample organization of the Newsletter.

Code: Select all

O P S F N E T - Volume 22, Number 3 - May 15, 2015
...
Topics:
1. Title1
2. Title2
3. Title3
4. ...
9. ...
10. Title10
Calendar of Events:
...
Topic #1 ---- OP-SF Net 22.3 ---- May 15, 2015
From: personA
Subject: Title1
...
Topic #2 ---- OP-SF Net 22.3 ---- May 15, 2015
From: personB
Subject: Title2
...
Topic #3 ---- OP-SF Net 22.3 ---- May 15, 2015
From: personC
Subject: Title3
...
...
...
Topic #10 ---- OP-SF Net 22.3 ---- May 15, 2015
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Sample XeLaTeX for Newsletter:

Code: Select all

Code, edit and compile here:
\documentclass[12pt]{article}
\usepackage{xltxtra,fontspec,xunicode}
\oddsidemargin 0.00cm
\textwidth 16.4cm
\textheight 24.0cm
\pagenumbering{arabic}
\setlength{\topmargin}{-2.5cm}
\begin{document}
\setmainfont{LucidaSansRegular.ttf}[
BoldFont = LucidaSansDemiBold.ttf,
ItalicFont = LucidaSansItalic.ttf ]
\noindent
\begin{center}
\vspace{1cm}
{\large O\ P - S\ F\ \ N\ E\ T - Volume 22, Number 2 - May 15, 2015}\\[0.6cm]
\end{center}
\normalsize
\begin{center}
$\{$ Contents of Newsletter header $\}$
\end{center}
\small
\noindent Topics:
\begin{enumerate}
\item Topic Title 1\\[-0.75cm]
\item Topic Title 2\\[-0.75cm]
\item Topic Title 3\\[-0.75cm]
\item Topic Title 4\\[-0.75cm]
\item Topic Title 5\\[-0.75cm]
\item Topic Title 6\\[-0.75cm]
\item Topic Title 7\\[-0.75cm]
\item Topic Title 8\\[-0.75cm]
\item Topic Title 9\\[-0.75cm]
\item Topic Title 10
\end{enumerate}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Customized newsletter sections and table of contents

Post by rais »

perhaps a start would be to use your own commands, e.g., \topic for topic. If something's wrong in there, you have one cenralized point for correction, in this case, the definition of \topic.

Code: Select all

Code, edit and compile here:
\documentclass[11pt]{article}
% to get rid of all the \small switches, I declared 11pt instead of 12pt.
\usepackage{xltxtra,fontspec,xunicode}
\usepackage{parskip}% there were way too many \noindent in the code...
% you may want to have a look at the geometry package
\oddsidemargin 0.00cm
\textwidth 16.4cm
\textheight 24.0cm
%\pagenumbering{arabic} that's article's default page numbering scheme anyway
\setlength{\topmargin}{-2.5cm}
\setmainfont{Lucida Sans}%
%\setmainfont{LucidaSansRegular.ttf}[
% BoldFont = LucidaSansDemiBold.ttf,
% ItalicFont = LucidaSansItalic.ttf ]
\newcommand*\OPvol{22}
\newcommand*\OPnum{2}
\newcommand*\OPdate{May 15, 2015}
\newcounter{topic}
\newcommand*\dummycontents[1][]{%
\{Contents of
\if\relax#1\relax
Topic \thetopic
\else
#1%
\fi
\}\par
}
\newcommand\topic[3][]{%
\par
\refstepcounter{topic}%
{\Large Topic \parbox[b]{1.9em}{\raggedleft\#\thetopic}\quad\rule[0.75mm]{15.5mm}{1.0pt}\quad OP- SF Net \OPvol.\OPnum
\quad\rule[0.75mm]{15.5mm}{1.0pt}\quad
\OPdate\par}%
From: #3\par
Subject: #2\par
\ifx\relax#1\relax
\addcontentsline{toc}{topic}{\protect\numberline{\thetopic}#2}%
\else
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
KR
Rainer
Post Reply