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 can't figure out how to line up the symbols of an itemize environment in beamer with the left part of the main text. In other words, I would like to supress the left margin in beamer itemize lists.

It would be nice if the solution worked with any itemize label defined with

\setbeamertemplate{itemize item}[]

In order to make myself clearer, what beamer produces by default is something like:

Main text. Main text. Main text...
   * Item 1
   * Item 2
   * Item 3
   ....

and the desired result is

Main text. Main text. Main text...
* Item 1
* Item 2
* Item 3
....
share|improve this question
2  
Welcome to tex.sx! A tip: If you indent a line by 4 spaces, then it's marked as a code sample. –  Hendrik Vogt Nov 25 '10 at 13:20

2 Answers 2

The beamer class uses the same default lengths for the left margin like the base classes: \leftmargini, \leftmarginii etc. So you could adjust those lenghts. For instance:

\setlength{\leftmargini}{0pt}

You may insert any value instead of 0pt that fits for you.

Further requirements might require a redefiniton or patch of beamer's itemize environment. If you would like to have such complete control over the itemize environment, you could redefine it this way within your preamble:

\makeatletter
\renewcommand{\itemize}[1][]{%
  \beamer@ifempty{#1}{}{\def\beamer@defaultospec{#1}}%
  \ifnum \@itemdepth >2\relax\@toodeep\else
    \advance\@itemdepth\@ne
    \beamer@computepref\@itemdepth% sets \beameritemnestingprefix
    \usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
    \usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
    \usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
    \list
      {\usebeamertemplate{itemize \beameritemnestingprefix item}}
      {\def\makelabel##1{%
          {%
            \hss\llap{{%
                \usebeamerfont*{itemize \beameritemnestingprefix item}%
                \usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
          }%
        }%
      }
  \fi%
  \beamer@cramped%
  \raggedright%
  \beamer@firstlineitemizeunskip%
}
\makeatother

Until now it's just a copy of the original! But since it's in your preamble, you can modify it.

For example, replace \hss\llap by \rlap and the bullets will align with the text around:

...
      {\def\makelabel##1{%
          {%
            \rlap{{%
                \usebeamerfont*{itemize \beameritemnestingprefix item}%
...

Within this redefinition you could adjust the LaTeX list length macros. This requires to know how to work with the LaTeX list environment.

share|improve this answer
    
Thanks Stefan, but your code hangs the item labels out into the margin and this is not what I want. Of course, I could change the left margin to a nonzero value, but how could I do it sistematically for itemize lists with any label? –  rgallego Nov 25 '10 at 17:39
    
@rgallego: I added a redefinition which could give you a start. If you should have a question regarding LaTeX's list environment, you may post it on the site as well. –  Stefan Kottwitz Nov 25 '10 at 18:02
    
This does only seem to align the bullet-points, but the text of the items is still placed on the same position, which leaves an ugly gap between the bullet-points and the text. Is there a way to change that too? –  Flow Mar 1 '13 at 12:17
    
Where do I put the code \setlength{\leftmargini}{0pt}? –  LWZ Sep 7 '13 at 7:42
    
@LWZ Into the preamble, as usual. –  Stefan Kottwitz Sep 7 '13 at 9:31
\leftmargini=10 %(the value 10 works well for me, but you can changed it )
\begin{itemize}
\item one
\item two

.....
\end{itemize}
share|improve this answer
1  
Welcome to TeX.SX! Please provide full examples instead of fragments of code, with a screen shot –  Christian Hupfer Nov 27 at 12:07
    
Welcome to TeX.SX! As it stands this is just a subset of the answer given by Stefan KottWitz, and should at most be a comment on that answer. –  Andrew Swann Nov 27 at 14:22

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.