0

I want to create products labels. For the alignment I am using tabluar. But as soon as I place an image inside the table or change the fonts size everything gets messed up. The image moves out of the table and the inner table on the right has some padding above it. The upper text on the right has additional line spacing.

This is how I want it to look like enter image description here

and this is what it looks like enter image description here

\documentclass[a4paper]{article}
\usepackage[margin=0pt]{geometry}
\pagestyle{plain}
\usepackage[newdimens]{labels}
\usepackage{anyfontsize}
\LabelGridtrue
\usepackage{ngerman}
\usepackage{graphicx}

% Set Label Parameters
\numberoflabels=27
\LabelCols=3
\LabelRows=9
\LeftPageMargin=8mm
\RightPageMargin=6.5mm
\TopPageMargin=13.5mm
\BottomPageMargin=17mm
\InterLabelColumn=2.5mm
\InterLabelRow=0mm
\LeftLabelBorder=0mm
\RightLabelBorder=0mm
\TopLabelBorder=0mm
\BottomLabelBorder=0mm

% Set Fonts
\usepackage{fontspec}
\setmainfont[Path={/home/user/font/}, 
        Extension={.otf},
        BoldFont=fontbold.otf,
        ItalicFont=fontitalic.otf,
        BoldItalicFont=fontbolditalic.otf]{FrutigerLTStd-Light.otf}

%% Filter Label
%% Arguments:
%%   #1: 
%%   #2:
%%   #3:
%%   #4:

\newcommand{\filterlabel}[4]{

    \setlength{\tabcolsep}{0mm} %horizontal padding

    \genericlabel{

    % Breit: 63 mm
    % Höhe: 29 mm
    \begin{tabular}{|p{3.8cm}|p{2.3cm}|}
    \hline
        \includegraphics[width=3.3cm]{image.eps} &  
        \textbf{#1} \newline
        {\fontsize{7}{8}\selectfont
         \textbf{Max. #2}\newline 
         \textbf{Max. #3}}\\
    \hline
        {\fontsize{30}{30}\selectfont \textbf{#4}} &  
        \begin{tabular}{|p{6mm}|p{6mm}|p{6mm}|}
            P & S & X \\
            Y & Z & ZP \\
        \end{tabular} \\
    \hline
        \multicolumn{2}{|l|}{\parbox{6.1cm}{\fontsize{6}{7}\selectfont sfjhsdjkfhsdfjshdfk\newline hgfsfhgsdhjf}}\\
    \hline
    \end{tabular}   
    }
}


\begin{document}

\filterlabel{1.100 l/min}{16 bar}{60 °C}{Model}

\end{document}
  • 1
    Welcome to TeX.SX! Please help us help you by making your post self-contained (i.e. remove non-standard fonts and replace the image with example-image). – TeXnician Oct 9 '18 at 14:28
1

I found a solution so that image will not mess up the table. But I still have the problem that the "Model" has to much spacing between the table borders.

\documentclass[a4paper]{article}
\usepackage[margin=0pt]{geometry}
\pagestyle{plain}
\usepackage[newdimens]{labels}
\usepackage{tcolorbox}
\usepackage{anyfontsize}
\LabelGridtrue
\usepackage{ngerman}
\usepackage{graphicx}


% Set Label Parameters
\numberoflabels=27
\LabelCols=3
\LabelRows=9
\LeftPageMargin=8mm
\RightPageMargin=6.5mm
\TopPageMargin=13.5mm
\BottomPageMargin=17mm
\InterLabelColumn=2.5mm
\InterLabelRow=0mm
\LeftLabelBorder=0mm
\RightLabelBorder=0mm
\TopLabelBorder=0mm
\BottomLabelBorder=0mm


%% Filter Label
%% Arguments:
%%   #1: Durchfluss
%%   #2: Druck
%%   #3: Temperatur
%%   #4: Modell
%%   #5: Webseite
%%   #6: Adresse

\newcommand{\filterlabel}[6]{

   \setlength{\tabcolsep}{0mm} %horizontal padding

   \genericlabel{

   % Breit: 63 mm
   % Höhe: 29 mm
   \begin{tabular}{|p{3.8cm}|p{2.3cm}|}
   \hline
      \raisebox{\dimexpr\ht\strutbox-\totalheight\relax}{\includegraphics[width=3.3cm]{logo.eps}} &  
      \textbf{#1} \newline
      {\fontsize{7}{8}\selectfont\textbf{Max. #2}\newline \textbf{Max. #3}}\\
   \hline
      \parbox[c]{.5\textwidth}{\fontsize{24}{28}\selectfont \textbf{#4}} &  
      \begin{tabular}{|p{2.8mm}p{4.5mm}|p{2.8mm}p{4.5mm}|p{3.5mm}p{4.5mm}|}
         P & & S & & X &\\
      \hline
         Y & & Z & & ZP & \\
      \end{tabular} \\
   \hline
      \multicolumn{2}{|l|}{\parbox{6.1cm}{\fontsize{6}{7}\selectfont #5 \newline #6}}\\
   \hline
   \end{tabular}  
   }
}


\begin{document}

\filterlabel{1.100 l/min}{16 bar}{60 °C}{Model}{XXXXXXXXXX}{XXXXXXXXXXXXX}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.