Obeylines and gappto from etoolboxHow can I undo an etoolbox patch?etoolbox: trouble with boolean expressionsmultiple lists in etoolboxPhantom and etoolbox iftoggleDifference between newbool and newtoggle from etoolbox packageRemove indentation from abstract environment with etoolboxetoolbox conflict with bm packagehelp with using etoolbox with docsvlist and listaddrenewcommand or patchcmd (from etoolbox)?question of ifstrequal in etoolbox
What does a straight horizontal line above a few notes, after a changed tempo mean?
How to keep bees out of canned beverages?
What is the best way to deal with NPC-NPC combat?
How do I reattach a shelf to the wall when it ripped out of the wall?
Contradiction proof for inequality of P and NP?
How do I check if a string is entirely made of the same substring?
Multiple options vs single option UI
Apply a different color ramp to subset of categorized symbols in QGIS?
Complex numbers z=-3-4i polar form
Is there a word for the censored part of a video?
All ASCII characters with a given bit count
Why do distances seem to matter in the Foundation world?
Is there any pythonic way to find average of specific tuple elements in array?
Extracting Dirichlet series coefficients
Should the Product Owner dictate what info the UI needs to display?
Find the identical rows in a matrix
"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?
Is it acceptable to use working hours to read general interest books?
How important is it that $TERM is correct?
Nails holding drywall
Retract an already submitted recommendation letter (written for an undergrad student)
Help with my training data
A Paper Record is What I Hamper
How to not starve gigantic beasts
Obeylines and gappto from etoolbox
How can I undo an etoolbox patch?etoolbox: trouble with boolean expressionsmultiple lists in etoolboxPhantom and etoolbox iftoggleDifference between newbool and newtoggle from etoolbox packageRemove indentation from abstract environment with etoolboxetoolbox conflict with bm packagehelp with using etoolbox with docsvlist and listaddrenewcommand or patchcmd (from etoolbox)?question of ifstrequal in etoolbox
In order to simplify data entry with as little markup of the data as possible, I am attempting the following:
documentclassarticle
usepackageetoolbox
begingroup
obeylines
gdefing#1 #2 #3gapptotabbody% Collect rows of tabular[x] in tabbody
%% Ignore #1 and/or #2 if empty (= . )
if.#2
if.#1
&\
else
#1&\
fi
else
if.#1
\
else
#1\
fi
fi
%
endgroup
%%%%%% This, without the if's works, though it does not do what I need:
begingroup
obeylines
gdefiing#1 #2 #3gapptotabbody% Collect rows of tabular[x] in tabbody
#1\
%
endgroup
begindocument
begingroup
obeylines
everypar=ing %<<<--- change to iing and there is no error
a 1 u
b 2 v
. 3 w
d 4 x
e 5 y
f 6 z
endgroup
begintabularccc
tabbody
endtabular
enddocument
I'm getting an unexpected error:
ERROR: Incomplete if; all text was ignored after line 39.
--- TeX said ---
<inserted text>
fi
l.39 ^^I^^Itabbody
I have looked at past queries, but have not thus far found an answer. If I remove all of the if
statements from the definition of ing
(=iing
) the problem goes a way. Quite sure I'm missing something really basic -- something to do with the timing of the expansion of the if
s, but I'm stuck for the moment.
etoolbox
add a comment |
In order to simplify data entry with as little markup of the data as possible, I am attempting the following:
documentclassarticle
usepackageetoolbox
begingroup
obeylines
gdefing#1 #2 #3gapptotabbody% Collect rows of tabular[x] in tabbody
%% Ignore #1 and/or #2 if empty (= . )
if.#2
if.#1
&\
else
#1&\
fi
else
if.#1
\
else
#1\
fi
fi
%
endgroup
%%%%%% This, without the if's works, though it does not do what I need:
begingroup
obeylines
gdefiing#1 #2 #3gapptotabbody% Collect rows of tabular[x] in tabbody
#1\
%
endgroup
begindocument
begingroup
obeylines
everypar=ing %<<<--- change to iing and there is no error
a 1 u
b 2 v
. 3 w
d 4 x
e 5 y
f 6 z
endgroup
begintabularccc
tabbody
endtabular
enddocument
I'm getting an unexpected error:
ERROR: Incomplete if; all text was ignored after line 39.
--- TeX said ---
<inserted text>
fi
l.39 ^^I^^Itabbody
I have looked at past queries, but have not thus far found an answer. If I remove all of the if
statements from the definition of ing
(=iing
) the problem goes a way. Quite sure I'm missing something really basic -- something to do with the timing of the expansion of the if
s, but I'm stuck for the moment.
etoolbox
1
Why do you needobeylines
so many places? Droppingobeylines
before the definition ofing
allows the file to compile and produces reasonable output.
– Andrew Swann
9 hours ago
Good point! Confirmed.
– sgmoye
8 hours ago
add a comment |
In order to simplify data entry with as little markup of the data as possible, I am attempting the following:
documentclassarticle
usepackageetoolbox
begingroup
obeylines
gdefing#1 #2 #3gapptotabbody% Collect rows of tabular[x] in tabbody
%% Ignore #1 and/or #2 if empty (= . )
if.#2
if.#1
&\
else
#1&\
fi
else
if.#1
\
else
#1\
fi
fi
%
endgroup
%%%%%% This, without the if's works, though it does not do what I need:
begingroup
obeylines
gdefiing#1 #2 #3gapptotabbody% Collect rows of tabular[x] in tabbody
#1\
%
endgroup
begindocument
begingroup
obeylines
everypar=ing %<<<--- change to iing and there is no error
a 1 u
b 2 v
. 3 w
d 4 x
e 5 y
f 6 z
endgroup
begintabularccc
tabbody
endtabular
enddocument
I'm getting an unexpected error:
ERROR: Incomplete if; all text was ignored after line 39.
--- TeX said ---
<inserted text>
fi
l.39 ^^I^^Itabbody
I have looked at past queries, but have not thus far found an answer. If I remove all of the if
statements from the definition of ing
(=iing
) the problem goes a way. Quite sure I'm missing something really basic -- something to do with the timing of the expansion of the if
s, but I'm stuck for the moment.
etoolbox
In order to simplify data entry with as little markup of the data as possible, I am attempting the following:
documentclassarticle
usepackageetoolbox
begingroup
obeylines
gdefing#1 #2 #3gapptotabbody% Collect rows of tabular[x] in tabbody
%% Ignore #1 and/or #2 if empty (= . )
if.#2
if.#1
&\
else
#1&\
fi
else
if.#1
\
else
#1\
fi
fi
%
endgroup
%%%%%% This, without the if's works, though it does not do what I need:
begingroup
obeylines
gdefiing#1 #2 #3gapptotabbody% Collect rows of tabular[x] in tabbody
#1\
%
endgroup
begindocument
begingroup
obeylines
everypar=ing %<<<--- change to iing and there is no error
a 1 u
b 2 v
. 3 w
d 4 x
e 5 y
f 6 z
endgroup
begintabularccc
tabbody
endtabular
enddocument
I'm getting an unexpected error:
ERROR: Incomplete if; all text was ignored after line 39.
--- TeX said ---
<inserted text>
fi
l.39 ^^I^^Itabbody
I have looked at past queries, but have not thus far found an answer. If I remove all of the if
statements from the definition of ing
(=iing
) the problem goes a way. Quite sure I'm missing something really basic -- something to do with the timing of the expansion of the if
s, but I'm stuck for the moment.
etoolbox
etoolbox
asked 9 hours ago
sgmoyesgmoye
4,11511328
4,11511328
1
Why do you needobeylines
so many places? Droppingobeylines
before the definition ofing
allows the file to compile and produces reasonable output.
– Andrew Swann
9 hours ago
Good point! Confirmed.
– sgmoye
8 hours ago
add a comment |
1
Why do you needobeylines
so many places? Droppingobeylines
before the definition ofing
allows the file to compile and produces reasonable output.
– Andrew Swann
9 hours ago
Good point! Confirmed.
– sgmoye
8 hours ago
1
1
Why do you need
obeylines
so many places? Dropping obeylines
before the definition of ing
allows the file to compile and produces reasonable output.– Andrew Swann
9 hours ago
Why do you need
obeylines
so many places? Dropping obeylines
before the definition of ing
allows the file to compile and produces reasonable output.– Andrew Swann
9 hours ago
Good point! Confirmed.
– sgmoye
8 hours ago
Good point! Confirmed.
– sgmoye
8 hours ago
add a comment |
1 Answer
1
active
oldest
votes
You don't want to define ing
under the scope of obeylines
, but just use the active ^^M
as delimiter (reinserting it at the end so a par
will be issued.
You also want to expand the conditionals before appending the result to tabbody
.
documentclassarticle
usepackageetoolbox
begingrouplccode`~=`^^Mlowercaseendgroupdefing#1 #2 #3~%
xapptotabbody% Collect rows of tabular[x] in tabbody
%% Ignore #1 and/or #2 if empty (= . )
if.#2%
if.#1%
unexpanded&\%
else
unexpanded#1&\%
fi
else
if.#1%
unexpanded\%
else
unexpanded#1\%
fi
fi
~% we want a `par`
begindocument
begingroup
obeylines
everypar=ing %<<<--- change to iing and there is no error
a 1 u
b 2 v
. 3 w
d 4 x
e 5 y
f 6 z
endgroup
%showtabbody % for debugging
begintabularccc
tabbody
endtabular
enddocument
However, an input such asa 1 u\
would be much easier to manage and less fragile.
– egreg
8 hours ago
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%2f487572%2fobeylines-and-gappto-from-etoolbox%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
You don't want to define ing
under the scope of obeylines
, but just use the active ^^M
as delimiter (reinserting it at the end so a par
will be issued.
You also want to expand the conditionals before appending the result to tabbody
.
documentclassarticle
usepackageetoolbox
begingrouplccode`~=`^^Mlowercaseendgroupdefing#1 #2 #3~%
xapptotabbody% Collect rows of tabular[x] in tabbody
%% Ignore #1 and/or #2 if empty (= . )
if.#2%
if.#1%
unexpanded&\%
else
unexpanded#1&\%
fi
else
if.#1%
unexpanded\%
else
unexpanded#1\%
fi
fi
~% we want a `par`
begindocument
begingroup
obeylines
everypar=ing %<<<--- change to iing and there is no error
a 1 u
b 2 v
. 3 w
d 4 x
e 5 y
f 6 z
endgroup
%showtabbody % for debugging
begintabularccc
tabbody
endtabular
enddocument
However, an input such asa 1 u\
would be much easier to manage and less fragile.
– egreg
8 hours ago
add a comment |
You don't want to define ing
under the scope of obeylines
, but just use the active ^^M
as delimiter (reinserting it at the end so a par
will be issued.
You also want to expand the conditionals before appending the result to tabbody
.
documentclassarticle
usepackageetoolbox
begingrouplccode`~=`^^Mlowercaseendgroupdefing#1 #2 #3~%
xapptotabbody% Collect rows of tabular[x] in tabbody
%% Ignore #1 and/or #2 if empty (= . )
if.#2%
if.#1%
unexpanded&\%
else
unexpanded#1&\%
fi
else
if.#1%
unexpanded\%
else
unexpanded#1\%
fi
fi
~% we want a `par`
begindocument
begingroup
obeylines
everypar=ing %<<<--- change to iing and there is no error
a 1 u
b 2 v
. 3 w
d 4 x
e 5 y
f 6 z
endgroup
%showtabbody % for debugging
begintabularccc
tabbody
endtabular
enddocument
However, an input such asa 1 u\
would be much easier to manage and less fragile.
– egreg
8 hours ago
add a comment |
You don't want to define ing
under the scope of obeylines
, but just use the active ^^M
as delimiter (reinserting it at the end so a par
will be issued.
You also want to expand the conditionals before appending the result to tabbody
.
documentclassarticle
usepackageetoolbox
begingrouplccode`~=`^^Mlowercaseendgroupdefing#1 #2 #3~%
xapptotabbody% Collect rows of tabular[x] in tabbody
%% Ignore #1 and/or #2 if empty (= . )
if.#2%
if.#1%
unexpanded&\%
else
unexpanded#1&\%
fi
else
if.#1%
unexpanded\%
else
unexpanded#1\%
fi
fi
~% we want a `par`
begindocument
begingroup
obeylines
everypar=ing %<<<--- change to iing and there is no error
a 1 u
b 2 v
. 3 w
d 4 x
e 5 y
f 6 z
endgroup
%showtabbody % for debugging
begintabularccc
tabbody
endtabular
enddocument
You don't want to define ing
under the scope of obeylines
, but just use the active ^^M
as delimiter (reinserting it at the end so a par
will be issued.
You also want to expand the conditionals before appending the result to tabbody
.
documentclassarticle
usepackageetoolbox
begingrouplccode`~=`^^Mlowercaseendgroupdefing#1 #2 #3~%
xapptotabbody% Collect rows of tabular[x] in tabbody
%% Ignore #1 and/or #2 if empty (= . )
if.#2%
if.#1%
unexpanded&\%
else
unexpanded#1&\%
fi
else
if.#1%
unexpanded\%
else
unexpanded#1\%
fi
fi
~% we want a `par`
begindocument
begingroup
obeylines
everypar=ing %<<<--- change to iing and there is no error
a 1 u
b 2 v
. 3 w
d 4 x
e 5 y
f 6 z
endgroup
%showtabbody % for debugging
begintabularccc
tabbody
endtabular
enddocument
answered 8 hours ago
egregegreg
737k8919363264
737k8919363264
However, an input such asa 1 u\
would be much easier to manage and less fragile.
– egreg
8 hours ago
add a comment |
However, an input such asa 1 u\
would be much easier to manage and less fragile.
– egreg
8 hours ago
However, an input such as
a 1 u\
would be much easier to manage and less fragile.– egreg
8 hours ago
However, an input such as
a 1 u\
would be much easier to manage and less fragile.– egreg
8 hours ago
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%2f487572%2fobeylines-and-gappto-from-etoolbox%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
1
Why do you need
obeylines
so many places? Droppingobeylines
before the definition ofing
allows the file to compile and produces reasonable output.– Andrew Swann
9 hours ago
Good point! Confirmed.
– sgmoye
8 hours ago