如何让我的标题在 tikzposter 中换行

如何让我的标题在 tikzposter 中换行

我正在使用 tikzposter 文档类制作海报,它运行良好,只是我的标题太长,我无法使其换行,我尝试过\\\protect和。并抛出错误并且不执行任何操作。\newline\par\\\par\newline

这是我的代码:

\documentclass[25pt, a0paper, portrait, margin=10mm, innermargin=15mm, lockverticalspace=15mm, colspace=15mm, subcolspace=8mm]{tikzposter}
\title{Making posters with really long titles: The hassles of using \LaTeX when I could be doing it in some WYSIWYG editor instead.}
\author{frogamic}
\institute{University}
\begin{document}
  \maketitle
  \block{Intro}{Intro stuff}
  \begin{columns}
   \column{0.5}
      \block{Method}{Method stuff}
    \column{0.5}
      \block {Results}{Results stuff}
  \end{columns}
\end{document}

答案1

把这写在你的序言中:

\makeatletter
\def\title#1{\gdef\@title{\scalebox{\TP@titletextscale}{%
\begin{minipage}[t]{\linewidth}
\centering
#1
\par
\vspace{0.5em}
\end{minipage}%
}}}
\makeatother

代码:

\documentclass[25pt, a0paper, portrait, margin=10mm, innermargin=15mm, lockverticalspace=15mm, colspace=15mm, subcolspace=8mm]{tikzposter}

\makeatletter
\def\title#1{\gdef\@title{\scalebox{\TP@titletextscale}{%
\begin{minipage}[t]{\linewidth}
\centering
#1
\par
\vspace{0.5em}
\end{minipage}%
}}}
\makeatother

\title{Making posters with really long titles: The hassles of using \LaTeX{} when I could be doing it in some WYSIWYG editor instead.}
\author{frogamic}
\institute{University}
\begin{document}
  \maketitle
  \block{Intro}{Intro stuff}
  \begin{columns}
   \column{0.5}
      \block{Method}{Method stuff}
    \column{0.5}
      \block {Results}{Results stuff}
  \end{columns}
\end{document}

在此处输入图片描述

答案2

根据这个相同的问题:tikzposter 中的长标题

我通过将标题放在\parbox:中解决了这个问题

\title{\parbox{\linewidth}{\centering Making posters with really long titles: The hassles of using LaTeX when I could be doing it in some WYSIWYG editor instead.}}}

相关内容