%20%E3%81%AB%E5%9F%8B%E3%82%81%E8%BE%BC%E3%82%80.png)
私は複数の列を持つポスターを作成中です ( 経由multicols
、おそらくカスタム ポスター タイトルがあるため)。 を使用できることはわかっていますalgorithmic2e
が、 を使い続けたいと思っていますalgorithmicx
。これを処理する方法はあるでしょうか?
Package multicol Warning: Floats and marginpars not allowed
inside `multicols' environment!.
私が見つけたすべての解決策は、algorithmic2e
ドキュメントを を使用するか、または として宣言することを提案しています\documentclass[twocolumn]{article}
。
後者をどう使えばいいのか分からないポスターテンプレート。
algorithm
これは、上記のテンプレートからコピーした環境とアルゴリズムのコードを含む最小限の動作コードです。この質問そこには何も表示されていないようです:
\documentclass[a0,landscape]{a0poster}
\usepackage{multicol} % This is so we can have multiple columns of text side-by-side
\columnsep=100pt % This is the amount of white space between the columns in the poster
\columnseprule=3pt % This is the thickness of the black line between the columns in the poster
\usepackage[svgnames]{xcolor} % Specify colors by their 'svgnames', for a full list of all colors available see here: http://www.latextemplates.com/svgnames-colors
% \usepackage{times} % Use the times font
\usepackage{palatino} % Uncomment to use the Palatino font
\usepackage{graphicx} % Required for including images
\graphicspath{{figures/}} % Location of the graphics files
\usepackage{booktabs} % Top and bottom rules for table
\usepackage[font=small,labelfont=bf]{caption} % Required for specifying captions to tables and figures
\usepackage{amsfonts, amsmath, amsthm, amssymb} % For math fonts, symbols and environments
\usepackage{wrapfig} % Allows wrapping text around tables and figures
%% custom packages
\usepackage{tikz}
\usepackage{relsize}
\usepackage{anyfontsize}
\usepackage{algpseudocode,algorithm,algorithmicx}
\newcommand*\DNA{\textsc{dna}}
\newcommand*\Let[2]{\State #1 $\gets$ #2}
\algrenewcommand\algorithmicrequire{\textbf{Precondition:}}
\algrenewcommand\algorithmicensure{\textbf{Postcondition:}}
\begin{document}
\begin{minipage}[b]{0.55\linewidth}
\veryHuge \color{NavyBlue} \textbf{Title} \color{Black}\\ % Title
\Huge\textit{Subtitle}\\[1cm] % Subtitle
\end{minipage}
\begin{minipage}[b]{0.25\linewidth}
\color{DarkSlateGray}
% Department Name\\ % Address
\end{minipage}
\begin{minipage}[b]{0.19\linewidth}
\includegraphics[width=20cm]{logo.png} % Logo or a photo of you, adjust its dimensions here
\end{minipage}
\vspace{1cm} % A bit of extra whitespace between the header and poster content
\begin{multicols}{3} % This is how many columns your poster will be broken into, a poster with many figures may benefit from less columns whereas a text-heavy poster benefits from more
\begin{abstract}
Some abstract.
\end{abstract}
\section*{Introduction}
Some intro
\section*{Main Objectives}
\begin{enumerate}
\item Lorem ipsum dolor sit amet, consectetur.
\item Nullam at mi nisl. Vestibulum est purus, ultricies cursus volutpat sit amet, vestibulum eu.
\item Praesent tortor libero, vulputate quis elementum a, iaculis.
\end{enumerate}
\color{Black}
\begin{algorithm}
\caption{Counting mismatches between two packed \DNA strings
\label{alg:packed-dna-hamming}}
\begin{algorithmic}[1]
\Require{$x$ and $y$ are packed \DNA strings of equal length $n$}
\Statex
\Function{Distance}{$x, y$}
\Let{$z$}{$x \oplus y$} \Comment{$\oplus$: bitwise exclusive-or}
\Let{$\delta$}{$0$}
\For{$i \gets 1 \textrm{ to } n$}
\If{$z_i \neq 0$}
\Let{$\delta$}{$\delta + 1$}
\EndIf
\EndFor
\State \Return{$\delta$}
\EndFunction
\end{algorithmic}
\end{algorithm}
\end{multicols}
\end{document}
ありがとう。
答え1
感謝デビッド・チャーライル、私はそれを理解しました。
解決策は簡単です。以下を置き換えるだけです:
\begin{algorithm}
と
\begin{algorithm}[H]
そしてすべてが魔法のように機能し始めます。実際、フローティング環境を他のフローティング環境内で使用することは避けるべきでしょう。