無法將圖像並排浮動在 headerbox baposter 中的表格中

無法將圖像並排浮動在 headerbox baposter 中的表格中

我無法將圖像放置在表格的右側,反之亦然。我該怎麼辦呢。

下面是MWE。

\documentclass[a0paper,portrait]{baposter}

\usepackage{wrapfig}
\usepackage{lmodern}
\usepackage{authblk}
\usepackage[utf8]{inputenc} %unicode support
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{blindtext}


\selectcolormodel{cmyk}

\graphicspath{{figures/}} % Directory in which figures are stored


\newcommand{\compresslist}{%
\setlength{\itemsep}{0pt}%
\setlength{\parskip}{1pt}%
\setlength{\parsep}{0pt}%
}

\newenvironment{boenumerate}
  {\begin{enumerate}\renewcommand\labelenumi{\textbf\theenumi.}}
  {\end{enumerate}}

\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}


\begin{document}


\definecolor{darkgreen}{cmyk}{0.8,0,0.8,0.45}
\definecolor{lightgreen}{cmyk}{0.8,0,0.8,0.25}

\begin{poster}
{
grid=false,
headerborder=open, % Adds a border around the header of content boxes
colspacing=1em, % Column spacing
bgColorOne=white, % Background color for the gradient on the left side of the poster
bgColorTwo=white, % Background color for the gradient on the right side of the poster
borderColor=darkgreen, % Border color
headerColorOne=lightgreen, % Background color for the header in the content boxes (left side)
headerColorTwo=lightgreen, % Background color for the header in the content boxes (right side)
headerFontColor=white, % Text color for the header text in the content boxes
boxColorOne=white, % Background color of the content boxes
textborder=rounded, %rectangle, % Format of the border around content boxes, can be: none, bars, coils, triangles, rectangle, rounded, roundedsmall, roundedright or faded
eyecatcher=false, % Set to false for ignoring the left logo in the title and move the title left
headerheight=0.11\textheight, % Height of the header
headershape=rounded, % Specify the rounded corner in the content box headers, can be: rectangle, small-rounded, roundedright, roundedleft or rounded
headershade=plain,
headerfont=\Large\textsf, % Large, bold and sans serif font in the headers of content boxes
%textfont={\setlength{\parindent}{1.5em}}, % Uncomment for paragraph indentation
linewidth=2pt % Width of the border lines around content boxes
}
{}
%
%----------------------------------------------------------------------------------------
% TITLE AND AUTHOR NAME
%----------------------------------------------------------------------------------------
%
{
\textsf %Sans Serif
{Some title which may be very long}
} % Poster title
{\sf\vspace{0.3em}\\
\vspace{0.1em}\\

}



\headerbox{1. Introduction}{name=introduction,column=0,row=0, span=3}{
\begin{tabular}{|P{4.0cm}|P{3.0cm}|P{3cm}|}
\hline
one & two & three \\
\hline
1   &   2 & 3 \\
\hline
1   &   2 & 3 \\
\hline
\end{tabular}

\vspace{1em}

\begin{tabular}{|P{4.0cm}|P{3.0cm}|P{3cm}|}
\hline
one & two & three \\
\hline
1   &   2 & 3 \\
\hline
1   &   2 & 3 \\
\hline
\end{tabular}

\includegraphics[width=0.30\linewidth]{example-image-a}
}

\headerbox{6. Conclusions}{name=conclusion,column=1,below=introduction,span=2,above=bottom}{

We proved that DeCAF is a significant improvement over the SEA algorithm, a popular method for comparing sets of ligands.
\begin{boenumerate}\compresslist
    \item DeCAF gives better results for 23 out of 35 receptors.
    \item For targets with easily separable active and inactive datasets, SEA and DeCAF give similar results.
    \item In cases in which SEA fails to identify active molecules, our method performs substantially better.
\end{boenumerate}
 
}


\headerbox{7. References}{name=references,column=0,span=1,below=introduction,above=bottom}{


%\small % Reduce the font size in this block
\renewcommand{\section}[2]{\vskip 0.05em} % Get rid of the default "References" section title
%\nocite{*} % Insert publications even if they are not cited in the poster


\bibliographystyle{unsrt}
\bibliography{poster} % Use sample.bib as the bibliography file
}

\end{poster}

\end{document}

在此輸入影像描述

第一次編輯

刪除/註釋段落中斷後,仍然沒有完全解決問題。該圖位於右側,但其中心仍然水平對齊,這很奇怪。

在此輸入影像描述

答案1

將兩個表格放在頂部對齊的 minipage 上\begin{minipage}[t]{<width>},並對圖形執行相同的操作。

小型頁面的頂部對齊是相對於小型頁面中第一項的基線。

