Text Formattingenumeration goes out the text area

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Zoran S
Posts: 9
Joined: Thu Dec 11, 2014 6:20 am

enumeration goes out the text area

Post by Zoran S »

In class book, when I use the environment enumerate (say with roman numbers) it appears that these numbers step into the left margin. How to move them to the right?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

enumeration goes out the text area

Post by Johannes_B »

Hi,

i am not completely sure what you mean. Can you show us in form of a small compilable example?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: enumeration goes out the text area

Post by Stefan Kottwitz »

I can imagine what you mean, it seems like a wrong or undesired setting of the enumerate label. This could be done by a class, a package or a specific setting in your preamble. We could fix that easily, we just need to know your code. So I suggest, follow Johannes' advice and post a shortened (still compilable) sample code which produces that effect. Just a reduced copy of your code. Click on Johannes' link above to learn why and how, perhaps. Once we got code, we can fix it for sure.

Stefan

PS: welcome to the forum! I noticed it is your second post. :)
LaTeX.org admin
Zoran S
Posts: 9
Joined: Thu Dec 11, 2014 6:20 am

enumeration goes out the text area

Post by Zoran S »

In the preamble I have this:

Code: Select all

\documentclass{cambridge7A}

\def\makeRRlabeldot#1{\hss\llap{#1}}
\renewcommand\theenumi{{\rm (\roman{enumi})}}
\renewcommand\theenumii{{\rm (\alph{enumii})}}
\renewcommand\theenumiii{{\rm (\arabic{enumiii})}}
\renewcommand\theenumiv{{\rm (\Alph{enumiv})}}

Later I have something like this:

\begin{enumerate}[(ii)]
    \item $\lambda_1(G(k,l))>\lambda_1(G(k+1, l-1))$,
    \item $\lambda_n(G(k,l))\leq\lambda_n(G(k+1, l-1))$,
    \item $\mu_1(G(k,l))\geq\mu_1(G(k+1,l-1))$,
    \item $\mu_{n-1}(G(k,l))\geq \mu_{n-1}(G(k+1,l-1))$,
    \item $\kappa_1(G(k,l))> \kappa_1(G(k+1,l-1))$,
    \item $\kappa_n(G(k,l))\geq \kappa_1(G(k+1,l-1))$.
\end{enumerate}
And this produces:
pic.jpg
pic.jpg (141.92 KiB) Viewed 3836 times
You can see that the numbers, specially (iii), are not aligned with the text.
Last edited by Stefan Kottwitz on Thu Dec 11, 2014 5:53 pm, edited 2 times in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

enumeration goes out the text area

Post by Stefan Kottwitz »

Hi Zoran,

with a compilable example we would have been faster with providing a solution. So I needed to find some time to build an example on my own, using your code snippets.

Anyway, here's a solution with enumitem. Perhaps your preamble or your class already loads it. I used the article standard class.

Here, I put a label to the line with the widest label. It will be taken for calculating the width. Just ensure to compile twice, because it needs to find the reference for the label generated in the first run. I inserted a wide dash into the label just to see how it behaves width wider one.

Code: Select all

\documentclass{article}
\usepackage[shortlabels]{enumitem}
\usepackage{calc}
\begin{document}
\section{Test}
Text
\begin{enumerate}[label=(\roman*---),labelindent=0pt,
    labelwidth=\widthof{\ref{widest}},itemindent=1em,leftmargin=!]
  \item $\lambda_1(G(k,l))>\lambda_1(G(k+1, l-1))$,
  \item $\lambda_n(G(k,l))\leq\lambda_n(G(k+1, l-1))$,
  \item $\mu_1(G(k,l))\geq\mu_1(G(k+1,l-1))$,\label{widest}
  \item $\mu_{n-1}(G(k,l))\geq \mu_{n-1}(G(k+1,l-1))$,
  \item $\kappa_1(G(k,l))> \kappa_1(G(k+1,l-1))$,
  \item $\kappa_n(G(k,l))\geq \kappa_1(G(k+1,l-1))$.
\end{enumerate}
\end{document}
list.png
list.png (24.27 KiB) Viewed 3816 times
You can see, the widest label is aligned to the left margin.

Stefan
LaTeX.org admin
Zoran S
Posts: 9
Joined: Thu Dec 11, 2014 6:20 am

Re: enumeration goes out the text area

Post by Zoran S »

Thanks. It seems that

\begin{enumerate}[labelindent=2pt]
\item sss
\item ddd

\end{enumerate}

also resolves the problem.
Post Reply