我有以下代码:
\documentclass[12pt,a4paper,twoside]{book}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithm*}[t!]
\caption{caption}
\begin{algorithmic}[1]
\Require{require}
\State {testttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt}
\Return{return a}
\end{algorithmic}
\end{algorithm*}
\end{document}
如何在 \State 中断行并以与上一行相同的缩进量开始新行?
答案1
它是自动完成的:
\documentclass[12pt,a4paper,twoside]{book}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithm*}[t!]
\caption{caption}
\begin{algorithmic}[1]
\Require{require}
\State {test tttt tttt tttt tttt tttt tttt tttt tttt tttt tttt
tttt tttt tttt tttt tttt tttt tttt tttt tttt tttt tttt}
\Return{return a}
\end{algorithmic}
\end{algorithm*}
\end{document}