\hspace{1cm} 似乎在不同的行上有不同的含义?

\hspace{1cm} 似乎在不同的行上有不同的含义?

我正在使用 latex 来格式化课堂作业。我使用 \section 来分隔我的问题,这种方法很好用,但是当我想用多行回答一个问题时,间距就变得不可能了。我目前正在尝试这样做:

\documentclass{article}
\title {hw}
\author {name}
\date {}

\usepackage{tikz}

\begin{document}

\section*{Problem 1}
    \hspace{1cm} some part of my answer $some equation$ \\
    \hspace{1cm} second part of my answer $some equation$

我不确定这些方程式是否真的很重要,但我刚开始使用 latex,它可能会为我的问题提供更多背景信息。我尝试使用 \*、\linebreak、\newline,但每次间距都不正确。我能够修复它的唯一方法是将第二个 \hspace 设置为 6mm 而不是 1cm,这看起来很奇怪,我不想每次使用 latex 时都要猜测和修复间距。如果您能帮助我或解释我为什么错误地使用这些命令,我​​将不胜感激,谢谢!

答案1

据我所知,你不需要 hspace 或\\here 并且想要一个像这样的布局

在此处输入图片描述

\documentclass{article}

\usepackage{indentfirst}

\begin{document}

\section*{Problem 1}

some part of my answer $some equation$ 
some part of my answer $some equation$ 
some part of my answer $some equation$ 

second part of my answer $some equation$
some part of my answer $some equation$ 
some part of my answer $some equation$ 

\section*{Problem 1}

\begin{itemize}

 \item some part of my answer $some equation$ 
some part of my answer $some equation$ 
some part of my answer $some equation$ 

 \item second part of my answer $some equation$
some part of my answer $some equation$ 
some part of my answer $some equation$ 

\end{itemize}

\section*{Problem 1}

\begin{quote}

some part of my answer $some equation$ 
some part of my answer $some equation$ 
some part of my answer $some equation$ 

second part of my answer $some equation$
some part of my answer $some equation$ 
some part of my answer $some equation$ 
  
\end{quote}

\end{document}

答案2

我最终使用changepage包裹

\documentclass{article}

\usepackage{changepage}

\begin{document}

\section*{problem whatever}

\begin{adjustwidth}{1cm}{} first part of answer \\
second part of answer
\end{adjustwidth}

\end{document}

相关内容