来源
写个 algorithm 流程,但是在 怎么设置以及换不同 algorithm 包 都导致 伪代码 开头的 “Algorithm” 不加粗。
解决方式
更换多个包以及copy别人模板,都是不加粗。猜想是和自己 preamble 中的部分包冲突。 复制一份 tex 文档,一个包一个包的调试,最后发现与 下面这个包 冲突。
\usepackage{floatrow}
algorithm 模板
% Algorithm conflicts with \usepackage{floatrow}, leading to unbold Algorithm Keyword
\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{algorithm}
\caption{An algorithm with caption}\label{alg:cap}
\textbf{Input:} Since SMA is a temperature activated material, the heat transfer model is developed in this section to study the temperature profile \\
\textbf{Output:} under internal resistive heating and compressed air cooling. Furthermore, incorporated it into the microscopic
\begin{algorithmic}[1]
% \Require $n \geq 0$
% \Ensure $y = x^n$
\State $y \gets 1$
\State $X \gets x$
\State $N \gets n$
\While{$N \neq 0$}
\If{$N$ is even}
\State $X \gets X \times X$
\State $N \gets \frac{N}{2}$ \Comment{This is a comment}
\ElsIf{$N$ is odd}
\State $y \gets y \times X$
\State $N \gets N - 1$
\EndIf
\EndWhile
\end{algorithmic}
\end{algorithm}
For loop
\begin{algorithm}
\caption{Optimal design of SMA antagonistic actuator}
\textbf{Input:} Required maximum bending $\alpha_{req}$, required stiffness $K_{req}$, required output force $F_{req}$. \\
\textbf{Output:} Optimal length $L_{opt}$ and optical diameter $d_{opt}$.
\begin{algorithmic}[1]
% \Require $n \geq 0$
% \Ensure $y = x^n$
% \State $y \gets 1$
% \State $X \gets x$
% \State $N \gets n$
\For{\texttt{$L \leftarrow L_{min}$ to $L_{max}$}}
\For{\texttt{$d \leftarrow d_{min}$ to $d_{max}$}}
\State \texttt{$\alpha_{max} > \alpha_{req}$}
\State \texttt{$\alpha_{max} > \alpha_{req}$}
\EndFor
\EndFor
\end{algorithmic}
\label{alg:cap}
\end{algorithm}