如何在小页面的整个高度上绘制形状?

如何在小页面的整个高度上绘制形状?

我的目的是创建一份漂亮的简历,用箭头标出我的经历的时间线。左栏包含与此无关的信息。

我有以下代码:

\documentclass[a4paper,12pt]{article}%minimal working example
\usepackage[french]{babel}

\usepackage{fontspec}%déjà chargé par luatextra
\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
\setromanfont{Verdana}

\usepackage{paracol} %%Pour les colonnes sur plusieurs pages

\usepackage{multido}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column

\multido{\i=2+1}{30}{bla ble bli\\}

\end{leftcolumn}%
\begin{rightcolumn}%

\textbf{A title for something that is a little bit verbose}

{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}

\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item {\footnotesize bla bla}
\end{itemize}
\end{minipage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}\end{minipage}

\textbf{A second title  that is a little bit verbose}

{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}

\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

{\footnotesize a last thing}
\end{minipage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}
\end{minipage}

\textbf{Another title}

{\scriptsize etc}
\end{rightcolumn}
\end{paracol}
\end{document}

我想将绘制在 pdf 输出中的红色形状添加到此示例中:

例子

形状应该是如图所示的箭头(不一定是红色,我可能会更改颜色),并且是编程绘制的矢量图形。可能,我希望它填充背景色。

我希望箭头的高度限制在小页面的高度(类似于箭头的高度 = 小页面的高度 - 4em)。

我在这里使用 minipage,因为我还绘制了圆角框(带有“某些内容”的框)并设置了中间标题。我在这里给出了一个我希望的简约示例。

我还希望(如果可能的话)当出现分页符时箭头可以继续(但我不知道是否可以使用 minipage)

我怎样才能实现这个目标?

编辑:这是一个我想要做的事情的例子(左侧圆角框的高度取决于其内容,而不是小页面的高度)

我简历的这一部分的最终样子

答案1

一种可能性是使用tcolorbox

改良版

此改进版本允许根据需要进行分页。我隐藏了您的minipages,现在原始设置(两个minipages)以及箭头和“某些内容”框架框使用单个tcolorbox名为的 生成myarrow;原则上,这允许分页,但不清楚右侧的框架框会发生什么。语法是

\begin{myarrow}[<options for the arrow>]{<text>}
contents
\end{myarrow}

可以<options for the arrow>用来改变箭头的属性(见下面例子中的橙色箭头)并且<text>是放置在中心、框架和右侧的文本。

\documentclass[a4paper,12pt]{article}
\usepackage[french]{babel}
\usepackage{fontspec}%déjà chargé par luatextra
\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
\setromanfont{Verdana}
\usepackage{paracol} %%Pour les colonnes sur plusieurs pages
\usepackage{multido}
\usepackage[many]{tcolorbox}

% Colors for the arrow
\colorlet{arrowbgcolor}{cyan!20}
\colorlet{arrowbordercolor}{cyan}
% Colors for the framed box to the right
\definecolor{boxbgcolor}{RGB}{232,220,236}
\definecolor{boxbordercolor}{RGB}{157,125,169}

