我正在尝试让 latex 缩进每个段落的第一行,但无论我怎么尝试,似乎都无法像阅读文档时所期望的那样工作。我期望,由于我使用的是 article documentclass 并且没有设置parindent
为 0,因此每个段落的第一行应该自动缩进。我甚至尝试在段落开头明确添加 \indent,但仍然没有任何效果(见下图)。有人知道这是怎么回事吗?
以下是产生上述输出的代码:
\documentclass[12pt,titlepage]{article}
\usepackage{url,graphicx,tabularx,array,enumitem,multirow}
\usepackage[fleqn]{amsmath}
\usepackage[top=.8in, bottom=1.2in]{geometry}
%\setlength{\parskip}{1ex} %--skip lines between paragraphs
%\setlength{\mathindent}{0pt}
\renewcommand{\title}[1]{\raggedright{\textbf{\LARGE #1}\\}}
\renewcommand{\line}{\begin{tabularx}{\textwidth}{X>{\raggedleft}X}\hline\\\end{tabularx}\\[-0.5cm]}
\newcommand{\leftright}[2]{\begin{tabularx}{\textwidth}{X>{\raggedleft}X}#1%
& #2\\\end{tabularx}\\[-0.5cm]}
\begin{document}
\begin{titlepage}
\vspace*{8cm}
\title{EEE64: Lab 1}
\line
\leftright{\today}{\textbf{Nicholas Winterer} \\ 210001755 \\ Lab Section 04 \\ Friday 1:00 pm}
\end{titlepage}
\tableofcontents
\pagebreak
\section*{Introduction}
\indent This first lab was intented to familiarize us with the EEE64 lab equipment: the Digilent Spartan-3E development board, solderless breadboards, LEDs, SIP resistor networks, and the 7400 series of logic ICs. We learned about each of the basic logic gates (the buffer, NOT gate, AND gate, OR gate, XOR gate, NAND gate, NOR gate, and XNOR gate) and constructed a truth table for each by simulating all possible permutations of inputs in \emph{logic.ly} and recording the output. We also learned how to hook up real logic gates (in the 7400 ICs) and interface them to real hardware such as switches and LEDs. Finally, we used our breadboards to construct a circuit where we interfaced a single pair of switches to four different logic gates, each displaying its output on a seperate LED
答案1
章节单元标题后的第一行不缩进。如果您想更改此行为,可以加载包indentfirst
;即在序言中写入:
\usepackage{indentfirst}
附注:您的代码中有以下几行
\renewcommand{\title}1{\raggedright{\textbf{\LARGE #1}\}}
会产生错误。也许你的意思是
\renewcommand{\title}[1]{{\raggedright\LARGE\bfseries#1}}
答案2
如果你想缩进特定部分的第一段,下面的方法就可以了,
\makebox[0pt]{}\vspace{-2ex}
这会创建一个空段落,然后将其备份。虽然丑陋,但有效。