有没有办法将某些行从缩进中排除?例如,我希望每一行以某个对象开头,如\Longrightarrow
下面的 MWE 中的,不是缩进。有没有办法做到这一点,而不用\noindent
在每一行开头添加?
该命令应该是强大的,以便还允许使用除数学符号之外的其他行标识符:更具体地说,应该可以选择缩进由单个 LaTeX 命令组成的行(如\textcyr{\char143}
)以 开头的行\fbox
。
我会很感激每一条小贴士!!
\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
The indentation is visible in this line, as one can see by type a lot of text text text text text text text text text text text text text text text ...
$\Longrightarrow$ Because I used the arrow at the start, this line should *never* be intended.
Now indentation is active again...
\end{document}
答案1
您必须避免启动数学模式,否则删除缩进就太晚了:
\documentclass[12pt,a4paper]{article}
\newcommand{\niLongrightarrow}{%
\noindent\ensuremath{\Longrightarrow}%
}
\begin{document}
The indentation is visible in this line, as one can see by type a lot of text text text
text text text text text text text text text text text text ...
\niLongrightarrow{} Because I used the arrow at the start, this line should *never* be
intended.
Now indentation is active again and $a\niLongrightarrow b$...
\end{document}
但使用\noindent
更简单。