scrreprt 在第一页的左上角设置收件人

scrreprt 在第一页的左上角设置收件人

我必须为考试做一份书面阐述,而且我对 LaTeX 还比较陌生。我想将接收器设置在首页的左上角,就像在信中一样。这是我的代码:

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[a4paper,openright,fontsize=11pt]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[german]{fancyref}
\usepackage[automark,headsepline]{scrpage2}
\usepackage{graphicx}
\usepackage[hyphens,spaces,obeyspaces]{url}
\usepackage{etoolbox}
\usepackage{hyperref}
\usepackage{tabularx}
\usepackage{setspace}
\makeatletter
\newcommand{\MSonehalfspacing}{%
  \setstretch{1.44}%  default
  \ifcase \@ptsize \relax % 10pt
    \setstretch {1.448}%
  \or % 11pt
    \setstretch {1.399}%
  \or % 12pt
    \setstretch {1.433}%
  \fi
}
\newcommand{\MSdoublespacing}{%
  \setstretch {1.92}%  default
  \ifcase \@ptsize \relax % 10pt
    \setstretch {1.936}%
  \or % 11pt
    \setstretch {1.866}%
  \or % 12pt
    \setstretch {1.902}%
  \fi
}
\makeatother
\MSonehalfspacing

% Creating of the first page (cover sheet)
\title{Anonymität im Internet -}
\subtitle{Eine Bedrohung für die Demokratie?}
\author{\texorpdfstring{My Name\\[1cm]\includegraphics[scale=0.2]{figures/matlabgraph}\\[1cm] {\small Lehrer: My teacher\\\small Fach: Informatik\\\small Bezugsfach: Politikwissenschaften}}{My Name}}
\date{\small}
\makeatletter
\hypersetup{%
    pdftitle={\@title},%
    pdfsubject={\@subject},%
    pdfauthor={\@author},%
    pdfkeywords={},%
    colorlinks,%
    citecolor=black,%
    filecolor=black,%
    linkcolor=black,%
    urlcolor=black}%
\makeatother

\begin{document}
\maketitle 
\pagenumbering{roman}
% To avoid a new page if using '\chaper*{}'
\let\cleardoublepage\clearpage
\chapter*{Der Arbeitsprozess}
\end{document}

我怎样才能将接收器(在本例中是我的学校地址)放在左上角?

答案1

这是一个使用环境的简单示例titlepage。请注意,您不需要\maketitle。但您必须完全自己布局标题页。

\begin{titlepage}请参阅以下代码(对于您来说重要的是和之间的部分\end{titlepage}):

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[%
  paper=a4,
  openright,
  fontsize=11pt,
  ngerman
]{scrreprt}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}

\usepackage[german]{fancyref}
\usepackage[automark,headsepline]{scrlayer-scrpage} % <=================
\usepackage{graphicx}

\usepackage{etoolbox}
\usepackage{tabularx}
\usepackage{setspace}

\usepackage{blindtext} % to create dummy text
\usepackage[hyphens,spaces,obeyspaces]{url}
\usepackage{hyperref}

\makeatletter
\newcommand{\MSonehalfspacing}{%
  \setstretch{1.44}%  default
  \ifcase \@ptsize \relax % 10pt
    \setstretch {1.448}%
  \or % 11pt
    \setstretch {1.399}%
  \or % 12pt
    \setstretch {1.433}%
  \fi
}
\newcommand{\MSdoublespacing}{%
  \setstretch {1.92}%  default
  \ifcase \@ptsize \relax % 10pt
    \setstretch {1.936}%
  \or % 11pt
    \setstretch {1.866}%
  \or % 12pt
    \setstretch {1.902}%
  \fi
}
\makeatother
\MSonehalfspacing

% Creating of the first page (cover sheet)
\title{Anonymität im Internet -}
\subtitle{Eine Bedrohung für die Demokratie?}
\author{\texorpdfstring{My Name\\[1cm]\includegraphics[scale=0.2]{example-image}\\[1cm] {\small Lehrer: My teacher\\\small Fach: Informatik\\\small Bezugsfach: Politikwissenschaften}}{My Name}}
\date{01. Mai 2019} % <=================================================
\makeatletter
\hypersetup{%
    pdftitle={\@title},%
    pdfsubject={\@subject},%
    pdfauthor={\@author},%
    pdfkeywords={},%
    colorlinks,%
    citecolor=black,%
    filecolor=black,%
    linkcolor=black,%
    urlcolor=black}%
\makeatother

\setlength{\headheight}{20pt}


\begin{document}

%\maketitle % not needed with titlepage
\begin{titlepage}
Schule für Duck-Diplom \par
Dagobert-Duck-Str. 1 \par
\vspace{\baselineskip}

D 12345 Entenhausen

\centering
\vspace{3\baselineskip} % vertical space, change for your needs
\makeatletter
\@author

\vspace{2\baselineskip}
{\Large
  \@title
}

\vspace{\baselineskip}
\@subtitle

\vspace{3\baselineskip}
\@date

\vfill
\includegraphics[width=3cm]{example-image-duck}
\makeatother
\end{titlepage}


\pagenumbering{roman}
% To avoid a new page if using '\chaper*{}'
\let\cleardoublepage\clearpage
\chapter*{Der Arbeitsprozess}
\blindtext
\end{document}

以及最终的标题页:

生成的标题页

顺便说一句:我使用你的代码做了一些漂亮的打印,并将其移至hyperref你案例中最后调用的包。

相关内容