文档中图形放置错误

文档中图形放置错误

我想在页面(文档)开头插入我公司的徽标。以下是该代码。不幸的是,它溢出到了下一页。

    \documentclass[paper=a4, fontsize=11pt]{scrartcl}
                            \usepackage[T1]{fontenc}
                            \usepackage{fourier}
                            \usepackage{listings}
                            \usepackage[english]{babel}                                             % English language/hyphenation
                            \usepackage[protrusion=true,expansion=true]{microtype}  
                            \usepackage{amsmath,amsfonts,amsthm} % Math packages
                            \usepackage[pdftex]{graphicx}   
                            \usepackage{url}
                            \usepackage{color}
                            \usepackage[most]{tcolorbox}
                            \usepackage{hyperref}
                            \usepackage{graphicx}
                            \definecolor{dkgreen}{rgb}{0,0.6,0}
                            \definecolor{gray}{rgb}{0.5,0.5,0.5}
                            \definecolor{mauve}{rgb}{0.58,0,0.82}
                            \hypersetup{colorlinks,%
                                        urlcolor=blue,%
                                        pdftex}
                            \usepackage[english]{babel}
                            \usepackage{blindtext}
                            \lstset{frame=tb,
                              language=Java,
                              aboveskip=3mm,
                              belowskip=3mm,
                              showstringspaces=false,
                              columns=flexible,
                              basicstyle={\small\ttfamily},
                              numbers=none,
                              numberstyle=\tiny\color{gray},
                              keywordstyle=\color{blue},
                              commentstyle=\color{dkgreen},
                              stringstyle=\color{mauve},
                              breaklines=true,
                              breakatwhitespace=true,
                              tabsize=3
                            }


                            %%% Custom sectioning
                            \usepackage{sectsty}
                            \allsectionsfont{\centering \normalfont\scshape}


                            %%% Custom headers/footers (fancyhdr package)
                            \usepackage{fancyhdr}
                            \pagestyle{fancyplain}
                            \fancyhead{}                                            % No page header
                            \fancyfoot[L]{}                                         % Empty 
                            \fancyfoot[C]{}                                         % Empty
                            \fancyfoot[R]{\thepage}                                 % Pagenumbering
                            \renewcommand{\headrulewidth}{0pt}          % Remove header underlines
                            \renewcommand{\footrulewidth}{0pt}              % Remove footer underlines
                            \setlength{\headheight}{13.6pt}


                            %%% Equation and float numbering
                            \numberwithin{equation}{section}        % Equationnumbering: section.eq#
                            \numberwithin{figure}{section}          % Figurenumbering: section.fig#
                            \numberwithin{table}{section}               % Tablenumbering: section.tab#


                            %%% Maketitle metadata
                            \newcommand{\horrule}[1]{\rule{\linewidth}{#1}}     % Horizontal rule

                            \title{
                                    %\vspace{-1in}  
                                    \usefont{OT1}{bch}{b}{n}
                                    \begin{figure}
                                        \centering
                                        \includegraphics[scale=0.4]{example-image-a}
                                    \end{figure}
                                    \normalfont \normalsize \textsc{Yup} \\ [25pt]
                                    \horrule{0.5pt} \\[0.4cm]
                                    \huge A B C DE  FG HIJ KL MNO \\
                                    \horrule{2pt} \\[0.5cm]
                            }
                            \author{
                                    \normalfont                                 \normalsize
                                    "If you can't explain it simply, you don't understand it well enough."
                            - Albert Einstein\\[-3pt]       \normalsize
                                    \today
                            }
                            \date{}


                            %%% Begin document
                            \begin{document}
                            \maketitle
                            \section{Objective}
                            \blindtext
                            \section{Background}
                            \blindtext

                        \end{document}

答案1

这可能应该可以解决问题(未经测试)并且还可以稍微纠正你的序言。

\documentclass[paper=a4, fontsize=11pt]{scrartcl}
                        \usepackage[T1]{fontenc}
                        \usepackage{fourier}
                        \usepackage{listings}
                        \usepackage[english]{babel}                                             % English language/hyphenation
                        \usepackage[protrusion=true,expansion=true,babel=true]{microtype}  %helps microtype to better stick to the language restrictions
                        \usepackage{amsmath,amsfonts,amsthm} % Math packages
                        \usepackage[pdftex]{graphicx}   
                        \usepackage{url}
                        %\usepackage{color}
                        \usepackage{xcolor}  %better colour support
                        \usepackage[most]{tcolorbox}
                        %\usepackage{hyperref}  %should be loaded last in preamble
                        \usepackage{graphicx}
                        \definecolor{dkgreen}{rgb}{0,0.6,0}
                        \definecolor{gray}{rgb}{0.5,0.5,0.5}
                        \definecolor{mauve}{rgb}{0.58,0,0.82}
                        %\hypersetup{colorlinks,%
                                    %urlcolor=blue,%
                                    %pdftex}
                        %\usepackage[english]{babel}  %already loaded above
                        \usepackage{blindtext}
                        \lstset{frame=tb,
                          language=Java,
                          aboveskip=3mm,
                          belowskip=3mm,
                          showstringspaces=false,
                          columns=flexible,
                          basicstyle={\small\ttfamily},
                          numbers=none,
                          numberstyle=\tiny\color{gray},
                          keywordstyle=\color{blue},
                          commentstyle=\color{dkgreen},
                          stringstyle=\color{mauve},
                          breaklines=true,
                          breakatwhitespace=true,
                          tabsize=3
                        }


                        %%% Custom sectioning
                        \usepackage{sectsty}
                        \allsectionsfont{\centering \normalfont\scshape}


                        %%% Custom headers/footers (fancyhdr package)
                        \usepackage{fancyhdr}
                        \pagestyle{fancyplain}
                        \fancyhead{}                                            % No page header
                        \fancyfoot[L]{}                                         % Empty 
                        \fancyfoot[C]{}                                         % Empty
                        \fancyfoot[R]{\thepage}                                 % Pagenumbering
                        \renewcommand{\headrulewidth}{0pt}          % Remove header underlines
                        \renewcommand{\footrulewidth}{0pt}              % Remove footer underlines
                        \setlength{\headheight}{13.6pt}


                        %%% Equation and float numbering
                        \numberwithin{equation}{section}        % Equationnumbering: section.eq#
                        \numberwithin{figure}{section}          % Figurenumbering: section.fig#
                        \numberwithin{table}{section}               % Tablenumbering: section.tab#


                        \usepackage{hyperref}  %should be loaded last in preamble
                        \hypersetup{colorlinks,%
                                    urlcolor=blue,%
                                    pdftex}

                        %%% Maketitle metadata
                        \newcommand{\horrule}[1]{\rule{\linewidth}{#1}}     % Horizontal rule

                        \title{
                                %\vspace{-1in}  
                                \usefont{OT1}{bch}{b}{n}
                                \centering
                                \includegraphics[scale=0.4]{example-image-a}
                                \normalfont \normalsize \textsc{Yup} \\ [25pt]
                                \horrule{0.5pt} \\[0.4cm]
                                \huge A B C DE  FG HIJ KL MNO \\
                                \horrule{2pt} \\[0.5cm]
                        }
                        \author{
                                \normalfont                                 \normalsize
                                "If you can't explain it simply, you don't understand it well enough."
                        - Albert Einstein\\[-3pt]       \normalsize
                                \today
                        }
                        \date{}


                        %%% Begin document
                        \begin{document}
                        \maketitle
                        \section{Objective}
                        \blindtext
                        \section{Background}
                        \blindtext

                    \end{document}

相关内容