【问题标题】:Remove Extra Space After Each Paragraph in LaTex删除 LaTex 中每个段落后的多余空格
【发布时间】:2021-05-05 17:04:44
【问题描述】:

我正在使用报告类在 LaTex 中编写我的论文。我必须使用我使用\doublespacing 的双倍行距来编写它。但是,我在每段之后都得到了一个额外的空间,比我想要减少的正常双倍空间要多。

我尝试了\vspace*{-\baselineskip}\setlength{\parskip}{-\baselineskip}\setlength{\parskip}{-0.5\baselineskip},但都没有奏效。

我什至尝试完全删除{\parskip},但它仍然不起作用。我正在展示我的文档看起来像段落之间的额外空间的示例。

有什么建议吗?

这些是我正在使用的包和命令

\documentclass[12pt,letterpaper,notitlepage]{report} 
% To prevent the widows and orphans
\widowpenalty=10000
\clubpenalty=10000


\usepackage{indentfirst}
\usepackage{multirow}
\usepackage[autopunct=true]{csquotes}
\usepackage[none]{hyphenat}
\usepackage{anysize}                % Set up the margin: similar to GEOMETRY 
\usepackage{setspace}               % Line spacing
\usepackage{parskip}
\usepackage{titletoc}
\usepackage[compact]{titlesec}      % Title
\usepackage{textcomp}               % Just for the copyright symbol....
\usepackage{afterpage}              
\usepackage{apacite}                % APA style references
\usepackage[titletoc]{appendix}     % Appendices
\usepackage{fancyhdr}        % Page numbering position      

\usepackage[top=1.0in, bottom=1.0in, left=1.5in, right=1.0in]{geometry}
\usepackage{enumerate}              % For customized enumeration
\usepackage[normalem]{ulem}         % Underline
\usepackage{graphicx}               % Insert graphs
\usepackage{url}                    % Insert URL in the text
%\usepackage{subfig}                    % Have subfigures
\usepackage{subfigure}
%\usepackage[format=plain]{caption} %to edit captions: don't have figure captions hang
\usepackage{caption}
 \AtBeginCaption{\doublespacing}                % For the caption of tables/figures
\captionsetup[figure]{labelfont=it,labelsep=period,singlelinecheck=false}

\captionsetup[subfigure]{labelsep=space,labelfont=it,justification=justified,
    singlelinecheck=false,font=doublespacing,position=below}
\captionsetup[table]{aboveskip=0pt,belowskip=12pt, justification=raggedright,
labelsep=period,singlelinecheck=false,textfont=it,labelsep=newline}

\usepackage{amsmath,amsthm, amssymb,commath}
\renewcommand*\theequation{\textup{\arabic{chapter}.\arabic{equation}}}
\renewcommand*\thetable{\textup{\arabic{chapter}.\arabic{table}.}}
\renewcommand*\thefigure{\textup{\textit{\arabic{chapter}.\arabic{figure}}}}
\usepackage{adjustbox}              % Fit the table in one page
\usepackage[super]{nth}             % For the "th" in superscript
\usepackage{chngcntr}               
\usepackage{natbib}
\usepackage{lipsum}
\usepackage[titles,subfigure]{tocloft}              % For Table of Contents
\usepackage{booktabs}                % For makeing the table layout
\usepackage{rotating}                % For the tables in landscape
\usepackage{arydshln}                % Have dashline in Table environment
\usepackage[encapsulated]{CJK}                 % Chinese
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}

\usepackage[nottoc,notlot,notlof]{tocbibind}   
\usepackage{listings}
\usepackage[flushleft]{threeparttable}         % To make footnote for the table
\usepackage{float}
\usepackage{enumitem}           % For the margin of the ENUMERATION
\usepackage{adjustbox}
\usepackage{pdfpages} % for pdf
\usepackage{mathptmx} % for times new roman
\usepackage{parskip}

\theoremstyle{definition}
\newtheorem{theo}{Theorem}
\theoremstyle{definition}
\newtheorem{prop}{Proposition}
\theoremstyle{definition}
\newtheorem{defn}{Definition}
\theoremstyle{definition}
\newtheorem{eg}{Example}


% % CHAPTER
% Center the chapter title
\renewcommand{\chaptername}{CHAPTER}{\normalsize}
\titleformat{\chapter}[display]
       {\normalfont\normalsize\bfseries\centering}{\chaptertitlename\ \thechapter}{0pt}{\normalsize\uppercase}
  \titlespacing*{\chapter}{0pt}{1in}{0pt} % 1st page of each new section
  %starts 2in from top of page - Don't ask me why it's 0.5in


% % SECTION
% Change the font size for heading and section
\titleformat{\section}{\normalsize\bfseries\centering\singlespacing}{\thesection}{12pt}{\normalsize}
\titlespacing*{\section}{0pt}{0pt}{0pt}

% % SUBSECTION
\titleformat{\subsection}
{\normalfont\normalsize\bfseries\centering\singlespacing}{\thesubsection}{12pt}{}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}

% % SUBSUBSECTION
\titleformat{\subsubsection}
{\normalfont\normalsize\bfseries\singlespacing}{\thesubsubsection}{12pt}{}
\titlespacing*{\subsubsection}{0pt}{0pt}{0pt}


\doublespacing  
\setlength{\parindent}{0.5in}

\begin{document}
\begin{flushleft}           % Remove the justification and make it left-aligned)
\pagenumbering{gobble}

【问题讨论】:

    标签: latex paragraph


    【解决方案1】:

    您可以通过多次加载parskip 包来添加此空间。在有和没有 parskip 包的情况下试试这个例子:

    \documentclass{report} 
    
    %\usepackage{parskip}
    \usepackage{lipsum}
    
    \begin{document}
    
    
    \lipsum[2]
    
    \lipsum[2]
    
    \end{document}
    

    您可以通过以下方式避免此类问题:

    • 只加载你真正需要的包,而不是只加载除厨房水槽以外的所有东西

    • 不会多次加载相同的包

    【讨论】:

    • 您的示例运行良好,即使我添加了\doublespacing,它仍然可以运行。但是,当我在我的论文中删除\parskip 包时,它仍然不起作用。我有这么多包,因为我需要它们来满足我的论文要求。
    • @SA 请在您的问题中添加一个不带parskip 包的minimal reproducible example,即a) 可编译并且b) 重现您的问题。如果我从您的问题中获取不可编译的代码片段,请删除 parskip 包并添加足够的代码以使其可编译,我不会在段落之间获得任何额外的空间
    【解决方案2】:

    我能够解决我在输入章节之前而不是在文档开头添加\setlength{\parskip}{0pt} 的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-14
      • 1970-01-01
      • 2016-05-19
      • 1970-01-01
      • 2023-01-16
      • 2020-10-08
      • 2019-03-03
      • 2015-05-11
      相关资源
      最近更新 更多