2

friends i have posterbox and i want to put text in this box. Please see image

Minimal working example:

\documentclass{article}

\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{tikz}

\usepackage{lipsum}

\begin{document}

\begin{tcbposter}[
  poster = {
    columns=1,
    rows=2,
    spacing=3mm,
    height=14cm,
    width=12cm,
  },
  ]
  \posterbox[
  colframe = red,
  width=13cm, height= 10cm
  ]{ }{\includegraphics[height=4cm]{example-image-b}}

\end{tcbposter}

\end{document}

enter image description here

Add "ABC" and "XYZ" like attached image Thanks

1
  • 1
    I don't think this has anything to do with tcbposter.
    – user156344
    Apr 14, 2019 at 5:39

2 Answers 2

3

You can use ordinary TikZ commands in a tcbposter environment.

\documentclass{article}

\usepackage{tcolorbox}
\tcbuselibrary{poster}

\usepackage{lipsum}

\begin{document}

\begin{tcbposter}[
  poster = {
    columns=1,
    rows=2,
    spacing=3mm,
    height=14cm,
    width=12cm,
  },
  ]
  \posterbox[
  colframe = red,
  width=13cm, height= 10cm
  ]{name=A,column=1}{\includegraphics[height=8cm]{example-image-b}}
  \node[font=\sffamily\Large,rotate=90] at (12,9.6) {XYZ};
  \node[font=\sffamily\Large] at (6,5) {XYZ};
\end{tcbposter}
\end{document}

enter image description here

Or you can position these nodes relative to the picture.

\documentclass{article}

\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usetikzlibrary{positioning}
\usepackage{lipsum}

\begin{document}
\begin{tcbposter}[
  poster = {
    columns=1,
    rows=2,
    spacing=3mm,
    height=14cm,
    width=12cm,
  },
  ]
  \posterbox[
  colframe = red,
  width=13cm, height= 10cm
  ]{name=A,column=1}{\includegraphics[height=8cm]{example-image-b}}
  \node[font=\sffamily\Large,rotate=90,right=-5mm of TCBPOSTER@A]  {XYZ};
  \node[font=\sffamily\Large,below=-10mm of TCBPOSTER@A] {XYZ};
\end{tcbposter}
\end{document}

enter image description here

Or you can just use a table and \rotatebox.

\documentclass{article}

\usepackage{tcolorbox}
\tcbuselibrary{poster}

\begin{document}

\begin{tcbposter}[
  poster = {
    columns=1,
    rows=2,
    spacing=3mm,
    height=14cm,
    width=12cm,
  },
  ]
  \posterbox[
  colframe = red,
  width=13cm, height= 10cm
  ]{ }{\begin{tabular}{cl}
\includegraphics[height=4cm]{example-image-b} &\rotatebox{90}{XYZ} \\
XYZ & 
\end{tabular}}

\end{tcbposter}

\end{document}

enter image description here

4
  • thank you for your solution. I used "\node[font=\sffamily\Large,rotate=90,right=-5mm of TCBPOSTER@A] {XYZ}". Right =-5mm of A is ok. And i need move "XYZ" above or below? Example: above 7mm or below 3mm. How can shift "XYZ" ? thanks.
    – latexforti
    Apr 14, 2019 at 6:11
  • 1
    @latexforti I am sorry, I do not understand your question. tcbposter creates a tikzpicture environment, and one can use standard tikz commands, which is what I did here. All I am doing is to move stuff on top of the posterbox node. If you want to move the rotated node up, you can do \node[font=\sffamily\Large,right=-5mm of TCBPOSTER@A,yshift=1cm,rotate=90] {XYZ};. In general, xshift and yshift will allow you to move things around.
    – user121799
    Apr 14, 2019 at 13:50
  • 1
    thank for help. i solved with this code: \node[font=\sffamily\small,rotate=90,below right=-0.2cm and -0.45cm of TCBPOSTER@A}
    – latexforti
    Apr 14, 2019 at 14:17
  • 1
    @latexforti Yes, that is a nice way of doing that.
    – user121799
    Apr 14, 2019 at 14:26
2

With skin library you can draw whatever you want on a tcolorbox, with exact coordinates.

\documentclass{article}
\usepackage{geometry}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\pgfsetlayers{main}
\begin{document}
\begin{tcolorbox}[
  width=13cm,height= 10cm,
  skin=freelance,
  interior code={%
    \path (frame.south west) -- (frame.south east) node[midway,above=1ex,font=\Large\sffamily] {ABC};
    \path (frame.south east) -- (frame.north east) node[midway,rotate=90,above=1ex,fill=yellow,font=\Large\sffamily,inner sep=8pt] {XYZ};
  },
  frame code={%
    \begin{pgfonlayer}{main}
      \path[draw=red,fill=gray!20,ultra thick,rounded corners] (frame.south west) rectangle (frame.north east);
    \end{pgfonlayer}
  },
]
\includegraphics[height=4cm]{example-image-b}
\end{tcolorbox}
\end{document}

enter image description here

You must log in to answer this question.

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