1

[EDIT!] I changed my code to:

\documentclass[10pt]{article}
\usepackage[a4paper, left=2cm,top=0.8cm,right=2cm,bottom=3.3cm,headheight=61pt, footskip=61pt, includehead]{geometry}
\usepackage[default]{opensans}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[ngerman]{babel}
\usepackage{multicol}
\usepackage{tabularx}

\newcommand{\cvTabItem}{\hspace{2px}\includegraphics[width=0.3cm]{images/bullet.png}\hspace{5px}}

\begin{document}

\begin{multicols*}{2}
\begin{center}
    \setlength{\tabcolsep}{5pt}
    \begin{tabularx}{\linewidth}{@{}lX@{}}
        \cvTabItem 2015 – 2019 & Studium in der Fachrichtung „B.Sc. - Computervisualistik“ an der Universität Koblenz-Landau. Schwerpunkt auf Bildverarbeitung und Computergrafik.\\
    \end{tabularx}
    \end{center}
\end{multicols*}
\end{document}

So I used the tabularx line from David's answer. But now I get a underfull \hbox?

[EDIT END]

I use following code to get a tabular with a custom itemize icon in a multicol. (I hope it is understandable). In the full example I have more code, thats why my \usepackage-list is that long.

So my question is why do I get a \overfull warning and how can I fix that? I have read some similar questions, but I can't find a solution for my situation.

\documentclass[10pt]{article}
\usepackage[export]{adjustbox}
\usepackage[a4paper, left=2cm,top=0.8cm,right=2cm,bottom=3.3cm,headheight=61pt, footskip=61pt, includehead]{geometry}
\usepackage[default]{opensans}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{csquotes}
\usepackage{anyfontsize}


\makeatletter
\renewcommand\LARGE{\@setfontsize\LARGE{18pt}{20}}
\setlength\parskip{0.7cm}
\renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}{-20px\@plus -30ex \@minus -.20px}{2px \@plus .5em}{\normalfont\MakeUppercase}}
\makeatother

\newcommand{\minsp}{%
  \vspace{-0.7cm}
}%
\newcommand*{\cvItem}{\item[{\rule{0.44cm}{0.32cm}}]}
\setlist[itemize]{leftmargin=15px,parsep=0pt} % Einrückung Bullets in Liste

%Command for Subitem
\newcommand{\cvSubItem}[1]{%
  \begin{itemize}%
    \cvItem {#1}%
  \end{itemize}%
}%

%Command for Item in Tabular
\newcommand{\cvTabItem}[1]{%
  \setlist[itemize]{leftmargin=10px,parsep=0pt}%
  \begin{minipage}[t]{0.5\textwidth}\cvSubItem{#1}\end{minipage}
}

\begin{document}
    \begin{multicols}{2}
    \paragraph{Ausbildung:}
    \minsp
        \begin{center}
            \setlength{\tabcolsep}{5pt}
            \begin{tabular}{p{0.3\linewidth}p{0.6\linewidth}}
                \cvTabItem { 2015 – 2019 } & Das ist ein Test für eine mehrzeilige Tabelle in Verbindung einer Minipage zu Demonstrationszwecke. 
            \end{tabular}
        \end{center}
    \end{multicols}
\end{document}
6
  • 2
    the package list may be long in your real document but you should help people offering to help by removing every package not releated to the problem. *You can easily check before posting if you remove a packag ethat the issue is still shown) Commented May 29, 2021 at 19:56
  • we can not run this cde as it uses images/bullet.png} please use example-image or a \rule{1cm}{1cm} or whatever size shows the problem. Commented May 29, 2021 at 19:58
  • 1
    tabularx requires an X xcolumn, use tabular here \begin{tabularx}{\linewidth}{p{0.3\linewidth}p{0.6\linewidth}} should be \begin{tabular}{p{0.3\linewidth}p{0.6\linewidth}} Commented May 29, 2021 at 19:59
  • @DavidCarlisle thank you for your answers. I updated my question and I changed the tabularx to tabular. Now I just get the overfull \hbox warning.
    – Ramona K.
    Commented May 29, 2021 at 20:10
  • 1
    it is confusing for later readers if you edit partial solutions into the question as it leaves th eanswer answering questions they can no longer see Commented May 29, 2021 at 20:30

2 Answers 2

3

A version that can be run with no local files is

\documentclass[10pt]{article}

\usepackage[a4paper, left=2cm,top=0.8cm,right=2cm,bottom=3.3cm,headheight=61pt, footskip=61pt, includehead]{geometry}

\usepackage[default]{opensans}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[draft]{graphicx}
\usepackage[ngerman]{babel}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{multicol}

\makeatletter
\renewcommand\LARGE{\@setfontsize\LARGE{18pt}{20}}
\setlength\parskip{0.7cm}
\renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}{-20px\@plus -30ex \@minus -.20px}{2px \@plus .5em}{\normalfont\MakeUppercase}}
\makeatother

\newcommand{\minsp}{%
  \vspace{-0.7cm}%
}%
\newcommand*{\cvItem}{\item[{\includegraphics[width=0.3cm]{images/bullet.png}}]}
\setlist[itemize]{leftmargin=15px,parsep=0pt} % Einrückung Bullets in Liste

