3

I'm writing a rather extensive report in LaTeX in which I have some specific preferences for my section titles. For example, I want the titles to be in upper-case using the \textsc{..} command. If I include,

\usepackage[T1]{fontenc}

I am able write,

\section{\textsc{Some Section Title}} % works fine, however ...

My document is large and it would be really nice if I could redefine \section{} to automatically include \textsc{}. I'm happy to consider some other alternative to \textsc{}, if such exists.

Note that I have no experiance with the '\renewcommand', so working examples are much appriciated! Thanks!

Adding an MWE as requested,

\documentclass[12pt, twocolumn]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}             % ENABLES \textsc{} INSIDE \section{}
\usepackage{mathrsfs,amsmath,amssymb}
\usepackage{sectsty}

\renewcommand{\thesection}{\Roman{section}} 
\renewcommand{\thesubsection}{\Roman{subsection}}
\allsectionsfont{\centering}

% IMPORTANT:
% Now, my section titles are centered, and have roman numbering.
% .. but I would also like to have them written in upercase.

\title{The most awesome title ever!}
\author{My name and stuff}
\date{2014}

\begin{document}
\maketitle

\section{\textsc{Section nr. 1}}
% THIS WORKS, but ...
Some text ...    

\section{Section nr. 2}
% I would like to write this with the same result
Some text ...    


\end{document}
4
  • 1
    Welcome to TeX.SX! Can you provide a minimal working example (MWE). The way to do this depends on which document class you are using. Oct 6, 2014 at 6:33
  • @ChrisS, It does indeed look promising. However could you please help me modify it? How to change "\allsectionsfont{\normalfont\scshape}" to make upper-case. I thought \scshape would do this, but apparently this doesn't work for me (compiles, but titles are still small case)
    – Wololo
    Oct 6, 2014 at 6:50
  • You're already using sectsty, so turn your \allsectionsfont{\centering} into \allsectionsfont{\centering\mdseries\scshape}. The \mdseries turns off boldface.
    – ChrisS
    Oct 6, 2014 at 6:52
  • Perfect, solves my problem! Do you think I should the delete question due to double question?
    – Wololo
    Oct 6, 2014 at 6:54

1 Answer 1

1

As hinted by ChrisS, a solution to my question could be made out of this post: Small caps in section but not in ToC

Resulting in the final solution for making the \section{} command automatically creating centered, uppercase titles with roman numbering ...

\usepackage{sectsty}

\renewcommand{\thesection}{\Roman{section}} 
\renewcommand{\thesubsection}{\Roman{subsection}}
\allsectionsfont{\centering\mdseries\scshape}

Not the answer you're looking for? Browse other questions tagged .