我正在嘗試製作一些線條垂直空間以奉獻精神。但是,我找不到如何做。
這是我正在使用的程式碼:
\newenvironment{dedication}
{\clearpage % we want a new page
\thispagestyle{empty}% no header and footer
\vspace*{\stretch{1}}% some space at the top
\itshape % the text is in italics
\raggedleft % flush to the right margin
}
{\par % end the paragraph
\vspace{\stretch{3}} % space at bottom is three times that at the top
\clearpage % finish off the page
}
當我嘗試這樣做以獲得一個空白行時。我什麼也沒得到。
\begin{dedication}
ABC \\ \\ DEF
\end{dedication}
John
我該如何更改此程式碼中的字體樣式:
\begin{dedication}
ABC \\ \\ DEF \\ \\
John
\end{dedication}
萬分感謝!
答案1
\documentclass{book}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\newenvironment{dedication}
{%\clearpage % we want a new page %% I commented this
\thispagestyle{empty}% no header and footer
\vspace*{\stretch{1}}% some space at the top
\itshape % the text is in italics
\raggedleft % flush to the right margin
}
{\par % end the paragraph
\vspace{\stretch{3}} % space at bottom is three times that at the top
\clearpage % finish off the page
}
\begin{document}
\frontmatter %% better to use this in book class
\chapter{Dedication}
\begin{dedication}
ABC
\par %% or a blank line
\vspace{2\baselineskip}
DEF
\vspace{\baselineskip}
\usefont{T1}{LobsterTwo-LF}{bx}{it}
John
\end{dedication}
%.
%.
%.
%.
\mainmatter %% and use this for main chapters.
\chapter{Introduction}
\end{document}
除了 之外\vspace{2\baselineskip}
,您還可以使用\medskip
orbigskip
等。
ABC \\[2\baselineskip]
DEF
正如上面評論中所提到的。
\normalfont
您可以透過標準指令(如\sffamily
等)來變更字體樣式。