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!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
"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}