I'm new to LaTeX and am trying to get something like this in my document, i.e center aligning two lines inside a tcolorbox
:
However I cannot get this as \linebreak
doesn't seem to work with tcolorbox
.
What I end up with is something like this :
Here's my code :
\documentclass[a4paper]{article}
%% Language and font encodings
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
%% Sets page size and margins
\usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
%% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\usepackage{multicol}
\usepackage{algpseudocode}
\usepackage{tcolorbox}
\title{MPI}
\begin{document}
\maketitle
\begin{tcolorbox}[colback = white]
\textbf{{\color{blue} MPI\_Init(int *argc, char **argv) }}
\begin{align}
Input : argc, argv arguments \linebreak
return : MPI\_SUCCESS or error code
\end{align}
\end{tcolorbox}
\end{document}
Will be great if someone could show how to do it correctly.
Thanks in advance.
tcblisting
library oftcolorbox
here. Alsoalign
isn't the correct tool for this description anyway here -- it is amath
mode environment, and the output of the characters in italics is clearly wrong – user31729 Oct 18 '17 at 20:59