Replicating `SetKwInOut` and the format from `algorithm2e` in `algorithmicx` The 2019 Stack...
How to notate time signature switching consistently every measure
Are there any other methods to apply to solving simultaneous equations?
How to support a colleague who finds meetings extremely tiring?
Slides for 30 min~1 hr Skype tenure track application interview
The difference between dialogue marks
What is the most efficient way to store a numeric range?
Mathematics of imaging the black hole
How to type this arrow in math mode?
Can there be female White Walkers?
Does a dangling wire really electrocute me if I'm standing in water?
Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?
Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?
"consumers choosing to rely" vs. "consumers to choose to rely"
"as much details as you can remember"
Why is the Constellation's nose gear so long?
Why are there uneven bright areas in this photo of black hole?
Why couldn't they take pictures of a closer black hole?
How come people say “Would of”?
If a sorcerer casts the Banishment spell on a PC while in Avernus, does the PC return to their home plane?
What do I do when my TA workload is more than expected?
How to check whether the reindex working or not in Magento?
Why didn't the Event Horizon Telescope team mention Sagittarius A*?
Can a flute soloist sit?
The phrase "to the numbers born"?
Replicating `SetKwInOut` and the format from `algorithm2e` in `algorithmicx`
The 2019 Stack Overflow Developer Survey Results Are InAlign Input and Output of algorithm to leftProblem with the block with the word wrap in algorithmicxusing standalone with algorithmicx or algorithm2eHow may I remove EndIf and EndFor in algorithmicx?Fixing the location of the appearance in algorithmicx environmentHow to have the algorithmicx comment symbol in algorithm2e?algorithm2e style comments in algorithmicxalgorithm, algorithmic, algorithmicx, algorithm2e, algpseudocode = confusedHow to correct the alignment (of the line numbers) in algorithmicx?Algorithmicx: controlling newline at the begin of a block using flagsTracing line from algorithm2e in algorithmicx
Brief
I've heard that algorithmicx is the best algorithm package to use. However, in my work I've been using algorithm2e. On looking at a few examples on here its clear that it is a bit difficult converting between the two.
In particular, I've notice that the SetKwInOutcommands do not exist in algorithmicx. For example:
MWE
documentclass{book}
%for original algorithm
usepackage{amsmath}
usepackage[linesnumbered,ruled]{algorithm2e}
%usepackage{algorithm,algpseudocode}
usepackage{lipsum}
begin{document}
%Original table to try and replicate
lipsum[1-1]
begin{algorithm}[H]
SetKwInOut{Input}{Input}
SetKwInOut{Output}{Output}
SetKwInOut{Define}{Define}
underline{Initialise:} Conditions for algorithm;
Define {Definition of algorithm}
Input{Input of Algorithm}
Output{Output of algorithm}
underline{Sequence In Full:}
{
hspace{5pt} textbf{Start}:
}
{
hspace{17pt} Step 1 ;
}
{
bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup
}
{
hspace{17pt} Step 2 ;
}
{
bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup
}
{
hspace{17pt} Step 3 ;
}
{
hspace {5pt} textbf{End}
}
caption{Name of algorithm}label{alg:Name}
end{algorithm}
end{document}