像這樣的零高度不可見元素\vspace{0pt}將強制對齊到小型頁面的“真實”頂部。

A

% !TeX TS-program = pdflatex

\documentclass[a0paper,portrait]{baposter}

\usepackage{wrapfig}
\usepackage{lmodern}
\usepackage{authblk}
\usepackage[utf8]{inputenc} %unicode support
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{blindtext}
    
\selectcolormodel{cmyk}

\graphicspath{{figures/}} % Directory in which figures are stored   

\newcommand{\compresslist}{%
    \setlength{\itemsep}{0pt}%
    \setlength{\parskip}{1pt}%
    \setlength{\parsep}{0pt}%
}

\newenvironment{boenumerate}
{\begin{enumerate}\renewcommand\labelenumi{\textbf\theenumi.}}
    {\end{enumerate}}

\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}

\begin{document}
        
\definecolor{darkgreen}{cmyk}{0.8,0,0.8,0.45}
\definecolor{lightgreen}{cmyk}{0.8,0,0.8,0.25}

\begin{poster}
    {
        grid=false,
        headerborder=open, % Adds a border around the header of content boxes
        colspacing=1em, % Column spacing
        bgColorOne=white, % Background color for the gradient on the left side of the poster
        bgColorTwo=white, % Background color for the gradient on the right side of the poster
        borderColor=darkgreen, % Border color
        headerColorOne=lightgreen, % Background color for the header in the content boxes (left side)
        headerColorTwo=lightgreen, % Background color for the header in the content boxes (right side)
        headerFontColor=white, % Text color for the header text in the content boxes
        boxColorOne=white, % Background color of the content boxes
        textborder=rounded, %rectangle, % Format of the border around content boxes, can be: none, bars, coils, triangles, rectangle, rounded, roundedsmall, roundedright or faded
        eyecatcher=false, % Set to false for ignoring the left logo in the title and move the title left
        headerheight=0.11\textheight, % Height of the header
        headershape=rounded, % Specify the rounded corner in the content box headers, can be: rectangle, small-rounded, roundedright, roundedleft or rounded
        headershade=plain,
        headerfont=\Large\textsf, % Large, bold and sans serif font in the headers of content boxes
        %textfont={\setlength{\parindent}{1.5em}}, % Uncomment for paragraph indentation
        linewidth=2pt % Width of the border lines around content boxes
    }
    {}
    %
    %----------------------------------------------------------------------------------------
    % TITLE AND AUTHOR NAME
    %----------------------------------------------------------------------------------------
    %
    {
        \textsf %Sans Serif
        {Some title which may be very long}
    } % Poster title
    {\sf\vspace{0.3em}\\
        \vspace{0.1em}\\
        
    }
                    
    \headerbox{1. Introduction}{name=introduction,column=0,row=0, span=3}{
        \begin{minipage}[t]{\dimexpr 4cm+3cm+3cm + 6\tabcolsep} % added <<<
            \vspace{0pt} % needed <<<<<
            \begin{tabular}{|P{4.0cm}|P{3.0cm}|P{3cm}|}
                \hline
                one & two & three \\
                \hline
                1   &   2 & 3 \\
                \hline
                1   &   2 & 3 \\
                \hline
            \end{tabular}           
            \vspace{1em}
            
            \begin{tabular}{|P{4.0cm}|P{3.0cm}|P{3cm}|}
                \hline
                one & two & three \\
                \hline
                1   &   2 & 3 \\
                \hline
                1   &   2 & 3 \\
                \hline
            \end{tabular}
        \end{minipage}\hfill
        \begin{minipage}[t]{0.3\textwidth}% added <<<
            \vspace{0pt} % needed <<<<<
            \includegraphics[width=\linewidth]{example-image-a} 
        \end{minipage} \hfill
    }
    \headerbox{6. Conclusions}{name=conclusion,column=1,below=introduction,span=2,above=bottom}{
        
        We proved that DeCAF is a significant improvement over the SEA algorithm, a popular method for comparing sets of ligands.
        \begin{boenumerate}\compresslist
            \item DeCAF gives better results for 23 out of 35 receptors.
            \item For targets with easily separable active and inactive datasets, SEA and DeCAF give similar results.
            \item In cases in which SEA fails to identify active molecules, our method performs substantially better.
        \end{boenumerate}
        
    }
            
    \headerbox{7. References}{name=references,column=0,span=1,below=introduction,above=bottom}{
        
        
        %\small % Reduce the font size in this block
        \renewcommand{\section}[2]{\vskip 0.05em} % Get rid of the default "References" section title
        %\nocite{*} % Insert publications even if they are not cited in the poster
        
        
%           \bibliographystyle{unsrt}
%           \bibliography{poster} % Use sample.bib as the bibliography file
    }
    
\end{poster}

\end{document}

相關內容