
편집 1: 이미지는 "4줄 대신 3줄"이어야 합니다.
편집 2: 컴파일 가능한 코드가 업데이트되었습니다.
저는 Latex를 처음 사용하며 논문 제목을 제공하는 다음과 같은 템플릿 코드를 가지고 있습니다.
\documentclass[headsepline,footsepline,footinclude=false,oneside,fontsize=11pt,paper=a4,listof=totoc,bibliography=totoc]{scrbook} % one-sided
\usepackage{graphicx}
\usepackage[ngerman,american]{babel}
\newcommand*{\getUniversity}{University of Earth}
\newcommand*{\getFaculty}{Engineering Department}
\newcommand*{\getDegree}{Computer Science}
\newcommand*{\getSchool}{School of Public Science}
\newcommand*{\getTitle}{This is a Long title that I want to stretch the Margin so that instead of 4 lines, it should only be 3 lines, and the logo at the end won't break}
\newcommand*{\getTitleGer}{This is a Long title that I want to stretch the Margin so that instead of 4 lines, it should only be 3 lines, and the logo at the end won't break}
\newcommand*{\getAuthor}{Author}
\newcommand*{\getDoctype}{Thesis}
\newcommand*{\getSupervisor}{Faculty Professor}
\newcommand*{\getAdvisor}{Faculty Advisr}
\newcommand*{\getSubmissionDate}{\today}
\newcommand*{\getSubmissionLocation}{Somewhere In between}
\begin{document}
\begin{titlepage}
\centering
\includegraphics[height=20mm]{example-image-a}
\vspace{5mm}
{\huge\MakeUppercase{School of \getSchool{} --- \getFaculty{}} \par}
\vspace{5mm}
{\large\MakeUppercase{\getUniversity{}} \par}
\vspace{20mm}
% \vspace{6mm}
{\Large \getDoctype{} in \getDegree{} \par}
\vspace{15mm}
% \vspace{4mm}
{\huge\bfseries \getTitle{} \par}
\vspace{5mm}
{\huge\bfseries \foreignlanguage{ngerman}{\getTitleGer{}} \par}
\vspace{10mm}
\begin{tabular}{l l}
Author: & \getAuthor{} \\
Supervisor: & \getSupervisor{} \\
Advisors: & \getAdvisor{} \\
Submission Date: & \getSubmissionDate{} \\
\end{tabular}
\vfill{}
\includegraphics[height=15mm]{example-image-b}
\end{titlepage}
\end{document}
두 가지 질문이 있습니다.
\getTitle{} 부분의 줄 여백을 늘리는 방법이 있나요? 글꼴 크기와 vspace{} 사양을 유지하고 싶습니다. 제목이 길어질수록 매우 빠르게 3~4줄로 나뉘는 경향이 있습니다. 2~3줄 정도 늘려볼까 합니다.
제목이 너무 긴 경우 저작자 부분과 최종 부분
faculty_logo
(코드 조각의 이미지 예 B)이 다음 페이지로 넘어갑니다. 다음 페이지로 이동하지 않고 항상 페이지 하단에 있는 이 두 구성 요소를 수정하는 방법이 있나요?
전반적으로 나는 코드 조각에 정의된 동일한 텍스트 길이의 3줄이 포함된 2개의 제목을 원하며 모든 것이 동일한 페이지에 있어야 합니다.
답변1
\parbox
아마도 여백에 튀어나오는 를 생성하는 매크로로 충분할 것입니다 .
\documentclass[headsepline,footsepline,footinclude=false,oneside,fontsize=11pt,paper=a4,listof=totoc,bibliography=totoc]{scrbook} % one-sided
%---------------------------------------------------------
\newsavebox\scratchbox
\newcommand\boxIntoMargins[4]{%
\savebox\scratchbox{%
\mbox{%
\kern-\dimexpr(#1)\relax
\parbox[b]{\dimexpr((#1)+(#2)+(#3))\relax}{#4}%
}%
}%
\wd\scratchbox=\linewidth
\usebox\scratchbox
}%
%---------------------------------------------------------
\usepackage{graphicx}
\usepackage[ngerman,american]{babel}
\newcommand*{\getUniversity}{University of Earth}
\newcommand*{\getFaculty}{Engineering Department}
\newcommand*{\getDegree}{Computer Science}
\newcommand*{\getSchool}{School of Public Science}
\newcommand*{\getTitle}{%
\boxIntoMargins{1.5cm}{\linewidth}{1.5cm}{%
\centering
This is a Long title that I want to stretch the Margin so that instead of 4 lines, it should only be 3 lines, and the logo at the end won't break%
}%
}
\newcommand*{\getTitleGer}{%
\boxIntoMargins{1.5cm}{\linewidth}{1.5cm}{%
\centering
This is a Long title that I want to stretch the Margin so that instead of 4 lines, it should only be 3 lines, and the logo at the end won't break%
}%
}
\newcommand*{\getAuthor}{Author}
\newcommand*{\getDoctype}{Thesis}
\newcommand*{\getSupervisor}{Faculty Professor}
\newcommand*{\getAdvisor}{Faculty Advisr}
\newcommand*{\getSubmissionDate}{\today}
\newcommand*{\getSubmissionLocation}{Somewhere In between}
\begin{document}
\begin{titlepage}
\centering
\includegraphics[height=20mm]{example-image-a}
\vspace{5mm}
{\huge\MakeUppercase{School of \getSchool{} --- \getFaculty{}} \par}
\vspace{5mm}
{\large\MakeUppercase{\getUniversity{}} \par}
\vspace{20mm}
% \vspace{6mm}
{\Large \getDoctype{} in \getDegree{} \par}
\vspace{15mm}
% \vspace{4mm}
{\huge\bfseries \getTitle{} \par}
\vspace{5mm}
{\huge\bfseries \foreignlanguage{ngerman}{\getTitleGer{}} \par}
\vspace{10mm}
\begin{tabular}{l l}
Author: & \getAuthor{} \\
Supervisor: & \getSupervisor{} \\
Advisors: & \getAdvisor{} \\
Submission Date: & \getSubmissionDate{} \\
\end{tabular}
\vfill{}
\includegraphics[height=15mm]{example-image-b}
\end{titlepage}
\end{document}
Overleaf를 사용한 컴파일 스크린샷:
템플릿의 기본값을 다시 조정하는 것을 잊었습니다. 이미지 b의 높이는 20mm여야 하며, 여전히 두 번째 페이지로 넘어갑니다. 항상 한 페이지에 보관하는 방법이 있나요?
이 답변의 초기 릴리스 작성자는 단일 페이지에 맞추기에는 텍스트가 너무 많다는 조건이 항상 더 많은 텍스트를 포함함으로써 충족될 수 있기 때문에 항상 단일 페이지에 내용을 보관할 수 있는 방법이 없다고 추측합니다. ;-) 그리고 그는 한 페이지에 내용을 담을 가능성을 높이기 위해 조정 작업을 자동화하려는 노력이 가치가 없을 수도 있다고 생각합니다.
제목 페이지의 내용을 종이 크기를 초과할 수 있는 별도의 페이지에 배치 하고 graphicxs 패키지의 \newsavebox
명령 사용 과 종이에 맞게 상자 크기를 축소하는 명령을 결합할 수 있습니다.\scalebox
\usebox
또는 별도의 .pdf 파일이 생성될 별도의 .tex 문서에 제목 페이지를 두고, 이를 통해 \includegraphics
기본 문서의 용지 크기에 맞게 축소하여 기본 문서에 포함하게 됩니다. 완료됩니다. 별도의 .tex 문서 내에서 문서의 용지 치수를 초과하는 제목 페이지가 들어 있는 상자는 \(pdf)pagewidth
및 를 조정한 후 배송됩니다 \(pdf)pageheight
.
다음은 이러한 방식으로 문제에 접근하는 방법에 대한 개요일 수 있습니다.
\documentclass{article}
\newbox\BoxWithTitlepage
\newcommand\ShipoutAsPage[1]{%
\begingroup
\setbox\BoxWithTitlepage=\vbox{%
\hrule height 0pt
#1\ifvmode\else\expandafter\endgraf\fi
\hrule height 0pt
}%
\csname @ifundefined\endcsname{pagewidth}{}{\pagewidth=\wd\BoxWithTitlepage}%
\csname @ifundefined\endcsname{pdfpagewidth}{}{\pdfpagewidth=\wd\BoxWithTitlepage}%
\csname @ifundefined\endcsname{pageheight}{}{\pageheight=\ht\BoxWithTitlepage
\advance\pageheight\dp\BoxWithTitlepage}%
\csname @ifundefined\endcsname{pdfpageheight}{}{\pdfpageheight=\ht\BoxWithTitlepage
\advance\pdfpageheight\dp\BoxWithTitlepage}%
\shipout\vbox{\kern-1truein\hbox{\kern-1truein\box\BoxWithTitlepage}}%
\endgroup
}%
\begin{document}
\ShipoutAsPage{%
% Content of your titlepage
% Content of your titlepage
% Content of your titlepage
% Content of your titlepage
}%
\end{document}
그러나 이것이 실제로 권장될 수 없는 데에는 다음과 같은 이유가 있습니다.
- 이렇게 하면 제목 페이지에서 문서의 다른 위치로 쉽게 하이퍼링크를 가질 수 없습니다.
- 글꼴이 더 이상 원래 크기가 아니기 때문에 크기 조정이 보기 좋지 않습니다.
- 테이블이나 환경에서 생성된 이미지 등의 규칙/선
tikzpicture
은 사물을 더 작은 크기로 축소할 때 너무 얇아져 인쇄할 수 없을 수 있습니다.
그러므로 "손으로" 조정하는 것이 더 나을 수도 있습니다. 예를 들어 제목 페이지의 활자 영역을 종이 아래쪽으로 약간 확대하고 위쪽으로 약간 커닝하는 것입니다. 다음은 "quick'n dirty" 솔루션이지만 목적을 달성할 수도 있습니다.
\documentclass[headsepline,footsepline,footinclude=false,oneside,fontsize=11pt,paper=a4,listof=totoc,bibliography=totoc]{scrbook} % one-sided
%---------------------------------------------------------
\newsavebox\scratchbox
\newcommand\boxIntoMargins[4]{%
\savebox\scratchbox{%
\mbox{%
\kern-\dimexpr(#1)\relax
\parbox[b]{\dimexpr((#1)+(#2)+(#3))\relax}{#4}%
}%
}%
\wd\scratchbox=\linewidth
\usebox\scratchbox
}%
%---------------------------------------------------------
\usepackage{graphicx}
\usepackage[ngerman,american]{babel}
\newcommand*{\getUniversity}{University of Earth}
\newcommand*{\getFaculty}{Engineering Department}
\newcommand*{\getDegree}{Computer Science}
\newcommand*{\getSchool}{School of Public Science}
\newcommand*{\getTitle}{%
\boxIntoMargins{1.5cm}{\linewidth}{1.5cm}{%
\centering
This is a Long title that I want to stretch the Margin so that instead of 4 lines, it should only be 3 lines, and the logo at the end won't break%
}%
}
\newcommand*{\getTitleGer}{%
\boxIntoMargins{1.5cm}{\linewidth}{1.5cm}{%
\centering
This is a Long title that I want to stretch the Margin so that instead of 4 lines, it should only be 3 lines, and the logo at the end won't break%
}%
}
\newcommand*{\getAuthor}{Author}
\newcommand*{\getDoctype}{Thesis}
\newcommand*{\getSupervisor}{Faculty Professor}
\newcommand*{\getAdvisor}{Faculty Advisr}
\newcommand*{\getSubmissionDate}{\today}
\newcommand*{\getSubmissionLocation}{Somewhere In between}
\begin{document}
\begin{titlepage}
\enlargethispage{1cm}%
\hrule height 0mm
\kern-.5cm
\centering
\includegraphics[height=20mm]{example-image-a}
\vspace{5mm}
{\huge\MakeUppercase{School of \getSchool{} --- \getFaculty{}} \par}
\vspace{5mm}
{\large\MakeUppercase{\getUniversity{}} \par}
\vspace{20mm}
% \vspace{6mm}
{\Large \getDoctype{} in \getDegree{} \par}
\vspace{15mm}
% \vspace{4mm}
{\huge\bfseries \getTitle{} \par}
\vspace{5mm}
{\huge\bfseries \foreignlanguage{ngerman}{\getTitleGer{}} \par}
\vspace{10mm}
\begin{tabular}{l l}
Author: & \getAuthor{} \\
Supervisor: & \getSupervisor{} \\
Advisors: & \getAdvisor{} \\
Submission Date: & \getSubmissionDate{} \\
\end{tabular}
\vfill{}
\includegraphics[height=20mm]{example-image-b}
\end{titlepage}
\end{document}
비율 ⟨상단 여백 높이⟩:⟨하단 여백 높이⟩가 1:1이 아닌 경우 수직으로 커닝하고 해당 비율 아래로 문자 영역을 확대하는 것을 보장하기 위해 좀 더 계산을 해야 할 수도 있습니다. 아직도 보존되어 있습니다.
⟨왼쪽 여백 너비⟩:⟨오른쪽 여백 너비⟩가 1:1이 아닌 경우 다음을 보장하기 위해 조금 더 계산해야 할 수도 있습니다.
\boxIntoMargins{<amount of horizontal space that sticks into left margin>}%
{\linewidth}%
{<amount of horizontal space that sticks into right margin>}%
{...}%
그 비율이 유지됩니다.
{\huge\MakeUppercase{School of \getSchool{} --- \getFaculty{}} \par}
아마도 첫 번째 em-dash 직전에 줄 바꿈이 발생하고 교수진을 나타내는 전체 문자열이 자체적으로 한 줄에 맞도록 항목을 정렬하면 이 줄이 멋져 보일 것입니다. em-대시가 뒤에 추가되어 \getFaculty{}
교수 문자열이 두 개의 em-대시 사이에 중첩됩니다. ;-)
Btw: 귀하의 예제 코드는 나에게 다음을 생각나게 합니다.제목 페이지 뒤에 원치 않는 빈 페이지가 있는 스크북이 있는 표지 및 제목 페이지. 아마도 거기에서 유용한 통찰력을 찾을 수 있을 것입니다.