Text FormattingBullets (itemized) INSIDE A TabularX Cell

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
InquisitorMo
Posts: 44
Joined: Mon Jul 15, 2013 12:22 am

Bullets (itemized) INSIDE A TabularX Cell

Post by InquisitorMo »

There are a few examples of this online, but they have been quite complex, and I haven't really been able to use them solve my particular issue.

1. I am trying to, quite simply, get a bulleted list inside a table cell (I set up a table using tabularx).

2. So far, I am able to create an itemized list with bullets inside one of the table cells, but I have formatting issues (I don't know how to set the margins, for example, of where the bullet aligns, so they keep adding vertical space AND indenting far into the cell). I know the vertical space thing at least is apparently a widely discussed subject, as I've seen it referred to in several places.

3. In order to create said bullets (let's say in the middle cell of a 3 column table)... I need to write:

{} & \begin{itemize} \item MY BULLETED TEXT \end{itemize} & {}

inside every cell for each bullet I want to create... I'm sure there are numerously better ways to do this?
Last edited by cgnieder on Sat Jul 20, 2013 3:34 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.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Bullets (itemized) INSIDE A TabularX Cell

Post by Johannes_B »

Please provide a Minimal Working Example, in order to specify your problem and give us some code to test. Right now i could only guess, what you mean exactly.
Please follow the link and read the instructions.
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: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Bullets (itemized) INSIDE A TabularX Cell

Post by Stefan Kottwitz »

You could use the compactitem environment of the paralist package.

Try:

Code: Select all

\documentclass{article}
\usepackage{tabularx}
\usepackage{paralist}
\makeatletter
\let\savespace\@minipagetrue
\makeatother
\begin{document}
\begin{tabularx}{0.5\textwidth}{|p{2cm}|X|}
  \hline & \savespace
    \begin{compactitem}
        \item First item
        \item Second item
    \end{compactitem} \\
  \hline
\end{tabularx}
\end{document}
Do you need itemize environments in all cells of a whole column?

As Johannes said, it would be good if you would post real code which can be worked on. Then there's a very good chance that somebody would check it and could offer you a solution.

Stefan
LaTeX.org admin
InquisitorMo
Posts: 44
Joined: Mon Jul 15, 2013 12:22 am

Bullets (itemized) INSIDE A TabularX Cell

Post by InquisitorMo »

Here is my extracted MWE - As you can see, I have managed to get the bullet working inside the table, but with problems:

1. I can't get rid of that large vertical space it adds to the bullet (which you can see doesn't add to the right cell normal text)

2. I want to set the margins as I did on the first bullet (but don't want to have to write all those parameters every time I want a bullet) - I'm assuming I can define some sort of command which does this?

3. Finally, my actual table is more complex (it looks something like the one commented out) - I have NOT been able to replicate these bullets in THAT table...

4. I don't know how to get a snapshot of the compiled code and place it here on the forum...?

Code: Select all

\documentclass{article}

\usepackage{paralist}
\usepackage{tabularx}
\usepackage{enumitem}

\begin{document}

%\newcolumntype{R}{>{\raggedleft\arraybackslash}X}%
%\begin{tabularx}{\textwidth}{ | p{0.5in} | p{3in} | R | } 

%\begin{tabularx}{\textwidth}{l l l}

\begin{tabularx}{\textwidth}{| p{6cm} | p{2cm} |}

\begin{itemize}[leftmargin=10pt, labelindent=0pt, itemindent=0pt]



 \item The bullet is here... \end{itemize}& {I want the bullet without any space above it like here}\\
 
\begin{itemize}\item more text on this line\end{itemize} & {more text in this column}\\

\end{tabularx}

\end{document}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Bullets (itemized) INSIDE A TabularX Cell

Post by Stefan Kottwitz »

You can post a screenshot as attachment to a forum post. For this, click on "Upload attachment" below the text edit field when writing. Try to make it small so it would easily fit on a small screen to.

What about my suggestion with compactitem? And my question regarding a whole column or not?

Stefan
LaTeX.org admin
InquisitorMo
Posts: 44
Joined: Mon Jul 15, 2013 12:22 am

Bullets (itemized) INSIDE A TabularX Cell

Post by InquisitorMo »

This is the output produced by the example above..., but note this is NOT the table I am actually trying to format.

I only need the bullets in one of the columns (though I'd be interested in learning how to put them wherever I want...
Screen Shot 2013-07-20 at 2.53.30 PM.png
Screen Shot 2013-07-20 at 2.53.30 PM.png (34.8 KiB) Viewed 25537 times
Last edited by cgnieder on Sun Jul 21, 2013 2:11 pm, edited 1 time in total.
InquisitorMo
Posts: 44
Joined: Mon Jul 15, 2013 12:22 am

Re: Bullets (itemized) INSIDE A TabularX Cell

Post by InquisitorMo »

Also - I haven't tried compactitem because at this point I don't really know what I'm doing... I also didn't want to add another package that I don't know how to use to an already complicated problem. I thought I would try to fix this first before adding trying another package?

1. I am unable to get the bullets formatted (margin wise) the way I want in a simple table - as shown above in the example.

2. But I am then unable to get the bullets to work at ALL in the more complex table in the comments above (which involves a forced right justify in the right column, and a fixed width left column.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Bullets (itemized) INSIDE A TabularX Cell

Post by Stefan Kottwitz »

Well, so I suggest to try that package. This compactitem environment of the paralist package is for compact lists. Also the enumitem package an be used for such customization.

There are thousands of LaTeX packages doing tasks which are hard to directly program in LaTeX. That's a strength of LaTeX. I don't see a reason in not trying a package except wanting to save the time reading the documentation. No problem, you can program it instead of just using a ready-made package, if you would like to spend that time instead. I know that it's wasted time, so I don't invent the wheel again. ;-)

Stefan
LaTeX.org admin
InquisitorMo
Posts: 44
Joined: Mon Jul 15, 2013 12:22 am

Re: Bullets (itemized) INSIDE A TabularX Cell

Post by InquisitorMo »

Ok I'll try those packages - but should I try them in the simple table first... and THEN try them in my more complex table?

In other words - if I figure out how to get them working in the simple table, will that method ALSO work in the 'complex' table I actually need them in?

I'm obviously finding that I can get the bullets in one kind of simple table, but not in the one I actually want them to work in.

I WOULD post a code example, but I just have no idea how to nest the bullets in the table with the 'ragged left edge' to begin with...

I tried just using braces to put the bullets "inside" the "cell" in the table - but that doesn't work...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Bullets (itemized) INSIDE A TabularX Cell

Post by Stefan Kottwitz »

InquisitorMo wrote:In other words - if I figure out how to get them working in the simple table, will that method ALSO work in the 'complex' table I actually need them in?
I guess it jut depends on the definition of the column. If it's a similar column style, it should work. I guess you need a paragraph style for such a column, such as p, m or b, the latter two with the array package.
InquisitorMo wrote:I WOULD post a code example, but I just have no idea how to nest the bullets in the table with the 'ragged left edge' to begin with...

I tried just using braces to put the bullets "inside" the "cell" in the table - but that doesn't work...
Generally it's good to post code. Otherwise it's quite theoretical and hard to guess what might be wrong or what should be changed. I guess also you would prefer to know the code change instead of a vague description.

By the way, using the >{} and <{} it would be possible to make a whole column full of itemize or compactitem environments.

Stefan
LaTeX.org admin
Post Reply