Text FormattingHow to center itemize?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
mabe83
Posts: 8
Joined: Sat Oct 23, 2010 6:51 pm

How to center itemize?

Post by mabe83 »

Hi!

I want to center an itemize block, related to the page. For example this one:

Code: Select all

\begin{itemize}
	\item[recall] = $TP/(TP+FN)$
	\item[precision] = $TP/(TP+FP)$
	\item[TP rate] = recall
	\item[FP rate] = $FP/(FP+TN)$
\end{itemize}
Unfortunately, typical things like \center don't work. Moreover, I tried to put it into minipage, parbox etc. but without success.

Thanks in advance!
Last edited by mabe83 on Sat Oct 23, 2010 10:19 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

How to center itemize?

Post by meho_r »

Do you really have to use itemize environment for this purpose? Why not using, e.g., align environment:

Code: Select all

\documentclass{article}

\usepackage{amsmath}

\newcommand{\lbr}[1][6]{\displaybreak[1]\\[#1pt]}% a command to simplify optional line break in the midst of an equation, with a default value of 6pt

\begin{document}

\begin{align*}
\text{recall} &= TP/(TP+FN)\lbr
\text{precision} &= TP/(TP+FP)\lbr
\text{TP rate} &= \text{recall}\lbr[12]% manually inserted vertical spacing, 12pt
\text{FP rate} &= FP/(FP+TN)
\end{align*}

\end{document}
P.S. To allow an equation to be broken across pages, use \displaybreak or \allowdisplaybreak commands (take a look at amsmath manual, section 3.9).
mabe83
Posts: 8
Joined: Sat Oct 23, 2010 6:51 pm

Re: How to center itemize?

Post by mabe83 »

Great job :) Works really good! amsmath is new to me. Thank you very very much!!!
Post Reply