Goal
Is there any way to replicate the above into algorithmicx. (As you can see the reason as to why i want to convert it is because i've read that algorithmicxis the only package which allows you to separate the algorithm over multiple pages). Thank-you in advance?
formatting algorithms algorithmicx
add a comment |
Brief
I've heard that algorithmicx is the best algorithm package to use. However, in my work I've been using algorithm2e. On looking at a few examples on here its clear that it is a bit difficult converting between the two.
In particular, I've notice that the SetKwInOutcommands do not exist in algorithmicx. For example:
MWE
documentclass{book}
%for original algorithm
usepackage{amsmath}
usepackage[linesnumbered,ruled]{algorithm2e}
%usepackage{algorithm,algpseudocode}
usepackage{lipsum}
begin{document}
%Original table to try and replicate
lipsum[1-1]
begin{algorithm}[H]
SetKwInOut{Input}{Input}
SetKwInOut{Output}{Output}
SetKwInOut{Define}{Define}
underline{Initialise:} Conditions for algorithm;
Define {Definition of algorithm}
Input{Input of Algorithm}
Output{Output of algorithm}
underline{Sequence In Full:}
{
hspace{5pt} textbf{Start}:
}
{
hspace{17pt} Step 1 ;
}
{
bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup
}
{
hspace{17pt} Step 2 ;
}
{
bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup
}
{
hspace{17pt} Step 3 ;
}
{
hspace {5pt} textbf{End}
}
caption{Name of algorithm}label{alg:Name}
end{algorithm}
end{document}

Goal
Is there any way to replicate the above into algorithmicx. (As you can see the reason as to why i want to convert it is because i've read that algorithmicxis the only package which allows you to separate the algorithm over multiple pages). Thank-you in advance?
formatting algorithms algorithmicx
add a comment |
Brief
I've heard that algorithmicx is the best algorithm package to use. However, in my work I've been using algorithm2e. On looking at a few examples on here its clear that it is a bit difficult converting between the two.
In particular, I've notice that the SetKwInOutcommands do not exist in algorithmicx. For example:
MWE
documentclass{book}
%for original algorithm
usepackage{amsmath}
usepackage[linesnumbered,ruled]{algorithm2e}
%usepackage{algorithm,algpseudocode}
usepackage{lipsum}
begin{document}
%Original table to try and replicate
lipsum[1-1]
begin{algorithm}[H]
SetKwInOut{Input}{Input}
SetKwInOut{Output}{Output}
SetKwInOut{Define}{Define}
underline{Initialise:} Conditions for algorithm;
Define {Definition of algorithm}
Input{Input of Algorithm}
Output{Output of algorithm}
underline{Sequence In Full:}
{
hspace{5pt} textbf{Start}:
}
{
hspace{17pt} Step 1 ;
}
{
bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup
}
{
hspace{17pt} Step 2 ;
}
{
bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup
}
{
hspace{17pt} Step 3 ;
}
{
hspace {5pt} textbf{End}
}
caption{Name of algorithm}label{alg:Name}
end{algorithm}
end{document}

Goal
Is there any way to replicate the above into algorithmicx. (As you can see the reason as to why i want to convert it is because i've read that algorithmicxis the only package which allows you to separate the algorithm over multiple pages). Thank-you in advance?
formatting algorithms algorithmicx
Brief
I've heard that algorithmicx is the best algorithm package to use. However, in my work I've been using algorithm2e. On looking at a few examples on here its clear that it is a bit difficult converting between the two.
In particular, I've notice that the SetKwInOutcommands do not exist in algorithmicx. For example:
MWE
documentclass{book}
%for original algorithm
usepackage{amsmath}
usepackage[linesnumbered,ruled]{algorithm2e}
%usepackage{algorithm,algpseudocode}
usepackage{lipsum}
begin{document}
%Original table to try and replicate
lipsum[1-1]
begin{algorithm}[H]
SetKwInOut{Input}{Input}
SetKwInOut{Output}{Output}
SetKwInOut{Define}{Define}
underline{Initialise:} Conditions for algorithm;
Define {Definition of algorithm}
Input{Input of Algorithm}
Output{Output of algorithm}
underline{Sequence In Full:}
{
hspace{5pt} textbf{Start}:
}
{
hspace{17pt} Step 1 ;
}
{
bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup
}
{
hspace{17pt} Step 2 ;
}
{
bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup
}
{
hspace{17pt} Step 3 ;
}
{
hspace {5pt} textbf{End}
}
caption{Name of algorithm}label{alg:Name}
end{algorithm}
end{document}

Goal
Is there any way to replicate the above into algorithmicx. (As you can see the reason as to why i want to convert it is because i've read that algorithmicxis the only package which allows you to separate the algorithm over multiple pages). Thank-you in advance?
formatting algorithms algorithmicx
formatting algorithms algorithmicx
asked Jan 15 '18 at 10:16
HELPHELP
815
815
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Yes algorithmicx has something like: SetKwInOut it's called : Require and Ensure in the algopseudocode layout of algorithmicx (you will have to use usepcakage{algopseudocode}`).
Then you can rename it as you want using this methods:
algrenewcommandalgorithmicrequire{textbf{Input:}}
algrenewcommandalgorithmicensure{textbf{Output:}}
as suggested here: Align Input and Output of algorithm to left
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f410448%2freplicating-setkwinout-and-the-format-from-algorithm2e-in-algorithmicx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Yes algorithmicx has something like: SetKwInOut it's called : Require and Ensure in the algopseudocode layout of algorithmicx (you will have to use usepcakage{algopseudocode}`).
Then you can rename it as you want using this methods:
algrenewcommandalgorithmicrequire{textbf{Input:}}
algrenewcommandalgorithmicensure{textbf{Output:}}
as suggested here: Align Input and Output of algorithm to left
add a comment |
Yes algorithmicx has something like: SetKwInOut it's called : Require and Ensure in the algopseudocode layout of algorithmicx (you will have to use usepcakage{algopseudocode}`).
Then you can rename it as you want using this methods:
algrenewcommandalgorithmicrequire{textbf{Input:}}
algrenewcommandalgorithmicensure{textbf{Output:}}
as suggested here: Align Input and Output of algorithm to left
add a comment |
Yes algorithmicx has something like: SetKwInOut it's called : Require and Ensure in the algopseudocode layout of algorithmicx (you will have to use usepcakage{algopseudocode}`).
Then you can rename it as you want using this methods:
algrenewcommandalgorithmicrequire{textbf{Input:}}
algrenewcommandalgorithmicensure{textbf{Output:}}
as suggested here: Align Input and Output of algorithm to left
Yes algorithmicx has something like: SetKwInOut it's called : Require and Ensure in the algopseudocode layout of algorithmicx (you will have to use usepcakage{algopseudocode}`).
Then you can rename it as you want using this methods:
algrenewcommandalgorithmicrequire{textbf{Input:}}
algrenewcommandalgorithmicensure{textbf{Output:}}
as suggested here: Align Input and Output of algorithm to left
answered 3 mins ago
Simon C.Simon C.
1135
1135
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f410448%2freplicating-setkwinout-and-the-format-from-algorithm2e-in-algorithmicx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown