如何在LaTeX中水平居中标题?

时间:2018-04-23 22:24:47

标签: alignment latex

我无法让它发挥作用。我有这个:

%--------------------------------------------------------------------------------------
%   TITLE SECTION 
%--------------------------------------------------------------------------------------
\setbeamertemplate{title}[center]
\setbeamertemplate{frametitle}[default][center]

\title{My title is here....!} % Poster title

它自动对齐左边!虽然我希望它在中间对齐。

我在这里做错了什么?

这是我正在使用的模板:https://www.overleaf.com/15692924fftndxdzdqbs#/59666612/

2 个答案:

答案 0 :(得分:2)

以下对我来说很好。

\documentclass[]{article}
\begin{document}
\begin{center}
 {\huge My Title}
\end{center}
\end{document}

答案 1 :(得分:0)

我通过用户samcarter得到了答案,您可以在此处找到:

https://tex.stackexchange.com/questions/428173/how-to-horizontally-align-title

% !TeX TS-program = xelatex
\documentclass[final]{beamer}

\usepackage[scale=1.150]{beamerposter} 
\usetheme{MUWposter} 

\title{Titel des Posters, Schriftgröße variabel} % Poster title
\author{AutorInnen, Schriftgröße variabel} % Author(s)
\institute{Klinik, Medizinische Universität Wien, Schriftgröße variabel} % Institution(s)


\setbeamertemplate{headline}{
 \leavevmode
  \begin{columns}
   \begin{column}{0.04\linewidth}
   \end{column}
   \begin{column}{0.9\linewidth}
    \vskip12cm
%    \raggedright
        \centering
    \usebeamercolor{title in headline}{\color{blueMUW}\Huge{\textbf{\inserttitle}}\\[1.5ex] \par}
    \usebeamercolor{author in headline}{\color{blueMUW}\LARGE{\insertauthor}\\[1ex]}
    \usebeamercolor{institute in headline}{\color{blueMUW}\normalsize{\insertinstitute}}
    \vskip1cm
   \end{column}
   \begin{column}{0.05\linewidth}
   \end{column}
   %\vspace{1cm}
  \end{columns}
 %\vspace{0.5in}
 %\hspace{0.5in}\begin{beamercolorbox}[wd=35in,colsep=0.15cm]{cboxb}\end{beamercolorbox}
 %\vspace{0.1in}
 \vspace*{-0.1cm}
}

\begin{document}

\begin{frame}[t] % The whole poster is enclosed in one beamer frame
test
\end{frame} % End of the enclosing frame

\end{document}