使用標籤後刪除部分中的縮排

使用標籤後刪除部分中的縮排

我想刪除在某個部分使用標籤後出現的縮排。我怎麼才能刪除這個?

那麼如何刪除text2在我的 pdf 中建立的縮排(空格)呢?

\documentclass{article}
\begin{document}
\section{test1}
Text1
\section{test2}~\label{test2}
Text2
\end{document}

我也有章節和小節。

答案1

如果刪除~之間的內容\section\label不需要的縮排就會被刪除:

在此輸入影像描述

\documentclass{article}
\begin{document}
\section{test1}
Text1
\section{test2}\label{test2}
Text2
\end{document}

\ref

看

\documentclass{article}
\begin{document}
\section{test1}
Text1
\section{test2}\label{test2}
Text2 Reference to the second section's label: \ref{test2}
\end{document}

相關內容