Math & Science ⇒ "problem" environment
"problem" environment
I tried looking around, but it is very hard because of google keywords confusing what I want semantically ("problem environment input output" etc.)
I want to create/use some existing environment which its output is as follows for example:
Problem 1.
Input: Graph G=(V,E)
Output: n, Number of cycles in graph
That's an example, of course.
It is similar to the header of the algorithm environment, only I want the Problem heading and not have an actual algorithm below that, just the problem definition. Any ideas?
Oh, and I want "input" and "output" to be in bold, if that matters a lot...
Thanks!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
"problem" environment
it all depends on your particular needs. In the following example I defined a really basic new command (\myprob) that could give you some ideas:
Code: Select all
\documentclass{article}
% creation of a new counter
\newcounter{mycount}
% definition of the command
\newcommand\myprob[2]{%
\stepcounter{mycount}
\par\noindent Problem\ \themycount .\\
{\bfseries Input}: #1\\
{\bfseries Output}: #2\par
}
\begin{document}
\myprob{Graph $G=(V,E)$}{$n$, Number of cycles in graph}
\myprob{another input}{another output}
\end{document}