%20%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%82%92%E4%B8%AD%E5%A4%AE%E6%8F%83%E3%81%88%E3%81%AB%E3%81%97%E3%81%AA%E3%81%8C%E3%82%89%E5%B7%A6%E6%8F%83%E3%81%88%E3%81%AB%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%97%E3%82%87%E3%81%86%E3%81%8B%3F.png)
論文のヘッダーを作成しようとしています。次のように、テキストを左揃えで中央に配置する必要があります。
私は次のようなアプローチでそれをやってみました:
\documentclass[12pt]{report}
%other packages
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% ------- PORTADA -------
\title{PORTADA}
\author{}
\date{}
\begin{document}
\maketitle
\fancyhead{}
\fancyfoot{}
\fancyhead[L]{\centering{Some text
some really long long long long text
other long looong text}}
\fancyhead[R]{Some text
}
\fancyheadoffset[lh]{2cm}
そして結果は次のようになります:
どうすればそれを達成できるでしょうか?
答え1
表の中央のセルに資料を配置できます (列間のスペースを削除して、@{}
テキストがすぐに左余白にくるようにします)。
私は追加しましたショーフレームレイアウトをより見やすくするためのパッケージ。
\documentclass[12pt]{report}
%other packages
\usepackage{showframe} % to show the frames of the page
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhead{}
\fancyfoot{}
\fancyhead[L]{\begin{tabular}{@{}c}
Some text \\
some really long long long long text\\
other long looong text
\end{tabular}}
\fancyhead[R]{Some text}
% dimensions suggested by the fancyhdr package when theses two lines are commented
\setlength{\headheight}{43.5pt}
\addtolength{\topmargin}{-2pt}
\usepackage{lipsum} % dummy text
% ------- PORTADA -------
\title{PORTADA}
\author{}
\date{}
\begin{document}
\maketitle
\lipsum[1]
\end{document}