0

I have box A and this box A can moving when (No - odd/even) & (Type - 1/2/3) change.

Minimal working coding:

\documentclass[a5paper,twoside,8pt]{article}
\usepackage[a5paper,landscape,left=1.0cm,right=0.3cm,top=0.5cm,bottom=0.5cm]{geometry}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{tikz,everypage}
\usepackage[absolute,overlay]{textpos} 
\usepackage{filecontents}


\begin{filecontents*}{product.tex}
%Type =1,2...10
No,Type,Name,Description
1,1,A1,D1
2,1,A1,D2
3,1,A1,D3
4,1,A1,D30
5,1,A2,D31
6,1,A2,D131
7,1,A3,D132
8,1,A3,D133
9,1,A3,D134
10,1,A4,D249
11,2,A10,D1000
12,2,A2,D11
13,2,A3,D13
14,2,A3,D135
15,2,A3,D137
16,2,A4,D249
17,2,A10,D100
18,3,A43,D318
19,3,A44,D319
20,3,A40,D320
\end{filecontents*}

\usepackage{datatool}

\DTLloaddb[autokeys=false]{products}{product.tex}

\newcommand{\printtype}[1]{%
  \par
  \section*{Type #1}
  \DTLforeach*
    [\DTLiseq{\Type}{#1}]% Condition
    {products}% Database
    {\No=No,\Type=Type,\Name=Name,\Description=Description}{%

    \begin{tcbposter}[
  poster = {
    columns=1,
    rows=2,
    spacing=3mm,
    height=14cm,
    width=12cm,
  },
  ]
%Box A
  \posterbox[
  colframe = red,
  width=5cm, height= 5cm
  ]{xshift=3 cm,yshift=-3cm}{\includegraphics[height=2cm]{example-image-a}
  \\
  \noindent \No \quad \Name \quad \Description\par
  }
  %Box B
  \posterbox[
  colframe = red,
  width=5cm, height= 5cm
  ]{xshift=10 cm,yshift=-1cm }{\includegraphics[height=3cm]{example-image-b}}


\end{tcbposter}
    \newpage
  }% 
}

\begin{document}

\printtype{1}

\printtype{2}

\end{document}

This Box A can move when 2 variable: \No = odd or even and \Type change with rule.

Rule for xshift & yshift of Box A:

No     Type        X Postion of Box A       Y Postion of Box A    

odd       1                2 cm                       -2 cm

even      1                3 cm                       -3 cm

odd       2                2.5cm                      -2.5cm

even      2                3.5 cm                     -3.5 cm

odd       3                3cm                        -3 cm

even      3                4cm                        -4 cm

enter image description here

Please help Thank in advance

Your Answer

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

Browse other questions tagged or ask your own question.