tikzposter:如何水平移动 tikz 图形?

tikzposter:如何水平移动 tikz 图形?

以下 tikzposter 中的图形出现在一个块的右侧。如何将图形向左或向中间移动?

 \documentclass[25pt, a0paper, landscape, margin=0mm, innermargin=15mm, 
                blockverticalspace=15mm, colspace=15mm, subcolspace=8mm]
                {tikzposter} %Default values for poster format options.
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{upgreek}
\usepackage{adjustbox}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes.multipart}
\usepackage{tikz-qtree}
\usepackage{marvosym}
\usepackage{mathtools}
\usetikzlibrary{shapes.multipart,shapes,shadows,arrows,decorations.markings,trees,positioning,decorations.markings,calc,fit,chains,intersections,decorations.pathreplacing}
\usepackage[underline=true]{pgf-umlsd}
\usepackage{pifont}
\usepackage{xcolor}

\tikzposterlatexaffectionproofon %shows small comment on how the poster was made at bottom of poster

\tikzset{
    treenode/.style     = {align=center, inner sep=0pt, text centered, font=\sffamily},
    arn_n/.style        = {treenode, circle, white, font=\sffamily\bfseries, draw=black, fill=black, text width=1.5em},
    arn_r/.style        = {treenode, circle, red, draw=red, text width=1.5em, very thick},
    arn_x/.style        = {treenode, rectangle, draw=black, minimum width=2.5cm, minimum height=1.5cm},
    arn_t/.style        = {draw, black, regular polygon, regular polygon sides = 3, inner sep = 1pt},
    repository/.style   = {draw=black,  cylinder,thick,aspect=0.1, minimum height=1cm, minimum width=1.5cm, shape border rotate=90, cylinder uses custom fill, cylinder body fill=red!30, cylinder end fill=red!10}
}