%Command for Subitem
\newcommand{\cvSubItem}[1]{%
  \begin{itemize}%
    \cvItem {#1}%
  \end{itemize}%
}%

%Command for Item in Tabular
\newcommand{\cvTabItem}[1]{%
  \setlist[itemize]{leftmargin=10px,parsep=0pt}%
  \begin{minipage}[t]{0.5\textwidth}\cvSubItem{#1}\end{minipage}
}

\begin{document}
    \begin{multicols}{2}
    \paragraph{Ausbildung:}
    \minsp
        %\label{par:ausbildung}
        \begin{center}
            \setlength{\tabcolsep}{5pt}
            \begin{tabularx}{\linewidth}{p{0.3\linewidth}p{0.6\linewidth}}
                \cvTabItem { 2015 – 2019 } & Das ist ein Test für eine mehrzeilige Tabelle in Verbindung einer Minipage zu Demonstrationszwecke. 
            \end{tabularx}
        \end{center}
    \end{multicols}
\end{document}

Firstly note that tabularx requites an X column,

 \begin{tabularx}{\linewidth}{p{0.3\linewidth}p{0.6\linewidth}}

specifies that the table must be \linewidth wide but tabularx has no way to achieve that, the column specification has two p column total .9\linewidth plus 4 *5pt \tabcolsep padding, so the box will be over or under full depending if .9\linewidth+20pt is bogger or smaller than \linewisdth but tabularx ca do nothing to affect that.

Use

 \begin{tabular}{p{0.3\linewidth}p{0.6\linewidth}}

Then inside the first column, the text block is 3\linewidth wide but you have used \cvTabItem which involves \begin{minipage}[t]{0.5\textwidth} so this can not fit.


I guess you want something like

enter image description here

\documentclass[10pt]{article}

\usepackage[a4paper, left=2cm,top=0.8cm,right=2cm,bottom=3.3cm,headheight=61pt, footskip=61pt, includehead]{geometry}

\usepackage[default]{opensans}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[draft]{graphicx}
\usepackage[ngerman]{babel}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{multicol}

\makeatletter
\renewcommand\LARGE{\@setfontsize\LARGE{18pt}{20}}
\setlength\parskip{0.7cm}
\renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}{-20px\@plus -30ex \@minus -.20px}{2px \@plus .5em}{\normalfont\MakeUppercase}}
\makeatother

\newcommand{\minsp}{%
  \vspace{-0.7cm}%
}%
\newcommand*{\cvItem}{\raggedright \rule{.3cm}{.3cm} }


\begin{document}%\showoutput
    \begin{multicols}{2}
    \paragraph{Ausbildung:}
    \minsp
        %\label{par:ausbildung}
        \begin{center}
            \setlength{\tabcolsep}{5pt}%
            \begin{tabularx}{\linewidth}{@{}lX@{}}
                \cvItem 2015 – 2019  & Das ist ein Test für eine mehrzeilige Tabelle in Verbindung einer Minipage zu Demonstrationszwecke. 
            \end{tabularx}
        \end{center}
    \end{multicols}
\end{document}

(I went back to tabularx in the end, with X for the right hand column)

2
  • Can you explain what "{@{}lX@{}}" does?
    – Ramona K.
    Commented Jun 1, 2021 at 20:35
  • @RamonaK. l X is first column single line, left aligned, second column parbox of automatic width, the two @{} remove the padding from the outer edges. Commented Jun 1, 2021 at 20:59
0

Ok, the answer of @David Carlisle helped me. I just used the minipage because I did not get the itemize into the tabular. BUT I dont need the itemize, if I create a

\newcommand{\cvTabItem}{\includegraphics[width=0.3cm]{images/bullet.png}\vspace{15px}}

Now my code (with local file) looks like:

\documentclass[10pt]{article}

\usepackage[a4paper, left=2cm,top=0.8cm,right=2cm,bottom=3.3cm,headheight=61pt, footskip=61pt, includehead]{geometry}

\usepackage[default]{opensans}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[draft]{graphicx}
\usepackage[ngerman]{babel}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{multicol}

\makeatletter
\renewcommand\LARGE{\@setfontsize\LARGE{18pt}{20}}
\setlength\parskip{0.7cm}
\renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}{-20px\@plus -30ex \@minus -.20px}{2px \@plus .5em}{\normalfont\MakeUppercase}}
\makeatother

\newcommand{\minsp}{%
  \vspace{-0.7cm}%
}%
\newcommand{\cvTabItem}{\includegraphics[width=0.3cm]{images/bullet.png}\hspace{5px}}%\hspace to get space between image and text


\begin{document}%\showoutput
    \begin{multicols}{2}
    \paragraph{Ausbildung:}
    \minsp
        %\label{par:ausbildung}
        \begin{center}
            \setlength{\tabcolsep}{5pt}%
            \begin{tabularx}{\linewidth}{@{}lX@{}}
                \cvTabItem 2015 – 2019  & Das ist ein Test für eine mehrzeilige Tabelle in Verbindung einer Minipage zu Demonstrationszwecke. 
            \end{tabularx}
        \end{center}
    \end{multicols}
\end{document}

But now I get an underfull \hbox warning :S

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .