
여기, 명령은 및 \tcc{iterate over all training examples}
사이에 큰 간격을 생성합니다 . 왼쪽 정렬은 괜찮습니다. 그런데 어떻게 간격을 줄이고 컴팩트하게 만들 수 있을까요?examples
*/
답변1
\SetNoFillComment
환경 내에서 algorithm
로컬 로 명령을 사용 nofillcomment
하거나 algorithm2e
.
MWE(링크된 답변에서 빌림):
\documentclass{article}
\usepackage{xcolor}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\newcommand\mycommfont[1]{\footnotesize\ttfamily\textcolor{blue}{#1}}
\SetCommentSty{mycommfont}
\begin{document}
\begin{algorithm}[H]
\DontPrintSemicolon
\SetNoFillComment % <---------------------------
\KwData{Training set $x$}
$\Delta_{ji}^l := 0$ \tcp*{will be used to compute $\partial x$}
\tcc{iterate over all training examples}
\caption{Example code}
\end{algorithm}
\end{document}
산출: