如何使 \Shapepar 完全居中?

如何使 \Shapepar 完全居中?

我在文档末尾添加了版权页\shapepar,但是它出现在页面的左上角,我无法将其水平和垂直居中。

我已经加载了为我的文档加载的几何选项,但我基本上删除了所有的序言和许多似乎不会影响版权页定位的包。

如果没有这个geometry包,有些居中,但看起来仍然更靠左。请注意,我添加了边距和一个\newgeometry命令,仅针对此页设置相同的边距,以模拟实际文档中的情况。

最合适的居中方法是什么?

平均能量损失

\documentclass[12pt, twoside]{article}
\usepackage[a4paper, margin=2.5cm,bindingoffset=1.5cm, showframe]{geometry}
\usepackage{shapepar}

    \def\triangledownshape{%
    {0}%
    {0}b{0}\\%
    {0}t{-10}{20}\\%
    %{8.66}t{-5}{10}\\%
    {17.32}e{0}%
    }
    \def\triangledownpar#1{\Shapepar\triangledownshape #1\unskip\ .\par}

\begin{document}

\newgeometry{margin=2cm}
\triangledownpar{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut porttitor magna posuere tristique interdum. Maecenas ac nisi rutrum, tincidunt ante a, cursus est. Pellentesque dui ligula, maximus quis viverra sit amet, cursus sed urna. Donec eu erat sed justo cursus tristique non quis nisi. Suspendisse dapibus lorem nec laoreet interdum. Duis sit amet leo sagittis, tincidunt elit in, imperdiet diam. Nulla mi justo, tincidunt a ullamcorper eget, consequat ut odio. Aliquam erat volutpat. Suspendisse potenti. Aenean tristique arcu orci, sit amet dignissim ligula elementum vitae. Praesent auctor augue eu lacus tempor maximus. Quisque auctor, odio eu laoreet congue, mi massa facilisis nisi, a faucibus arcu nisi egetet ex}
\end{document}

当前结果

在此处输入图片描述

答案1

假设你的 parshape 中没有段落:

\def\triangledownpar#1{\vspace*{\fill}\noindent%
     \makebox[\linewidth]{%
        \Shapepar\triangledownshape#1\unskip\ .\par}\vfill}

在此处输入图片描述

答案2

将其装进盒子里varwdith环境,允许您移动它:

在此处输入图片描述

\documentclass{article}
\usepackage{showframe}
\usepackage{shapepar,varwidth}

\def\triangledownshape{%
  {0}%
  {0}b{0}\\%
  {0}t{-10}{20}\\%
  %{8.66}t{-5}{10}\\%
  {17.32}e{0}%
}
\def\triangledownpar#1{\Shapepar\triangledownshape #1\unskip\ .\par}

\begin{document}

\vspace*{\fill}

\begin{center}
  \begin{varwidth}{\linewidth}
    \triangledownpar{Lorem ipsum dolor sit amet, consectetur adipiscing 
      elit. Ut porttitor magna posuere tristique interdum. Maecenas ac nisi 
      rutrum, tincidunt ante a, cursus est. Pellentesque dui ligula, maximus 
      quis viverra sit amet, cursus sed urna. Donec eu erat sed justo cursus 
      tristique non quis nisi. Suspendisse dapibus lorem nec laoreet 
      interdum. Duis sit amet leo sagittis, tincidunt elit in, imperdiet 
      diam. Nulla mi justo, tincidunt a ullamcorper eget, consequat ut odio. 
      Aliquam erat volutpat. Suspendisse potenti. Aenean tristique arcu 
      orci, sit amet dignissim ligula elementum vitae. Praesent auctor augue 
      eu lacus tempor maximus. Quisque auctor, odio eu laoreet congue, mi 
      massa facilisis nisi, a faucibus arcu nisi egetet ex}
  \end{varwidth}
\end{center}

\vfill

\end{document}

相关内容