Seite 1 von 1

Zeilenumbruch verhindern {multicols}

Verfasst: Di 21. Feb 2023, 00:28
von Primearsar
Hallo zusammen,

ich möchte gerne erreichen, dass die Skala Pukte rechts neben dem Skill stehen. Dabei soll aber die doppelreihige Tabellenform bestehen bleiben.

Wie kann ich das elegant umsetzen?

Vielen Dank
Prim

\documentclass{report}

\usepackage{tikz}
\usepackage{multicol}

\definecolor{frontColor}{rgb}{0.22,0.45,0.70} % light blue
\definecolor{backColor}{RGB}{200,200,200} % grey

\newcommand{\grade}[1]{%

\begin{tikzpicture}
\clip (1em-.4em,-.35em) rectangle (5em +.5em ,1em);
\foreach \x in {1,2,...,5}{
\path[{fill=backColor}] (\x em,0) circle (.35em);
}
\begin{scope}
\clip (1em-.4em,-.35em) rectangle (#1em +.5em ,1em);
\foreach \x in {1,2,...,5}{
\path[{fill=frontColor}] (\x em,0) circle (.35em);
}
\end{scope}
\end{tikzpicture}%
}

\begin{document}

\vspace*{-0.35cm}
\begin{multicols}{2}
\begin{itemize}
%\footnotesize
\item \textbf{Microsoft Excel} \grade{5}
\item \textbf{Microsoft Word} \grade{5}
\item \textbf{Microsoft PowerPoint} \grade{4}
\item \textbf{\LaTeX{}} \grade{2}
\end{itemize}
\end{multicols}

\end{document}

Re: Zeilenumbruch verhindern {multicols}

Verfasst: Di 21. Feb 2023, 02:48
von Bartman
Benutze bitte die Tags für mehrzeiligen Quelltext, damit man lauffähige Beispiele umgehend testen kann.

Die Leerzeile vor der tikzpicture-Umgebung bewirkt den Zeilenumbruch.

Ein Vorschlag für den Umbau des Beispiels:
\documentclass{report}
\usepackage{tikz}
\usepackage{multicol}
\usepackage{enumitem}

\newlist{skillList}{itemize}{1}
\setlist[skillList]{
  label=\textbullet,
  before=\begin{multicols}{2}\footnotesize,
  after=\end{multicols}
}

\definecolor{frontColor}{rgb}{0.22,0.45,0.70} % light blue
\definecolor{backColor}{RGB}{200,200,200} % grey

\newcommand{\grade}[1]{%
  \begin{tikzpicture}
  \foreach \x in {1,2,...,5}{
    \ifnum\x>#1
      \fill[backColor] (\x em,0) circle (.35em);
    \else
      \fill[frontColor] (\x em,0) circle (.35em);
    \fi
  }
  \end{tikzpicture}%
}

\newcommand{\skillItem}[2]{\item\textbf{#1} \grade{#2}}

\begin{document}
\vspace*{-0.35cm}
\begin{skillList}
\skillItem{Microsoft Excel}{5}
\skillItem{Microsoft Word}{5}
\skillItem{Microsoft PowerPoint}{4}
\skillItem{\LaTeX}{2}
\end{skillList}
\end{document}

Re: Zeilenumbruch verhindern {multicols}

Verfasst: Di 21. Feb 2023, 09:36
von Primearsar
Vielen Dank