0

Is there a way to change the style of the showframe-annotations?
I would like to rotate col1, col2, ... by 90° and set the font \tiny.
This could be helpfull at a huge amount of columns, say 30-50.

enter image description here

\documentclass{article}
\usepackage[margin=2cm, 
showframe=true]{geometry}
\usepackage[most]{tcolorbox}

\begin{document}
\noindent\begin{tcbposter}[
poster = {showframe=true, 
height=3cm, spacing=2mm, rows=2, columns=5,
height=6cm,  
},
boxes = {beamer, colframe=blue!50!black, colback=blue!50, colupper=yellow!50, 
},
]
\posterbox{name=A, row=2,  column=3,}{First box}
\end{tcbposter}
\end{document}
6
  • there is no style. Make a feature request if you want this. May 6, 2021 at 9:40
  • Are you sure you need 30-50 columns?
    – Ignasi
    May 6, 2021 at 10:04
  • @Ignasi I think so, because I need some different 'multicolumns'.
    – cis
    May 6, 2021 at 10:07
  • This example uses different columns and multicolumns and don't use so many columns. You can play with particular placements and shifts. tex.stackexchange.com/a/447475/1952
    – Ignasi
    May 6, 2021 at 10:32
  • @Ignasi OK, objection accepted. I plan to implement this timeline tex.stackexchange.com/questions/595611/… and I think tcbposter is not a bad choice. Would you use one complete poster here or several individual posters for every half century?
    – cis
    May 6, 2021 at 13:05

1 Answer 1

2

You can try to find the corresponding fragment code and adapt to your needs.

I've found it into tcb@poster@env. You only need to change one line but it's all together. I don't know how to extract it.

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lmodern}
\usepackage[margin=2cm, showframe=true]{geometry}

\makeatletter
\renewenvironment{tcb@poster@env}{%
  \let\posterbox\tcb@poster@box%
  \let\posterboxenv\tcb@poster@boxenv%
  \let\endposterboxenv\endtcb@poster@boxenv%
  \ifundef\tcb@poster@height{%
    \ifnum\c@tcblayer=0\relax%
      \def\tcb@poster@height{\textheight}%
    \else%
      \ifdim\dimexpr\tcbtextheight>0pt\relax%
        \def\tcb@poster@height{\tcbtextheight}%
      \else%
        \def\tcb@poster@height{0.75\textheight}%
      \fi%
    \fi}{}%
  \tcbset{poster/.cd,poster@poster}%
  \tcbdimto\tcbposterwidth{\tcb@poster@width}%
  \tcbdimto\tcbposterheight{\tcb@poster@height}%
  \tcbdimto\tcbpostercolspacing{\tcb@poster@colspacing}%
  \tcbdimto\tcbposterrowspacing{\tcb@poster@rowspacing}%
  \edef\tcbpostercolumns{\the\numexpr\tcb@poster@columns\relax}%
  \edef\tcbposterrows{\the\numexpr\tcb@poster@rows\relax}%
  \tcbdimto\tcbpostercolwidth{(\tcbposterwidth+\tcbpostercolspacing)/\tcbpostercolumns-\tcbpostercolspacing}%
  \tcbdimto\tcbposterrowheight{(\tcbposterheight+\tcbposterrowspacing)/\tcbposterrows-\tcbposterrowspacing}%
  \begin{tikzpicture}%
  \path[use as bounding box] (0,0) rectangle (\tcbposterwidth,\tcbposterheight);
  \node[name=\tcb@poster@prefix poster,at={(0,0)},line width=0mm,inner sep=0mm,outer sep=0mm,draw=none,fill=none,rectangle,
    above right,minimum width=\tcbposterwidth,minimum height=\tcbposterheight]{};
  \coordinate (\tcb@poster@prefix top) at (0,\tcbposterheight+\tcbposterrowspacing);
  \coordinate (\tcb@poster@prefix bottom) at (0,-\tcbposterrowspacing);
  \coordinate (\tcb@poster@prefix middle) at (0,\the\dimexpr0.5\dimexpr\tcbposterheight\relax);
  \begin{scope}[every node/.style={inner sep=0pt,outer sep=0,above right,minimum height=\tcbposterheight,minimum width=\tcbpostercolwidth}]%
    \node (\tcb@poster@prefix col1) at (0,0) {};
    \@tempcnta 1%
    \@tempcntb\numexpr\tcbpostercolumns\relax%
    \@tempdima\dimexpr\tcbpostercolwidth+\tcbpostercolspacing\relax%
    \@whilenum \@tempcnta<\@tempcntb \do{%
      \edef\tcb@temp{\tcb@poster@prefix col\@arabic\@tempcnta}%
      \advance\@tempcnta 1\relax%
      \node[xshift=\tcbpostercolspacing] (\tcb@poster@prefix col\@arabic\@tempcnta) at (\[email protected] east) {};
    }%
  \end{scope}%
  \begin{scope}[every node/.style={inner sep=0pt,outer sep=0,below right,minimum height=\tcbposterrowheight,minimum width=\tcbposterwidth}]%
    \node (\tcb@poster@prefix row1) at (0,\tcbposterheight) {};
    \@tempcnta 1%
    \@tempcntb\numexpr\tcbposterrows\relax%
    \@tempdima\dimexpr\tcbposterrowheight+\tcbposterrowspacing\relax%
    \@whilenum \@tempcnta<\@tempcntb \do{%
      \edef\tcb@temp{\tcb@poster@prefix row\@arabic\@tempcnta}%
      \advance\@tempcnta 1\relax%
      \node[yshift=-\tcbposterrowspacing] (\tcb@poster@prefix row\@arabic\@tempcnta) at (\[email protected] west) {};
    }%
  \end{scope}%
  \iftcb@poster@showframe%
    \@tempcnta 0%
    \@tempcntb\numexpr\tcbpostercolumns\relax%
    \@whilenum \@tempcnta<\@tempcntb \do{%
      \advance\@tempcnta 1\relax%
      \edef\tcb@temp{\tcb@poster@prefix col\@arabic\@tempcnta}%
      \draw[red] (\[email protected] west) node[above right, rotate=90, anchor=north west]{col\@arabic\@tempcnta} rectangle (\[email protected] east);
    }%
    \@tempcnta 0%
    \@tempcntb\numexpr\tcbposterrows\relax%
    \@whilenum \@tempcnta<\@tempcntb \do{%
      \advance\@tempcnta 1\relax%
      \edef\tcb@temp{\tcb@poster@prefix row\@arabic\@tempcnta}%
      \draw[red] (\[email protected] west) node[below left]{row\@arabic\@tempcnta} rectangle (\[email protected] east);
    }%
    \gdef\tcb@poster@framelist{}%
  \fi%
}{%
  \iftcb@poster@showframe%
    \renewcommand*{\do}[1]{%
      \node[red,fill=white,opacity=0.7,font=\Large] at (\tcb@poster@prefix##1) {##1};}%
    \dolistloop{\tcb@poster@framelist}%
    \gdef\tcb@poster@framelist{}%
  \fi%
\end{tikzpicture}}
\makeatother

\begin{document}
\noindent\begin{tcbposter}[
poster = {showframe=true, 
height=3cm, spacing=2mm, rows=2, columns=20,
height=6cm,  
},
boxes = {beamer, colframe=blue!50!black, colback=blue!50, colupper=yellow!50, 
},
]
\posterbox{name=A, row=2,  column=3,}{First box}
\end{tcbposter}
\end{document}

enter image description here

1
  • Wow! Seems there is no easy way. ;)
    – cis
    May 6, 2021 at 10:05

You must log in to answer this question.

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