Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using the outlines package, and I'm curious to know how to modify the font properties of the text at different levels. For example, how can I make text beside \1 bold and small-caps and slightly larger than the normal size? And how can I make text beside \2 bold?

That is, I want to change this:

\begin{outline}[enumerate]
\1 Cat
    \2 Tiny cat
    \2 Medium cat
\1 Dog
    \2 Big dog
        \3 Types of big dogs
\end{outline}

to this:

\begin{outline}[enumerate]
\1 \textsc{\textbf{ \LARGE Cat}}
    \2 \textbf{Tiny cat}
    \2 \textbf{Medium cat}
\1 \textsc{\textbf{ \LARGE Dog}}
    \2 \textbf{Big dog}
        \3 Types of big dogs
\end{outline}

But without having to specify the font options for every item.

Here's a working example:

\documentclass[11pt,a4paper]{article}        
\usepackage{outlines}

\begin{document}

\begin{outline}[enumerate]
\1 Cat
    \2 Tiny cat
    \2 Medium cat
\1 Dog
    \2 Big dog
        \3 Types of big dogs
\end{outline}

\begin{outline}[enumerate]
\1 \textsc{\textbf{ \LARGE Cat}}
    \2 \textbf{Tiny cat}
    \2 \textbf{Medium cat}
\1 \textsc{\textbf{ \LARGE Dog}}
    \2 \textbf{Big dog}
        \3 Types of big dogs
\end{outline}

\end{document}
share|improve this question
1  
Please complete your code so that it constitutes a Minimal Working Example i.e. a complete small document. Complete code is much more useful than mere fragments. –  cfr Apr 12 at 22:24
    
Thanks for adding your MWE. Please see if my answer approximates the kind of thing you are looking for. Note that I added fontenc since the small-caps failed to materialise without switching to T1. –  cfr Apr 12 at 22:45

2 Answers 2

up vote 2 down vote accepted

Do you want something like this?

Cats, dots and goldfish

\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage{outlines}
\makeatletter
\newenvironment{myoutline}[1][]{%
  \ifthenelse{\equal{#1}{}}{}{\renewcommand{\ol@type}{#1}}%
  \ol@z%
  \newcommand{\0}{\ol@toz\ol@z}%
  \newcommand{\1}{\ol@toi\scshape\bfseries\LARGE\ol@i\item}%
  \newcommand{\2}{\ol@toii\normalfont\normalsize\bfseries\ol@ii\item}%
  \newcommand{\3}{\ol@toiii\normalfont\normalsize\ol@iii\item}%
  \newcommand{\4}{\ol@toiiii\normalfont\normalsize\ol@iiii\item}%
}{%
  \ol@toz\ol@exit%
}
\makeatother

\begin{document}

\begin{myoutline}[enumerate]
  \1 Cat
      \2 Tiny cat
      \2 Medium cat
  \1 Dog
      \2 Big dog
          \3 Types of big dogs
      \2 Another large dog
      \2 A similarly sized dog
      \2 An enormous goldfish belongs here, too
\end{myoutline}

\end{document}
share|improve this answer
    
Why did you add this line? \usepackage[T1]{fontenc} –  synaptik Apr 13 at 0:35
    
@synaptik My \scshape seemed to have no effect otherwise. Besides, T1 is far superior to OT1 so it should be there anyway ;). –  cfr Apr 13 at 1:03
    
@crf your solution doesn't work for me for the non-first \2 entries. Only the first \2 entry is modified. –  synaptik Apr 13 at 1:11
    
@synaptik Not sure what to say without seeing the error or whatever. I get the output I posted ;) i.e. it works for all the \2s. –  cfr Apr 13 at 1:15
    
@crf See what I just added to my original question.... the "blah blah" text –  synaptik Apr 13 at 1:15

You can redefine the commands for each of the levels:

enter image description here

Code:

\documentclass[11pt,a4paper]{article}        
\usepackage{outlines}

\begin{document}

\begin{outline}[enumerate]
\let\OldOne\1%
\let\OldTwo\2%
\let\OldThree\3%
\renewcommand*{\1}{\normalsize\normalfont\OldOne\bfseries\Large\scshape}%
\renewcommand*{\2}{\normalsize\normalfont\OldTwo\bfseries}%
\renewcommand*{\3}{\normalsize\normalfont\OldThree\small}%
\1 Cat
    \2 Tiny cat
    \2 Medium cat
        \3 Types of big cats
        \3 Types of bigger cats
\1 Dog
    \2 Big dog
        \3 Types of big dogs
        \3 Types of bigger dogs
\end{outline}

\end{document}
share|improve this answer
    
This solution doesn't work for the very first level, the first 1. The numeral size is smaller than the other \1 levels. Why is that? –  synaptik Apr 13 at 1:07
    
@synaptik I think the numeral is typeset before the font switch with this method. To get consistent numbering you need to add \normalsize to \normalfont but the labels will not match the size or weight of the following text in that case. –  cfr Apr 13 at 1:32
    
@synaptik Also, it doesn't work for the first item of the third level. This is more obvious if you add a second \3. –  cfr Apr 13 at 1:42
    
@GonzaloMedina: Thanks. Have corrected it. –  Peter Grill Apr 13 at 2:46
    
@synaptik: I am not sure exactly what is not working. Can you try the new updated code and let me know. –  Peter Grill Apr 13 at 2:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.