% Commands
\newcommand{\bs}{\textbackslash}   % backslash
\newcommand{\cmd}[1]{{\bf \color{red}#1}}   % highlights command

\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%

% Title, Author, Institute
\title      {Title}
\author     {Authors}
\institute  {Institute}

\usetheme{Autumn}

\usecolorstyle[colorPalette=BrownBlueOrange]{Germany}

\begin{document}

     \maketitle

     \begin{columns} %blocks will be placed into columns
    \column{.31}

        \block{B1}
        {
%           \texttt{Attribute Authorities (AA): Issuers, Subscribers}//
            \begin{tikzpicture} [   ->,
                                    >=stealth',
%                                   baseline=-25ex,
                                    baseline={ ( [yshift={0ex}, xshift={-25ex}] current bounding box.north)},
                                    level/.style={sibling distance = 10cm/#1},
                                    level 1/.append style={sibling distance = 15cm, level distance = 4.0cm},
                                    level 2/.append style={level distance = 7.0cm},
                                ] 
                \node [arn_r] [label={[label distance=0cm]90:$\mathtt{R}$}] (r) {$\wedge$}
                child { node [arn_r] [label={[label distance=0cm]0:${\mathtt{R_S}}$}] (rl) {$\wedge$} 
                    child{ node [arn_t] (rll){$\mathtt{A_{R1}}$} 
                    }
                    child{ node [arn_t] (rlr) {$\mathtt{A_{Rn}}$}
                    }                            
                }
                child{ node [arn_r] [label={[label distance=0cm]0:${\mathtt{R_I}}$}] (rr) {$\wedge$}
                    child{ node [arn_t] (rrl) {$\mathtt{A_{R1}}$} 
                    }
                    child{ node [arn_t] (rrr) {$\mathtt{A_{Rn}}$}
                    }
                }
                ; 

                \node [draw, dashed, rounded corners=15pt, inner xsep=15mm, inner ysep=5mm, fit=(rll)(rlr)(rl), thick] (r1) {}; 
                \node [ rounded rectangle, rounded corners=15pt, below=0.2cm of r1, minimum width=11cm, minimum height=0.5cm, align=center] (ct1)
                {
                    ${\mathtt{CTtok_{S_{iv}}} =} \begin{cases}
                    \quad {\mathcal{T}_{S_{iv}}}\\
                    \quad {\mathtt{C1_S} = \mathtt{e(g, g)}^{\upalpha \mathtt{r_s}}}\\
                    \quad {\mathtt{C2_S} = \mathtt{g}^{\upbeta \mathtt{r_s}}}\\
                    \begin{rcases}
                    \quad {\mathtt{C3_{S_y} = g^{q_y(0)}}}\\
                    \quad {\mathtt{C4_{S_y} = H(\mathtt{attr(y)})^{q_y(0)}}}\\
                    \end{rcases} {\!\scriptscriptstyle\mathtt{\forall\ y \in Y_S}}\\
                    \end{cases}$
                } ;

                \node [draw, dashed, rounded corners=15pt, inner xsep=15mm, inner ysep=3mm, fit=(rrl)(rrr)(rr), thick] (r2) {}; 
                \node [rounded rectangle, rounded corners=15pt, below=0.2cm of r2, minimum width=11cm, minimum height=0.5cm, align=center] (ct2)  
                {
                    ${\mathtt{CTtok_{I_{iv}}} =}    \begin{cases}
                        \quad {\mathcal{T}_{\mathtt{{I_{iv}}}}}\\
                        \quad {\mathtt{C1_I} = \mathtt{e(g, g)}^{\upalpha \mathtt{r_i}}}\\
                        \quad {\mathtt{C2_I} = \mathtt{g}^{\upbeta \mathtt{r_i}}}\\
                        \begin{rcases}
                        \quad {\mathtt{C3_{I_y} = g^{q_y(0)}}}\\
                        \quad {\mathtt{C4_{I_y} = H(\mathtt{attr(y)})^{q_y(0)}}}\\
                        \end{rcases} {\!\scriptstyle{\mathtt{\forall\ y \in Y_I}}}\\
                        \end{cases}$
                } ;

                \node [ dashed, rounded corners=15pt, inner xsep=-2.5cm, inner ysep=12mm, fit=(rrr)(r)(rll)(ct1)(ct2), thick] (r3) {}; 
                \node [rounded rectangle, rounded corners=15pt, below=0.2cm of r3, minimum width=23cm, minimum height=0.5cm, align=center] (ct3)  
                {
                    ${\mathtt{CTtok_{iv}}\ =\ } \begin{cases}
                    \quad {\mathcal{T}_{iv}\ =\ \mathcal{T}_{S_{iv}} \cup \mathcal{T}_{I_{iv}}}\\
                    \quad {\mathtt{C1}\ =\ \mathtt{C1_S}\ .\ \mathtt{C1_I}\ \ \ \ =\ \mathtt{e(g, g)}^{\upalpha \mathtt{r_s}}\mathtt{e(g, g)}^{\upalpha \mathtt{r_i}}}\\
                    \quad {\mathtt{C2}\ =\ \mathtt{C2_S}\ .\ \mathtt{C2_I}\ \ \ \ =\ \mathtt{g}^{\upbeta \mathtt{r_s}}\mathtt{g}^{\upbeta \mathtt{r_i}}}\\
                    \begin{rcases}
                    \quad {\mathtt{C3\ =\ C3_{S_y} \cup C3_{I_y}}\ =\ \mathtt{g^{q_y(0)}}}\\
                    \quad {\mathtt{C4\ =\ C4_{S_y} \cup C4_{I_y}}\ =\ \mathtt{H(\mathtt{attr(y)})^{q_y(0)}}}\\
                    \end{rcases} {\!\scriptscriptstyle\forall\ y \in Y_S \cup Y_I}\\
                    \end{cases}$
                } ;

                \node [above, inner sep=4cm] at (r1.south) {\large ${\mathcal{T}_S}_{iv}$};
                \node [above, inner sep=4cm] at (r2.south) {\large ${\mathcal{T}_I}_{iv}$};
                \node [below, inner sep=1cm] at (r.south)  {\large ${\mathcal{T}_{iv}}$};

            \end{tikzpicture}
        }

     \end{columns}

\end{document}

\endinput
%%
%% End of file `tikzposter-example.tex'.

截屏 在此处输入图片描述

答案1

这里发生的情况是tikzpicture比块更宽,导致它在右侧突出。左侧的空白来自您rounded rectangle,rounded corners=15pt在第一个节点中包含cases( ct1),因此第一步是删除这些选项。即使进行了这样的修改,图表对于块来说还是有点太宽了。解决这个问题的一个选项是稍微减小字体大小,因此在和节点font=\normalsize的选项中添加(并从中删除内容)。ct1ct2rounded cornersct2

在此处输入图片描述

\documentclass[25pt, a0paper, landscape, margin=0mm, innermargin=15mm, 
                blockverticalspace=15mm, colspace=15mm, subcolspace=8mm]
                {tikzposter} %Default values for poster format options.
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{upgreek}
\usepackage{adjustbox}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes.multipart}
\usepackage{tikz-qtree}
\usepackage{marvosym}
\usepackage{mathtools}
\usetikzlibrary{shapes.multipart,shapes,shadows,arrows,decorations.markings,trees,positioning,decorations.markings,calc,fit,chains,intersections,decorations.pathreplacing}
\usepackage[underline=true]{pgf-umlsd}
\usepackage{pifont}
\usepackage{xcolor}

\tikzposterlatexaffectionproofon %shows small comment on how the poster was made at bottom of poster

\tikzset{
    treenode/.style     = {align=center, inner sep=0pt, text centered, font=\sffamily},
    arn_n/.style        = {treenode, circle, white, font=\sffamily\bfseries, draw=black, fill=black, text width=1.5em},
    arn_r/.style        = {treenode, circle, red, draw=red, text width=1.5em, very thick},
    arn_x/.style        = {treenode, rectangle, draw=black, minimum width=2.5cm, minimum height=1.5cm},
    arn_t/.style        = {draw, black, regular polygon, regular polygon sides = 3, inner sep = 1pt},
    repository/.style   = {draw=black,  cylinder,thick,aspect=0.1, minimum height=1cm, minimum width=1.5cm, shape border rotate=90, cylinder uses custom fill, cylinder body fill=red!30, cylinder end fill=red!10}
}

% Commands
\newcommand{\bs}{\textbackslash}   % backslash
\newcommand{\cmd}[1]{{\bf \color{red}#1}}   % highlights command

\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%

% Title, Author, Institute
\title      {Title}
\author     {Authors}
\institute  {Institute}

\usetheme{Autumn}

\usecolorstyle[colorPalette=BrownBlueOrange]{Germany}

\begin{document}

     \maketitle

     \begin{columns} %blocks will be placed into columns
    \column{.31}

        \block{B1}
        {
%           \texttt{Attribute Authorities (AA): Issuers, Subscribers}//
            \begin{tikzpicture} [   ->,%every node/.append style={draw},
                                    >=stealth',
%                                   baseline=-25ex,
                                    baseline={ ( [yshift={0ex}, xshift={-25ex}] current bounding box.north)},
                                    level/.style={sibling distance = 10cm/#1},
                                    level 1/.append style={sibling distance = 15cm, level distance = 4.0cm},
                                    level 2/.append style={level distance = 7.0cm},
                                ] 
                \node [arn_r] [label={[label distance=0cm]90:$\mathtt{R}$}] (r) {$\wedge$}
                child { node [arn_r] [label={[label distance=0cm]0:${\mathtt{R_S}}$}] (rl) {$\wedge$} 
                    child{ node [arn_t] (rll){$\mathtt{A_{R1}}$} 
                    }
                    child{ node [arn_t] (rlr) {$\mathtt{A_{Rn}}$}
                    }                            
                }
                child{ node [arn_r] [label={[label distance=0cm]0:${\mathtt{R_I}}$}] (rr) {$\wedge$}
                    child{ node [arn_t] (rrl) {$\mathtt{A_{R1}}$} 
                    }
                    child{ node [arn_t] (rrr) {$\mathtt{A_{Rn}}$}
                    }
                }
                ; 

                \node [draw, dashed, rounded corners=15pt, inner xsep=15mm, inner ysep=5mm, fit=(rll)(rlr)(rl), thick] (r1) {}; 

                % replaced the rounded corners stuff with font=\normalsize
                \node [ below=0.2cm of r1, font=\normalsize,minimum width=11cm, minimum height=0.5cm, align=center] (ct1)
                {
                    ${\mathtt{CTtok_{S_{iv}}} =} \begin{cases}
                    \quad {\mathcal{T}_{S_{iv}}}\\
                    \quad {\mathtt{C1_S} = \mathtt{e(g, g)}^{\upalpha \mathtt{r_s}}}\\
                    \quad {\mathtt{C2_S} = \mathtt{g}^{\upbeta \mathtt{r_s}}}\\
                    \begin{rcases}
                    \quad {\mathtt{C3_{S_y} = g^{q_y(0)}}}\\
                    \quad {\mathtt{C4_{S_y} = H(\mathtt{attr(y)})^{q_y(0)}}}\\
                    \end{rcases} {\!\scriptscriptstyle\mathtt{\forall\ y \in Y_S}}\\
                    \end{cases}$
                } ;

                \node [draw, dashed, rounded corners=15pt, inner xsep=15mm, inner ysep=3mm, fit=(rrl)(rrr)(rr), thick] (r2) {}; 

                % replaced the rounded corners stuff with font=\normalsize
                \node [below=0.2cm of r2,font=\normalsize, minimum width=11cm, minimum height=0.5cm, align=center] (ct2)  
                {
                    ${\mathtt{CTtok_{I_{iv}}} =}    \begin{cases}
                        \quad {\mathcal{T}_{\mathtt{{I_{iv}}}}}\\
                        \quad {\mathtt{C1_I} = \mathtt{e(g, g)}^{\upalpha \mathtt{r_i}}}\\
                        \quad {\mathtt{C2_I} = \mathtt{g}^{\upbeta \mathtt{r_i}}}\\
                        \begin{rcases}
                        \quad {\mathtt{C3_{I_y} = g^{q_y(0)}}}\\
                        \quad {\mathtt{C4_{I_y} = H(\mathtt{attr(y)})^{q_y(0)}}}\\
                        \end{rcases} {\!\scriptstyle{\mathtt{\forall\ y \in Y_I}}}\\
                        \end{cases}$
                } ;

                \node [ dashed, rounded corners=15pt, inner xsep=-2.5cm, inner ysep=12mm, fit=(rrr)(r)(rll)(ct1)(ct2), thick] (r3) {}; 
                \node [rounded rectangle, rounded corners=15pt, below=0.2cm of r3, minimum width=23cm, minimum height=0.5cm, align=center] (ct3)  
                {
                    ${\mathtt{CTtok_{iv}}\ =\ } \begin{cases}
                    \quad {\mathcal{T}_{iv}\ =\ \mathcal{T}_{S_{iv}} \cup \mathcal{T}_{I_{iv}}}\\
                    \quad {\mathtt{C1}\ =\ \mathtt{C1_S}\ .\ \mathtt{C1_I}\ \ \ \ =\ \mathtt{e(g, g)}^{\upalpha \mathtt{r_s}}\mathtt{e(g, g)}^{\upalpha \mathtt{r_i}}}\\
                    \quad {\mathtt{C2}\ =\ \mathtt{C2_S}\ .\ \mathtt{C2_I}\ \ \ \ =\ \mathtt{g}^{\upbeta \mathtt{r_s}}\mathtt{g}^{\upbeta \mathtt{r_i}}}\\
                    \begin{rcases}
                    \quad {\mathtt{C3\ =\ C3_{S_y} \cup C3_{I_y}}\ =\ \mathtt{g^{q_y(0)}}}\\
                    \quad {\mathtt{C4\ =\ C4_{S_y} \cup C4_{I_y}}\ =\ \mathtt{H(\mathtt{attr(y)})^{q_y(0)}}}\\
                    \end{rcases} {\!\scriptscriptstyle\forall\ y \in Y_S \cup Y_I}\\
                    \end{cases}$
                } ;

                \node [above, inner sep=4cm] at (r1.south) {\large ${\mathcal{T}_S}_{iv}$};
                \node [above, inner sep=4cm] at (r2.south) {\large ${\mathcal{T}_I}_{iv}$};
                \node [below, inner sep=1cm] at (r.south)  {\large ${\mathcal{T}_{iv}}$};

            \end{tikzpicture}
        }

     \end{columns}

\end{document}

相关内容