0

i use itemize in posterbox. And space between items is different. When i add "\vspace*{xcm}, right alignment is changed.

My MWE:

\documentclass{article}
\usepackage{tikz}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usetikzlibrary{positioning}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{bbding}
\usepackage{pifont}

\newcommand*\cir[1]{\tikz[baseline=(char.base)]{
          \node[shape=circle,draw,inner sep=2pt] (char) {#1};}}

\begin{document}
\begin{tcbposter}[
  poster = {
    columns=1,
    rows=2,
    spacing=3mm,
    height=14cm,
    width=12cm,
  },
  ]
  \posterbox[
  colframe = red,
  width=4cm, height= 3cm
  ]
  {column=1}{
  \vspace*{-0.3cm}

  \begin{itemize}
  \item a  \hfill \textcolor{blue}{\ding{52}}

    \vspace*{0.4cm}
   \item b \hfill 
   \textcolor{red}{\ding{55}}
   \vspace*{-0.3cm}
   \item c  \hfill \textcolor{blue}
{\tiny{\cir{C}}}
\textcolor{red}{\ding{55}}

  \end{itemize}
  }
\end{tcbposter}
\end{document}

I need your solution for: 1/ right aligment, with different space between items (use vspace or alternativ)

2/ right margin reduced: ex: 2mm

enter image description here Thanks

latexforti
  • 2,091

1 Answers1

2

Once again, I tell you that you don't have to (and should not) use tcbposter here. In fact, tcbposter is like a table of tcolorboxes, but here there is only one tcolorbox added (via \posterbox), so why do you use tcbposter (at all)? A single, simple tcolorbox is enough.

You may notice that there is a white space after \ding{}. You can get rid of it by the magical end-line % character.

I use enumitem with leftmargin option to the itemize list to customize the spacing before the list.

Code:

\documentclass{article}
\usepackage{tikz}
\usepackage{tcolorbox}
\usepackage{xcolor}
\usepackage{bbding}
\usepackage{pifont}
\usepackage{enumitem}
\newcommand*\cir[1]{%
    \tikz[baseline=(char.base)]{
        \node[shape=circle,draw,inner sep=2pt] (char) {#1};
    }}
\begin{document}
\begin{tcolorbox}[colframe=red,width=4cm,height=3cm]
\begin{itemize}[leftmargin=1em]
\item a \hfill \textcolor{blue}{\ding{52}}%
\vspace*{0.4cm}
\item b \hfill \textcolor{red}{\ding{55}}%
\vspace*{-0.3cm}
\item c \hfill \textcolor{blue}{\tiny{\cir{C}}} \textcolor{red}{\ding{55}}%
\end{itemize}
\end{tcolorbox}
\end{document}

enter image description here


If you have to use tcbposter, just put the above tcolorbox to a \posterbox:

\documentclass{article}
\usepackage{tikz}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{xcolor}
\usepackage{bbding}
\usepackage{pifont}
\usepackage{enumitem}
\newcommand*\cir[1]{%
    \tikz[baseline=(char.base)]{
        \node[shape=circle,draw,inner sep=2pt] (char) {#1};
    }}
\begin{document}
\begin{tcbposter}[
  poster = {
    columns=1,
    rows=2,
    spacing=3mm,
    height=14cm,
    width=12cm,
  },
]
\posterbox[colframe=red,width=4cm,height=3cm]{column=1}{
    \begin{itemize}[leftmargin=1em]
    \item a \hfill \textcolor{blue}{\ding{52}}%
    \vspace*{0.4cm}
    \item b \hfill \textcolor{red}{\ding{55}}%
    \vspace*{-0.3cm}
    \item c \hfill \textcolor{blue}{\tiny{\cir{C}}} \textcolor{red}{\ding{55}}%
\end{itemize}}
\end{tcbposter}
\end{document}

(same output as above)

But you may have noticed the warning. It may be ignored, but should not be ignored.