首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >乳胶多元醇环境中的文本跳出

乳胶多元醇环境中的文本跳出
EN

Stack Overflow用户
提问于 2021-10-18 15:01:47
回答 1查看 885关注 0票数 2

我正在为多个环境设置边距配置。例如,firstenvironment使用\setlength设置边距,然后在新环境中使用多元醇包。问题是,在刚刚使用环境的第一页中,文本似乎不尊重底部边距,但下一页中的文本确实尊重页边距。同样的情况发生在我创建第二个具有自己的边距配置的环境时。不确定为什么在环境开始时不立即激活边距。欢迎任何建议,谢谢!

警局。用Xelatex编译

代码语言:javascript
运行
复制
\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage{showframe} % show the frame margins
\usepackage{multicol}

\newenvironment{firstenvironment}{
    \setlength{\hoffset}{0mm}
    \setlength{\voffset}{0mm}
    \setlength{\headsep}{20pt}
    \setlength{\headheight}{4em}
    \setlength{\textheight}{6in}
    \setlength{\footskip}{10mm}}{}

\newenvironment{secondenvironment}{
    \setlength{\hoffset}{0mm}
    \setlength{\voffset}{0mm}
    \setlength{\headsep}{5pt}
    \setlength{\headheight}{2em}
    \setlength{\textheight}{5in}
    \setlength{\footskip}{20mm}}{}

\begin{document}
\begin{firstenvironment}
\setlength\columnsep{30pt}
\begin{multicols}{2}
        {\Large\bf 1ST LIPSUM}\\
        \lipsum[1-10]
    \end{multicols}
\end{firstenvironment}

\newpage

\begin{secondenvironment}
\begin{multicols}{2}
    {\Large\bf 2ND LIPSUM}\\
    \lipsum[1-10]
\end{multicols}
\end{secondenvironment}

\end{document}

图片,底边文字:图像

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-10-21 23:08:54

我只是想办法解决这个问题。我使用了包changepage。其思想是在此命令的参数中包括新边距旧边距之间的差异。没有必要使用环境来设置具有不同页边距的页面(其中考虑页眉、页脚和页边距注释),但是为了保持原始帖子的相同结构,我提供了一个可以轻松比较的解决方案。

代码语言:javascript
运行
复制
\documentclass[12pt]{article}
\usepackage[paperheight=11in,paperwidth=8.5in,includeheadfoot]{geometry}
\usepackage{lipsum}
\usepackage{showframe} 
\usepackage{multicol}
\usepackage{changepage}
\usepackage{calc}

\newenvironment{firstenvironment}{}{}
\newenvironment{secondenvironment}{}{}

\begin{document}

\setlength{\textheight}{7in}
\setlength{\headsep}{20pt}
\setlength{\headheight}{4em}
\setlength{\footskip}{10mm}

\begin{firstenvironment}
    \begin{multicols}{2}
        {\Large 1ST LIPSUM}\\
        \lipsum[1-10]
    \end{multicols}
\end{firstenvironment}

\newpage
\changepage{-2in}{}{}{}{}{}{2em-4em}{5pt-20pt}{20mm-10mm}
%\changepage{textheight}{textwidth}{evensidemargin}{oddsidemargin}{columnsep}{topmargin}{headheight}{headsep}{footskip}

\begin{secondenvironment}
    \begin{multicols}{2}
        {\Large 2ND LIPSUM}\\
        \lipsum[1-10]
    \end{multicols}
\end{secondenvironment}

\restoregeometry

\begin{firstenvironment}
    \begin{multicols}{2}
        {\Large 3rd LIPSUM}\\
        \lipsum[1-10]
    \end{multicols}
\end{firstenvironment}

\end{document}
  • 命令\changepage考虑以下参数:\changepage{textheight}{textwidth}{evensidemargin}{oddsidemargin}{columnsep}{topmargin}{headheight}{headsep}{footskip}
  • \changepage命令下留空的页边距考虑文章类的默认页边距。如果要在设置新空白后恢复页边距,只需使用命令\restoregeometry

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69618299

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档