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.

how to add the blacksquare before the caption in LaTeX?

just like the itemize, but at the caption

1. Introduction

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

Something like this?

\documentclass{article}
\usepackage{amssymb}

\makeatletter
\renewcommand{\section}{\@startsection
{section}%                   % the name
{1}%                         % the level
{0mm}%                       % the indent
{-\baselineskip}%            % the before skip
{0.5\baselineskip}%          % the after skip
{$\blacksquare$~\bfseries\Large}} % the style
\makeatother

\begin{document}
\section[foo]{MySection}
\end{document}

enter image description here

share|improve this answer
1  
You really shouldn't use \bf (see l2tabu). The article class uses \bfseries to switch to bold instead. –  Roelof Spijker Oct 26 '11 at 11:20
    
@wh1t3: right. I fixed it. –  Axioplase Oct 26 '11 at 11:24
add comment

You could use the titlesec package for customizing heading format and spacing, especially if there would be further requirements. Load the package, and use \titleformat for the format and \titlespacing for the spacing, described in the titlesec documentation.

Example:

\documentclass{article}
\usepackage{amssymb}
\usepackage{titlesec}
\titleformat{\section}
  {\normalfont\Large\bfseries}{\textbullet\thesection}{1em}{}
\begin{document}
\section{Introduction}
Text of introduction
\end{document}

enter image description here

Here you get a bullet as in itemize. For a black square, perhaps use \blacksquare of the amssymb package, as Axioplase wrote.

share|improve this answer
add comment

If you mean the chapter heading, have a look at my answer to this question. That should be relatively easy to modify for your purposes, once you know that itemize uses a \textbullet by default.

For the section headings you can renew the \section command, which uses the \@startsection macro as follows:

\makeatletter
\renewcommand{\section}{\@startsection
{section}%                   % the name
{1}%                         % the level
{0mm}%                       % the indent
{-\baselineskip}%            % the before skip
{0.5\baselineskip}%          % the after skip
{\normalfont\Large\bfseries\textbullet}} % the style
\makeatother
share|improve this answer
add comment

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.