General ⇒ Section formatting headaches
- tripwire45
- Posts: 129
- Joined: Thu Apr 10, 2008 4:35 am
Section formatting headaches
I managed to get the primary document I was working on moved into LaTeX. Now I'm supposed to make it have the same "look and feel" as when the document was produced in Word. I'm not sure LaTeX will do everything I need it to, but here goes.
Sections: section headers need to be larger than the default size, olive green (trying to figure out how to create different shades of colors for text) and with no numbers. The trick is, that that sections *do* need to appear in the TOC with numbers (I know I can use \section*{section name} to remove the number but then, it won't appear in the TOC).
Subsections: subsection headers need to be indented. In fact, I need to have a lot of control over indentation and how text is lined up. So far, I haven't had a lot of success with the \noindent tag.
There are other issues, but I'll have to create a list before I can post them all.
I got the text on the cover page to turn red, but besides using \HUGE, I can't get that text any bigger. Is that the limit of text size in LaTeX?
Thanks.
Sections: section headers need to be larger than the default size, olive green (trying to figure out how to create different shades of colors for text) and with no numbers. The trick is, that that sections *do* need to appear in the TOC with numbers (I know I can use \section*{section name} to remove the number but then, it won't appear in the TOC).
Subsections: subsection headers need to be indented. In fact, I need to have a lot of control over indentation and how text is lined up. So far, I haven't had a lot of success with the \noindent tag.
There are other issues, but I'll have to create a list before I can post them all.
I got the text on the cover page to turn red, but besides using \HUGE, I can't get that text any bigger. Is that the limit of text size in LaTeX?
Thanks.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Section formatting headaches
Hi Trip,
I am sure with LaTeX you could implement most of your layout requirements, even the unusual. The latter may require to look deeper inside the source, especially the documentclasses and the LaTeX sources.
Concerning text sizes, you may use \fontsize and perhaps fix-cm, try this example:
\section, \subsection, \subsubsection etc. usually call \@startsection, so look at the parameters of \@startsection. But using the titlesec package may be easier. Regarding color you may look at the xcolor package.
I think if you had several different issues it would be a good idea to use a designated thread for the discussion of each issue.
Stefan
I am sure with LaTeX you could implement most of your layout requirements, even the unusual. The latter may require to look deeper inside the source, especially the documentclasses and the LaTeX sources.
Concerning text sizes, you may use \fontsize and perhaps fix-cm, try this example:
Code: Select all
\documentclass[a4paper,10pt]{article}
\usepackage{fix-cm}
\begin{document}
\centering
\fontsize{60}{70}\selectfont Huge text
\end{document}
I think if you had several different issues it would be a good idea to use a designated thread for the discussion of each issue.
Stefan
Section formatting headaches
Maybe you should take a look at the titlesec package.
Do not worry, LaTeX can produce the same (poor?) results.tipwire45 wrote:...have the same "look and feel" as when the document was produced in Word...
1,1,2,3,5,8,13,21,34,55,89,144,233,...
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Section formatting headaches
For section formatting and do about anything you want: use the titlesec package, together with xcolor. The xcolor package is quite powerful and lets you, e.g., mix colors.
Titlesec has a companion package,titletoc, which lets you customise the toc.
Finally, to obtain any size of font, you have to use postscript fonts (or ttf with a lower quality), you have to use low-level font commands,e.g., if you want a font at 60 pt, with an interline spacing of 72 pt, you just type:
\fontsize{60}{72}\selectfont.
I'll add that if you really want to mimick word, there exists a package for such a non professional result, called wordlike.
Regards,
B.A.
Titlesec has a companion package,titletoc, which lets you customise the toc.
Finally, to obtain any size of font, you have to use postscript fonts (or ttf with a lower quality), you have to use low-level font commands,e.g., if you want a font at 60 pt, with an interline spacing of 72 pt, you just type:
\fontsize{60}{72}\selectfont.
I'll add that if you really want to mimick word, there exists a package for such a non professional result, called wordlike.
Regards,
B.A.
- tripwire45
- Posts: 129
- Joined: Thu Apr 10, 2008 4:35 am
Section formatting headaches
Thanks, everyone. Sorry about the "shotgun approach" to asking for help, here. Frankly, I'm in something of "panic mode" at the moment. It's not that there isn't enough documentation regarding LaTeX and such and it's not like I don't feel like, in time, I could pick up more than the basics, it's a matter of timing. The document in question needs to be completely converted ASAP so it can be updated regarding the company's latest incarnation of its product. That job has fallen on me.Stefan_K wrote:I think if you had several different issues it would be a good idea to use a designated thread for the discussion of each issue.
I am meeting with the developer who "talked me into" using LaTeX this morning to compare my current efforts to the stated goal and see what the best approach is. Hopefully, between all my resources (this forum included), I'll be able to ramp up to the speed and skill level I need to get the job done.
In the meantime, I'll implement your suggestions and see how the apply to my document.
Cheers.
-Trip
- tripwire45
- Posts: 129
- Joined: Thu Apr 10, 2008 4:35 am
Section formatting headaches
Sorry to "piecemeal" you again, but I've been researching and practising with \usepackage{titlesec} and \titleformat and have come up with some promising results for my sections. I managed to get the section heads bigger and to become bold but came across something unanticipated...The font of the section is two low for the word "Contents" in the table of contents. It's fine for the actual first section, but the next section is made up of two words and one is on top of the other, rather than side by side.
I started using examples from the titlesec documentation and what I could find in The LaTeX Companion, Second Edition and came up with this:
There was some unneeded bits, since I have removed numbering by using so I ended up with this:
I'm posting my sample document source so you can have a look for yourselves. What I need is for the section text to be inline (no splitting between the first and second word) and coloring it green (olive green would be nice) would be helpful.
I started using examples from the titlesec documentation and what I could find in The LaTeX Companion, Second Edition and came up with this:
Code: Select all
\usepackage{titlesec}
\titleformat{\section}[leftmargin]{\Huge\bfseries}
{\S\,{thesection}{.5em}{}[\quad]
Code: Select all
\setcounter{secnumdepth}{-2}
Code: Select all
\titleformat{\section}[leftmargin]{\Huge\bfseries}
{}{}{}[]
Code: Select all
\documentclass[12pt]{article}
\usepackage{verbatim,textcomp}
\usepackage[pdftex]{color,graphicx}
\usepackage[table]{xcolor}
\usepackage{fixltx2e}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{array,booktabs}
\usepackage{multirow}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{makeidx}
\usepackage[pdftex,colorlinks=true,linkcolor=black,urlcolor=blue]{hyperref}
\usepackage{titlesec}
\titleformat{\section}[leftmargin]{\Huge\bfseries}
{}{}{}[\quad]
\renewcommand{\labelitemii}{$\circ$}
\setcounter{secnumdepth}{-2}
\makeindex
\begin{document}
\begin{titlepage}
\begin{center}
% Upper part of the page
\textcolor{red}{\textsc{\Huge \textbf{User Guide}}}\\[1cm]
\end{center}
\end{titlepage}
\pagenumbering{roman}
%create a copyright page as a separate page
\vspace*{\fill}
\begingroup
\centering
Copyright \copyright 2008\\
by Inc.\\
All Rights Reserved\\
\endgroup
\vspace*{\fill}
\newpage
% insert the table of contents
\tableofcontents
\newpage
\pagenumbering{arabic}
%Chapter 1
\section{Welcome}
\subsection*{Using this guide}
\paragraph{} The User Guide has information and instructions for all users of the application. This guide
will help you:
\begin{itemize}
\item Understand what a host-based application is.
\item Log into the application.
\item Navigate the website.
\item Provide general user tips.
\item Identify the different users.
\item Apply the methods for managing the user environment.
\item Explain the thresholds.
\item Manage the queue.
\item Use reports.
\item Understand setup.
\end{itemize}
\newpage
\section{Getting Started}
\begin{itemize}
\item Workstation requirements
\item Logging into the Web Console
\item Overview of the site navigation
\item Basic use tips
\end{itemize}
\end{document}
- tripwire45
- Posts: 129
- Joined: Thu Apr 10, 2008 4:35 am
Section formatting headaches
Well, I've narrowed things down. This will make the section text the right size and color and position as far as not splitting words and not positioning the text too low. However, it needs to be against the left margin:
The minute I add "[leftmargin]", the text *does* move left, but it loses the green color and the problem with positioning of the text (splitting words and positioning section text too low) returns.
Oh, I defined "webgreen" based on another thread on this forum (I've been doing some searching) as: in the preamble. Here's the thread I've been looking at for reference:
http://www.latex-community.org/viewtopic.php?f=5&t=548
Code: Select all
\titleformat{\section}[leftmargin]
{\color{webgreen}\normalfont\Huge\bfseries}{}{}{}
Oh, I defined "webgreen" based on another thread on this forum (I've been doing some searching) as:
Code: Select all
\definecolor{webgreen}{rgb}{0,.65.75,0}
http://www.latex-community.org/viewtopic.php?f=5&t=548
- tripwire45
- Posts: 129
- Joined: Thu Apr 10, 2008 4:35 am
Section formatting headaches
This is interesting. The following changes *do* move the first section title to the correct position, but it takes away the green color, puts the word "Contents" in the toc too low again, and breaks the two words in the second section apart, placing them too low.
Code: Select all
\titleformat{\section}[leftmargin]
{\color{webgreen}\filright\normalfont\Huge\bfseries}{}{}{}
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Section formatting headaches
Hi Trip,
I understand, you want to move the section title to the left? One idea without [leftmargin], setting negative horizontal space before the title:
Stefan
I understand, you want to move the section title to the left? One idea without [leftmargin], setting negative horizontal space before the title:
Code: Select all
\titleformat{\section}
{\color{webgreen}\normalfont\Huge\bfseries}{}{}{\hspace*{-12pt}}