\newtcolorbox{myarrow}[2][]{
  breakable,
  enhanced,
  boxrule=0pt,
  arc=0pt,
  frame code={},
  colback=white,
  overlay unbroken={
    \draw[arrowbordercolor,fill=arrowbgcolor,#1]
      ([xshift=0pt]frame.north west) --
      ([xshift=20pt]frame.north west) --
      ([xshift=20pt,yshift=10pt]frame.south west) --
      ([xshift=10pt,yshift=5pt]frame.south west) --
      ([yshift=10pt]frame.south west) -- cycle;
    \node[
      draw=boxbordercolor,
      text width=.28\columnwidth,
      anchor=west,
      line width=1pt,
      rounded corners=10pt,
      fill=boxbgcolor,
    ] at ([xshift=.02\columnwidth]frame.east) {#2};  
  },
  overlay first={
    \draw[arrowbordercolor,fill=arrowbgcolor,#1]
      ([xshift=0pt]frame.north west) --
      ([xshift=20pt]frame.north west) --
      ([xshift=20pt]frame.south west) --
      (frame.south west) -- cycle;
    \node[
      draw=boxbordercolor,
      text width=.28\columnwidth,
      anchor=west,
      line width=1pt,
      rounded corners=10pt,
      fill=boxbgcolor,
    ] at ([xshift=.02\columnwidth]frame.east) {#2};  
  },
  overlay middle={
    \draw[arrowbordercolor,fill=arrowbgcolor,#1]
      ([xshift=0pt]frame.north west) --
      ([xshift=20pt]frame.north west) --
      ([xshift=20pt]frame.south west) --
      (frame.south west) -- cycle;
    \node[
      draw=boxbordercolor,
      text width=.28\columnwidth,
      anchor=west,
      line width=1pt,
      rounded corners=10pt,
      fill=boxbgcolor,
    ] at ([xshift=.02\columnwidth]frame.east) {#2};  
  },
  overlay last={
    \draw[arrowbordercolor,fill=arrowbgcolor,#1]
      ([xshift=0pt]frame.north west) --
      ([xshift=20pt]frame.north west) --
      ([xshift=20pt,yshift=10pt]frame.south west) --
      ([xshift=10pt,yshift=5pt]frame.south west) --
      ([yshift=10pt]frame.south west) -- cycle;
    \node[
      draw=boxbordercolor,
      text width=.28\columnwidth,
      anchor=west,
      line width=1pt,
      rounded corners=10pt,
      fill=boxbgcolor,
    ] at ([xshift=.02\columnwidth]frame.east) {#2};  
  },
  extrude left by=1em,
  enlarge left by=2em,
  width=0.6\columnwidth+1.5em,
}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column
\multido{\i=2+1}{30}{bla ble bli\\}
\end{leftcolumn}%
\begin{rightcolumn}%
\textbf{A title for something that is a little bit verbose}

{\scriptsize a comment about it}

\begin{myarrow}{Some stuff\\Some stuff\\Some stuff}
\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item {\footnotesize bla bla}
\end{itemize}
\end{myarrow}

\textbf{A second title  that is a little bit verbose}

{\scriptsize a comment about it}

\begin{myarrow}{Some stuff\\Some stuff\\Some stuff\\Some stuff}
\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

{\footnotesize a last thing}
\end{myarrow}
\end{rightcolumn}
\end{paracol}

\end{document}

在此处输入图片描述

第一个版本

在此版本中,所需的装饰实际上是freelance的设计tcolorbox。请注意,由于您使用的minipage是 ,因此不允许分页。

\documentclass[a4paper,12pt]{article}
\usepackage[french]{babel}
\usepackage{fontspec}%déjà chargé par luatextra
\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
\setromanfont{Verdana}
\usepackage{paracol} %%Pour les colonnes sur plusieurs pages
\usepackage{multido}
\usepackage[many]{tcolorbox}

\newtcolorbox{myarrow}[1][]{
  breakable,
  freelance,
  boxrule=0pt,
  frame code={},
  colback=white,
  overlay={
    \draw[cyan,fill=cyan!20]
      ([xshift=-20pt]frame.north west) --
      (frame.north west) --
      ([yshift=10pt]frame.south west) --
      ([xshift=-10pt,yshift=5pt]frame.south west) --
      ([xshift=-20pt,yshift=10pt]frame.south west) -- cycle;
  }
}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column
\multido{\i=2+1}{30}{bla ble bli\\}
\end{leftcolumn}%
\begin{rightcolumn}%
\textbf{A title for something that is a little bit verbose}

{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}
\begin{myarrow}
\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item {\footnotesize bla bla}
\end{itemize}
\end{myarrow}
\end{minipage}%
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}\end{minipage}

\textbf{A second title  that is a little bit verbose}

{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}
\begin{myarrow}
\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

{\footnotesize a last thing}
\end{myarrow}
\end{minipage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}
\end{minipage}

\end{rightcolumn}
\end{paracol}
\end{document}

在此处输入图片描述

答案2

tikzmark

\documentclass[a4paper,12pt]{article}%minimal working example
\usepackage[french]{babel}

%\usepackage{fontspec}%déjà chargé par luatextra
%\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
%\setromanfont{Verdana}

\usepackage{paracol} %%Pour les colonnes sur plusieurs pages

\usepackage{multido}

\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcommand\tikzmark[1]{%
\tikz[remember picture,baseline=(#1.base)]
\node[inner sep=0,outer sep=3pt] (#1) {};%
}
\newcommand\myarrow[3][]{%
  \begin{tikzpicture}[overlay,remember picture]
    \draw[#1] (#2) to (#3);
  \end{tikzpicture}}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column

\multido{\i=2+1}{30}{bla ble bli\\}

\end{leftcolumn}%
\begin{rightcolumn}%

\textbf{A title for something that is a little bit verbose}

\tikzmark{a}{\scriptsize a comment about it}
\hspace{2em}
\begin{minipage}[t]{0.6\columnwidth}

\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item \tikzmark{b}{\footnotesize bla bla}
\end{itemize}

\myarrow[-latex, draw=magenta!55, line width=5]{a}{a|-b}
\end{minipage}%
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}\end{minipage}

\textbf{A second title  that is a little bit verbose}

\tikzmark{a}{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}

\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

\tikzmark{b}{\footnotesize a last thing}
\end{minipage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}
\myarrow[-latex, draw=green!55, line width=5]{a}{a|-b}
\end{minipage}

\textbf{Another title}

{\scriptsize etc}
\end{rightcolumn}
\end{paracol}
\end{document}

在此处输入图片描述

另一个变体:

\documentclass[a4paper,12pt]{article}%minimal working example
\usepackage[french]{babel}

%\usepackage{fontspec}%déjà chargé par luatextra
%\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
%\setromanfont{Verdana}

\usepackage{paracol} %%Pour les colonnes sur plusieurs pages

\usepackage{multido}

\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcommand\tikzmark[1]{%
\tikz[remember picture,baseline=(#1.base)]
\node[inner sep=0,outer sep=3pt] (#1) {};%
}
\newcommand\myarrow[3][]{%
  \begin{tikzpicture}[overlay,remember picture]
    \draw[fill=orange!30,#1] ([xshift=-1em]#2.south) -- ([xshift=-1em,yshift=1ex]#3.north) -- (#3.north) -- ([xshift=1em,yshift=1ex]#3.north)  -- ([xshift=1em]#2.south)--cycle;
  \end{tikzpicture}}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column

\multido{\i=2+1}{30}{bla ble bli\\}

\end{leftcolumn}%
\begin{rightcolumn}%

\textbf{A title for something that is a little bit verbose}

\tikzmark{a}{\scriptsize a comment about it}
\hspace{2em}
\begin{minipage}[t]{0.6\columnwidth}

\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item \tikzmark{b}{\footnotesize bla bla}
\end{itemize}

\myarrow[draw=magenta!55]{a}{a|-b}
\end{minipage}%
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}\end{minipage}

\textbf{A second title  that is a little bit verbose}

\tikzmark{a}{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}

\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

\tikzmark{b}{\footnotesize a last thing}
\end{minipage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}
\myarrow[draw=green!55]{a}{a|-b}
\end{minipage}

\textbf{Another title}

{\scriptsize etc}
\end{rightcolumn}
\end{paracol}
\end{document}

在此处输入图片描述

您可以根据您的喜好进行进一步的美化,例如选择合适的箭头以及将第一个标记放在合适的位置。

答案3

以下示例定义了捕捉盒子内timepage前者进行测量的环境。然后放置并通过 TikZ 绘制时间箭头:minipageminipage

\documentclass[a4paper,12pt]{article}%minimal working example
\usepackage[french]{babel}

\usepackage{fontspec}%déjà chargé par luatextra
\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
\setromanfont{Verdana}

\usepackage{paracol} %%Pour les colonnes sur plusieurs pages

\usepackage{multido}

\usepackage{tikz}
\newsavebox{\timepagebox}

\newenvironment*{timepage}{%
  \begin{lrbox}{\timepagebox}%
  \begin{minipage}%
}{%
  \end{minipage}
  \end{lrbox}%
  \noindent
  \begin{tikzpicture}[
    inner sep=0pt,
    outer sep=0pt,
    baseline=0pt,
  ]
  \path (0,0) ++(2em,-\dp\timepagebox)
    node [anchor=south west] {\usebox{\timepagebox}}
  ;
  \draw[
    red,
    line join=round,
    semithick,
  ]
    (.5\pgflinewidth,\ht\timepagebox-.5\pgflinewidth) -- ++(1.6em,0) --
    ++(0,-\ht\timepagebox-\dp\timepagebox+\pgflinewidth+.9em) --
    ++(-.8em,-.8em) -- ++(-.8em,.8em) -- cycle
  ;
  \end{tikzpicture}%
}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column

\multido{\i=2+1}{30}{bla ble bli\\}

\end{leftcolumn}%
\begin{rightcolumn}%

\textbf{A title for something that is a little bit verbose}

{\scriptsize a comment about it}

\begin{timepage}{0.6\columnwidth}

\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item {\footnotesize bla bla}
\end{itemize}
\end{timepage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}\end{minipage}

\textbf{A second title  that is a little bit verbose}

{\scriptsize a comment about it}

\begin{timepage}{0.6\columnwidth}

\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

{\footnotesize a last thing}
\end{timepage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}
\end{minipage}

\textbf{Another title}

{\scriptsize etc}
\end{rightcolumn}
\end{paracol}
\end{document}

结果

相关内容