Skip to content

Steps to Convert Thesis into Two‐Column Format

Yen Cheng Chu edited this page Feb 25, 2024 · 4 revisions

Replacement

  1. Remove \chapter. The IEEE template does not support \chapter command.
  2. longtable environment does not support 1-column form. Use tabular instead.
  3. Do not use \include and \includeonly, replace them with \input.

Since VScode does not support named group according to this issue, using numbered group instead. Be careful before executing replacement.

Replace Chapters and Section Titles.

Replace the following commands in order.

\subsubsection

Find

\\subsubsection\{(?<title>.*)\}

Substitutions

\\paragraph{$1}

Note: the coloring feature is not supported for \subsubsection in IEEE template. Comment line 56-57 in ./NCS-Thesis-Style.cls to avoid \subsubsection command vanishing.

\let\oldsubsubsection\subsubsection
\renewcommand{\subsubsection}[1]{{\color{\ncs@titlecolor}\oldsubsubsection{#1}}}

\subsection

Find

\\subsection\{(?<title>.*)\}

Substitutions

\\subsubsection{$1}

\section

Find

\\section\{(?<title>.*)\}

Substitutions

\\subsection{$1}

\chapter

Find

\\chapter\{(?<title>.*)\}

Substitutions

\\section{$1}

Replace Subfigures

Since the IEEE template does not support \subfigure command, we need to replace it with subfloat.

Method 1: Using Figure Size Specified in the Original \includegraphics

Find

\\begin\{subfigure\}\{.*\}[.\\\r\n\s\w%\{\}><=]*\\includegraphics\[(?<size>.*)\]\{(?<fig_path>.*)\}[.\\\r\n\s\w%\{\}><=]*\\caption\{(?<caption>.*)\}[.\\\r\n\s\w%\{\}><=]*\\label\{(?<label>.*)\}[.\\\r\n\s\w%\{\}><=]*\\end\{subfigure\}

Substitutions

\\subfloat[$3\\label{$4}]{%\n        \\includegraphics[$1]{$2}}

Example:

\begin{figure}[htbp]
    \begin{subfigure}{.45\columnwidth}
        \centering
        \includegraphics[width=1.0\linewidth]{exp/setup/A4_inc_system_top.jpg}
        \caption{The A4-\textit{Inc} team system.}
        \label{fig:exp:setup:a4_inc}
    \end{subfigure}%
    \hfill
    \begin{subfigure}{.48\columnwidth}
        \centering
        \includegraphics[width=1.0\linewidth]{exp/setup/A4_inc_system_rviz.jpg}
        \caption{The A4-\textit{Inc} team system in Rviz.}
        \label{fig:exp:setup:a4_inc_rviz}
    \end{subfigure}%
    \caption{The hardware system and the coordinates of modules.}
    \label{fig:exp:setup:hardware}
\end{figure}

Result:

\begin{figure}[htbp]
    \subfloat[The A4-\textit{Inc} team system.\label{fig:exp:setup:a4_inc}]{%
        \includegraphics[width=1.0\linewidth]{exp/setup/A4_inc_system_top.jpg}}%
    \hfill
    \subfloat[The A4-\textit{Inc} team system in Rviz.\label{fig:exp:setup:a4_inc_rviz}]{%
        \includegraphics[width=1.0\linewidth]{exp/setup/A4_inc_system_rviz.jpg}}%
    \caption{The hardware system and the coordinates of modules.}
    \label{fig:exp:setup:hardware}
\end{figure}

Method 2: Using Figure Size Specified in the subfigure

Find

\\begin\{subfigure\}\{(?<fig_width>.*)\}[.\\\r\n\s\w%\{\}><=]*\\includegraphics\[width=(?<size>[\w\.]*\\[\w]*)(?<fig_options>.*)\]\{(?<fig_path>.*)\}[.\\\r\n\s\w%\{\}><=]*\\caption\{(?<caption>.*)\}[.\\\r\n\s\w%\{\}><=]*\\label\{(?<label>.*)\}[.\\\r\n\s\w%\{\}><=]*\\end\{subfigure\}

Substitution

\\subfloat[$5\\label{$6}]{%\n        \\includegraphics[$1$3]{$4}}

Example:

\begin{figure}[htbp]
    \begin{subfigure}{.3\columnwidth}
        \centering
        \includegraphics[width=1.0\linewidth, trim={0 0cm 1cm 0}, clip]{control/team/fullpose/force_projection_a.pdf}
        \caption{Saturation in magnitude.}
        \label{fig:ctrl:team:fullpose:force_projection:first_stage}
    \end{subfigure}%
    \hfill
    \begin{subfigure}{.6\columnwidth}
        \centering
        \includegraphics[width=1.0\linewidth, trim={0 0 1cm 0}, clip]{control/team/fullpose/force_projection_b.pdf}
        % \begin{minipage}{1cm} \vfill \end{minipage}
        \caption{Saturation in directions.}
        \label{fig:ctrl:team:fullpose:force_projection:second_stage}
    \end{subfigure}%
    \caption{The two-stage saturation for desired control force based on projections on an ellipse.
    The green region indicates the attainable force space and the red arrow is the desired force.
    \label{fig:ctrl:team:fullpose:force_projection}}
\end{figure}

\begin{figure}[htbp]
    \centering
    \begin{subfigure}{.3\columnwidth}
        \centering
        % trim={<left> <lower> <right> <upper>}
        \includegraphics[width=1.0\linewidth]{control/team/fullpose/attitude_planner_theta_a.pdf}
        \caption{Consistent orientation.}
        \label{fig:team:fullpose:attitude_planner_theta_sketch_a}
    \end{subfigure}%
    % \hfill
    \begin{minipage}{5cm} \vfill \end{minipage}
    \begin{subfigure}{.3\columnwidth}
        \centering
        % trim={<left> <lower> <right> <upper>}
        \includegraphics[width=1.0\linewidth]{control/team/fullpose/attitude_planner_theta_b.pdf}
        \caption{Inconsistent orientation.}
        \label{fig:team:fullpose:attitude_planner_theta_sketch_b}
    \end{subfigure}%
    \caption{Visualization of the solution to the z-basis of an optimal attitude in \eqref{eq:ctrl:team:attitude_planner:original_opt_prob}.
    The green region indicates the attainable force space and $\mathbf{u}_{fr}$ is the nominal force which will be calculated in \secref{sec:control:team:full_pose_geo_control}.}
    \label{fig:team:fullpose:attitude_planner_theta_sketch}
\end{figure}

Result:

\begin{figure}[htbp]
    \subfloat[Saturation in magnitude.\label{fig:ctrl:team:fullpose:force_projection:first_stage}]{%
        \includegraphics[.3\columnwidth, trim={0 0cm 1cm 0}, clip]{control/team/fullpose/force_projection_a.pdf}}%
    \hfill
    \subfloat[Saturation in directions.\label{fig:ctrl:team:fullpose:force_projection:second_stage}]{%
        \includegraphics[.6\columnwidth, trim={0 0 1cm 0}, clip]{control/team/fullpose/force_projection_b.pdf}}%
    \caption{The two-stage saturation for desired control force based on projections on an ellipse.
    The green region indicates the attainable force space and the red arrow is the desired force.
    \label{fig:ctrl:team:fullpose:force_projection}}
\end{figure}

\begin{figure}[htbp]
    \centering
    \subfloat[Consistent orientation.\label{fig:team:fullpose:attitude_planner_theta_sketch_a}]{%
        \includegraphics[.3\columnwidth]{control/team/fullpose/attitude_planner_theta_a.pdf}}%
    % \hfill
    \begin{minipage}{5cm} \vfill \end{minipage}
    \subfloat[Inconsistent orientation.\label{fig:team:fullpose:attitude_planner_theta_sketch_b}]{%
        \includegraphics[.3\columnwidth]{control/team/fullpose/attitude_planner_theta_b.pdf}}%
    \caption{Visualization of the solution to the z-basis of an optimal attitude in \eqref{eq:ctrl:team:attitude_planner:original_opt_prob}.
    The green region indicates the attainable force space and $\mathbf{u}_{fr}$ is the nominal force which will be calculated in \secref{sec:control:team:full_pose_geo_control}.}
    \label{fig:team:fullpose:attitude_planner_theta_sketch}
\end{figure}

Remove longtable

Example:

\begin{center}
    \renewcommand\arraystretch{0.6}
    \renewcommand\cellset{\renewcommand\arraystretch{0.6}%
        \setlength\extrarowheight{0pt}}
    \begin{longtable}{|c c c | c c c c | c c | c c|}
        \caption{Team UAV systems in tracking tasks with different control allocation algorithms. The colored cell indicates an outperformed entry compared among control allocation algorithms in the same team configuration.} \label{tab:sim:conf_comp:tracking_diff_CA}                 \\
    \end{longtable}
\end{center}

Result:

\begin{table*}[t]
    \centering
    \caption{Team UAV systems in tracking tasks with different control allocation algorithms. The colored cell indicates an outperformed entry compared among control allocation algorithms in the same team configuration.} \label{tab:sim:conf_comp:tracking_diff_CA}
    \begin{tabular}{|c c c | c c c c | c c | c c|}
        ...
    \end{tabular}
\end{table*}

Note that the extra \\ in the end of \caption should be removed.