描述块显示不正确(全部折叠)

描述块显示不正确(全部折叠)

以下是我的文件的剪辑:

Servos.c includes the following functions:

\begin{description}
    \item[void starter(int id1, uint16_t pwm1, int id2, uint16_t pwm2)] \hfill \\
        This function takes in two motor IDs and the PWM to set for both of them. A delay of either 1270 ticks or 700 ticks is applied (at fixed operational PWM) depending on whether the motion instruction is forward/backward by about 30 cm (one tile) or a spin of about 90 degrees in either direction. These values were found mathematically using the distance formula above and then proven experimentally.

    \item[void forward()] \hfill \\
        This function calls starter with the parameters to move the right wheel clockwise, and the left wheel counter-clockwise in order to achieve forward motion.

    \item[void backward()] \hfill \\
        Similar to forward() but applied the opposite PWM signals to achieve backward motion.

    \item[void spinCW()] \hfill \\
        This function calls starter but with the counter-clockwise PWM in order to spin the robot clockwise.

    \item[void spinCC()] \hfill \\
        Similar to spinCW() but with the clockwise PWM applied to both wheels.

    \item[void stop()] \hfill \\
        This function simply stops both motors from running.

    \item[void scan()] \hfill \\
        This function contains a loop which keeps setting the PWM signal for the top motor, starting from the rightmost position and gradually moving in small increments to the left until the leftmost position is reached, there after the operation is reversed and the PWM signal is decremented by small amounts until the rightmost position is reached. The process repeats. A small delay is added the end of each operation to make the scanning motion as smooth as possible.

    \item[void stopScan()] \hfill \\
        Stops the scanning motion by setting the PWM for center position then stops the motor.

\end{description}

\subsection{move.c}

The move.c module is responsible for housing the control system that allows the robot to move correctly, and for controlling the different types of movements the robot does. \\

\begin{description}
    \item[void controller(void *pvParameters)] \hfill \\
        The control task, calculates the new adjusted PWM using the P control output equation explained above. It sets the pulse width to the adjusted PWM and sleeps, so the measuring task can take over and calculate the new error.

    \item[void measure (void *pvParameters)] \hfill \\
        The measure task encodes and averages 32 values from the encoder. The task subtracts each wheel’s reference value (ticks) from the encoded average (ticks) to find each wheel’s error.

    \item[void maneuvers (void *pvParameters)] \hfill \\
        Iterates over the array of movement patterns and sets the PWM for both motors accordingly. After this, it launches the measure and controller tasks to reduce the error of the movement.
\end{description}

渲染后,显示内容为:

在此处输入图片描述

我不确定问题是什么。有人遇到过这种情况吗?

答案1

您不能在文本中直接使用下划线,因为它应该在数学模式下使用。以下是一些指导原则:单词(文本)中的下划线,您可以执行以下操作:

在此处输入图片描述

\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}

\begin{description}
  \item[void starter(int id1, \detokenize{uint16_t} pwm1, int id2, \detokenize{uint16_t} pwm2)] \hfill \\
  This function takes in two motor IDs and the PWM to set for both of them. A delay of either 1270~ticks or 
  700~ticks is applied (at fixed operational PWM) depending on whether the motion instruction is 
  forward/backward by about 30~cm (one tile) or a spin of about 90~degrees in either direction. 
  These values were found mathematically using the distance formula above and then proven experimentally.
\end{description}
\end{document}

当然,链接帖子中建议的任何方法都可以作为替代方法。

_如果你在文档中根本不使用数学模式,则可以禁用它,这样你就可以在文档中随意使用它。请参阅是否可以声明文档不含数学知识以阻止“缺少$插入”?

相关内容