我想在标题页的侧面画一条垂直波浪线,上面有一个长而浅的句号。以下改编自ferahfeza提供的解决方案,效果很好。我唯一的额外问题是如何让线条自动调整文本高度。
\documentclass[ebook]{memoir}
\usepackage{tikz}
\usepackage{epigraph}
\usepackage{times,microtype}
\usetikzlibrary{decorations}
\newcommand\titlepagedecoration{
\pgfdeclaredecoration{complete sines}{initial}
{
\state{initial}[
width=+0pt,
next state=sine,
persistent precomputation={\pgfmathsetmacro\matchinglength{
\pgfdecoratedinputsegmentlength / int(\pgfdecoratedinputsegmentlength/\pgfdecorationsegmentlength)}
\setlength{\pgfdecorationsegmentlength}{\matchinglength pt}
}] {}
\state{sine}[width=\pgfdecorationsegmentlength]{
\pgfpathsine{\pgfpoint{0.25\pgfdecorationsegmentlength}{0.5\pgfdecorationsegmentamplitude}}
\pgfpathcosine{\pgfpoint{0.25\pgfdecorationsegmentlength}{-0.5\pgfdecorationsegmentamplitude}}
\pgfpathsine{\pgfpoint{0.25\pgfdecorationsegmentlength}{-0.5\pgfdecorationsegmentamplitude}}
\pgfpathcosine{\pgfpoint{0.25\pgfdecorationsegmentlength}{0.5\pgfdecorationsegmentamplitude}}
}
\state{final}{}
}
\begin{tikzpicture}[
every path/.style={
decoration={
complete sines,
segment length=2cm,
amplitude=0.5cm
},
decorate
}]
\draw [very thick](0,0) -- (0,15);
\end{tikzpicture}
}
\begin{document}
\thispagestyle{empty}
\pagestyle{empty}
{\begingroup
\hbox{
\hspace*{0.1\textwidth}
\titlepagedecoration
\hspace*{0.05\textwidth}
\parbox[b]{0.75\textwidth}{
{\noindent\Huge\bfseries A Collection of \\[0.5\baselineskip] \LaTeX ~Templates}\\[2\baselineskip]
{\large \textit{A predictable tagline}}\\[4\baselineskip]
{\Large \textsc{john smith}}
\vspace{0.5\textheight}
{\noindent The Publisher}\\
}}
\endgroup}
\end{document}
答案1
对于book
课程,以下代码是您的起点。您可以在代码中控制 wavy 的所有参数。
\documentclass{book}
\usepackage{tikz}
\usepackage{epigraph}
\usepackage{times,microtype}
\usetikzlibrary{decorations}
\definecolor{titlepagecolor}{cmyk}{1,.60,0,.40}
\DeclareFixedFont{\titlefont}{T1}{ppl}{b}{it}{0.5in}
\newcommand\titlepagedecoration{%
\pgfdeclaredecoration{complete sines}{initial}
{
\state{initial}[
width=+0pt,
next state=sine,
persistent precomputation={\pgfmathsetmacro\matchinglength{
\pgfdecoratedinputsegmentlength / int(\pgfdecoratedinputsegmentlength/\pgfdecorationsegmentlength)}
\setlength{\pgfdecorationsegmentlength}{\matchinglength pt}
}] {}
\state{sine}[width=\pgfdecorationsegmentlength]{
\pgfpathsine{\pgfpoint{0.25\pgfdecorationsegmentlength}{0.5\pgfdecorationsegmentamplitude}}
\pgfpathcosine{\pgfpoint{0.25\pgfdecorationsegmentlength}{-0.5\pgfdecorationsegmentamplitude}}
\pgfpathsine{\pgfpoint{0.25\pgfdecorationsegmentlength}{-0.5\pgfdecorationsegmentamplitude}}
\pgfpathcosine{\pgfpoint{0.25\pgfdecorationsegmentlength}{0.5\pgfdecorationsegmentamplitude}}
}
\state{final}{}
}
\begin{tikzpicture}[
every path/.style={
decoration={
complete sines,
segment length=1cm,
amplitude=0.5cm
},
decorate
}]
\draw [thick](0,0) -- (0,12);
\end{tikzpicture}
}
\begin{document}
\begin{titlepage}
\noindent
\Huge \textbf{Book Title}\par
\epigraph{From Universe}%
{\textit{Somewhere 2013}\\ \textsc{John Doe}}
%
\titlepagedecoration
\end{titlepage}
\end{document}
答案2
这是使用coil
装饰的另一种选择:
\documentclass[ebook]{memoir}
\usepackage{graphicx}
\usepackage{tikzpagenodes}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
{
\begingroup
\setlength{\parindent}{0pt}
\hbox{%
\hspace*{0.25\textwidth}
\parbox[b]{0.75\textwidth}{%
{\noindent\Huge\bfseries I Want A Poem}\\[1\baselineskip]
{\large A Sequence of Poetry}\\[4\baselineskip]
{\Large Valerie Senyk}
\vspace{0.5\textheight}
\noindent Vocamus Press | Guelph, Ontario}
}
\begin{tikzpicture}[remember picture]
\draw[overlay,decorate,decoration={coil,aspect=0,segment length=20pt}]
(current page text area.north west) --
(current page text area.south west);
\end{tikzpicture}
\endgroup}
\end{document}
就您当前的设置而言,“安大略”的放置存在一些问题,您可能需要查看一下。
答案3
附有一些书法:
\documentclass[ebook]{memoir}
\usepackage{epigraph,graphicx,calc}
\usepackage{times,microtype}
\newsavebox{\MYbox}%
\newlength\MYh\newlength\MYd%
\newenvironment{Zigoui}[1][ondule.1]{%
\def\Barre{#1}
\begin{lrbox}{\MYbox}
\begin{minipage}[b]{\textwidth -4bp -.7cm -.3cm }}{%
\end{minipage}
\end{lrbox}%
\settoheight{\MYh}{\usebox{\MYbox}}%
\settodepth{\MYd}{\usebox{\MYbox}}%
\addtolength{\MYh}{\MYd+4bp}%
\medskip
\hfill
\raisebox{\totalheight-3bp}{%
\includegraphics*[clip=true,bb= 1 -3 \MYh*72.27 3,angle=-90]{\Barre}}
\hspace{0.3cm}\usebox{\MYbox}%
\par\addvspace{2ex}
}%
\begin{document}
\thispagestyle{empty}
\pagestyle{empty}
\begin{Zigoui}
{%
\noindent\Huge\bfseries A Collection of \\[0.5\baselineskip] \LaTeX ~Templates}\\[2\baselineskip]
{\large \textit{A predictable tagline}}\\[4\baselineskip]
{\Large \textsc{john smith}}
\vspace{0.5\textheight}
{\noindent The Publisher}
\end{Zigoui}
\end{document}
还有来自 metapost 的 ondule.1:顺便问一下,如何用 tikz 画出这样的线条?
u := .75mm ;
h := -.9u ;
l := 1.85u ;
nb := 200 ;
path p ;
beginfig(1)
pickup pencircle scaled 1pt yscaled .3 rotated -60 ;
p = (0,h){dir0}..{dir0}(l,-h){dir0}..{dir0}(2l,h) ;
for i=0 upto nb :
draw p shifted (2i*l,0) ;
endfor ;
clip currentpicture to (.4l,2h)--(nb*2*l,2h)--(nb*2*l,-2h)--(.4l,-2h)--cycle ;
endfig ;
end