我想创建每日页面:
- 左图:图片和标题
- 中间:“每日计划”文本
但我不能把图像和文字平行放置,并且标题不在图像下方
\documentclass[a4paper,11pt]{book}
\usepackage[format=plain,
labelfont={bf,it},
textfont=it]{caption}
\usepackage{graphicx}
\begin{document}
\noindent
\begin{figure}[!ht]
\put(\dimexpr\textwidth-18cm,0cm) [Nick name ABC]{\includegraphics[width=4cm]{Image/kid_01.png}}
\end{figure}
\Huge Daily Planner
\end{document}
答案1
我建议使用彩色盒子 软件包和带星号的版本\captionof宏从标题包裹:
\documentclass[a4paper,11pt,draft]{book}
\usepackage[format=plain,
labelfont={bf,it},
textfont=it]{caption}
\usepackage{graphicx}
\usepackage{tcolorbox}
\usepackage{varwidth}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\newcommand{\mybox}[4]%[\textwidth-\pgfkeysvalueof{/pgf/inner xsep}-2mm]
{%
%\begin{figure}[!h] % we don't need figure environment
\begin{tikzpicture}
\node[line width=.5mm,
rounded corners,
draw= #2,
inner ysep=10pt,
text width= #1,
outer sep=0]
(one) {\vspace*{15pt}\\ \begin{varwidth}{\textwidth} #4 \end{varwidth}};
\node[text=white,
anchor=north east,
align=center,
minimum height=20pt] (two) at (one.north east) {#3 \hspace*{.5mm}};
\path[fill=#2] (one.north west|-two.west) -- ($(two.west)+(-1.5cm,0pt)$) to[out=0,in=180] (two.south west) -- (two.south east) [rounded corners] -- (one.north east) -- (one.north west) [sharp corners] -- cycle;
\node[text=white,
anchor=north east,
align=center,
minimum height=20pt,
text height=2ex] (three) at (one.north east) {ABC \hspace*{.5mm}};
\end{tikzpicture}
% \end{figure}
}
\tcbset{sidebyside,
size=minimal,
colback=white,
lower separated=false,
halign upper=flush center,
halign lower=flush left,
lefthand width=4cm,
frame empty,
}
\begin{tcolorbox}
\includegraphics[width=4cm]{Image/kid_01.png}
\captionof*{figure}{Nick name ABC}
\tcblower
\Huge Daily Planner
\end{tcolorbox}
\vspace{2cm}
\begin{tcolorbox}
\includegraphics[width=4cm]{Image/kid_01.png}
\tcblower
%\Huge Daily Planner
\mybox{5cm}{green!30!black}{ABC}{abc def glm } % note the curly braces around 5cm
\end{tcolorbox}
\end{document}