193 reputation
6
bio website
location
age
visits member for 3 years, 7 months
seen Sep 18 at 20:31

Nov
13
awarded  Popular Question
Mar
27
awarded  Nice Question
Mar
12
awarded  Teacher
May
12
awarded  Scholar
May
12
accepted Space inserted after “\input” call
May
12
comment Space inserted after “\input” call
Strangely enough, I was pretty sure there shouldn't be a newline at the end of the file- at least according to Notepad++ with special characters displayed. With that said, both the % and the \endinput work like a charm. I'll also try to keep the unskip in mind, but I don't want to wipe out any intentional whitespace when reading the file.
May
11
asked Space inserted after “\input” call
May
11
answered Macro that inserts arguments into an environment
May
11
comment Macro that inserts arguments into an environment
Found one solution which works allright. I set up a couple of commands that store the "Active Variable" temporarily. That way I can use a set of static functions that read from these caches. It's less flexible than param passing in some ways, but it gets the job done.
May
11
comment Macro that inserts arguments into an environment
Still plugging at this. Other possible solutions I have thought of: \detokenize followed by \scantokens to emulate writing to a file and then reading from it. However, this doesn't seem to be doing what it should. Doesn't fail, but it doesn't run anything when it scans. (text after scantokens is the same as before it)
May
11
comment Macro that inserts arguments into an environment
Yah, I was kind of afraid of the whole "writing to file and reading." Is there any way to make a macro that accomplishes the same thing without having to actually... write to a file? Like a way to turn everything into string and then have an equivalent of an "eval" run on it? I'm trying to keep the file generation to a minimum.
May
10
comment Macro that inserts arguments into an environment
I'm afraid this still doesn't seem to accomplish what I want. Due to the internal mechanisms of how begin and end occur, the begin command doesn't correctly identify the end in this form (it thinks there is one too many } or it swallows the whole file).
May
10
awarded  Supporter
May
10
comment Macro that inserts arguments into an environment
Also, many thanks to Philipp for adding the Python tag, I appreciate it.
May
10
comment Macro that inserts arguments into an environment
Awesome, thanks. I'll try this out. I think this highlights a bit of a misunderstanding that I had about macros. From reading this, "not expanding" a macro means that it expands at runtime I assume? (I mean, has to be evaluated sometime). Expanding it means that it expands immediately on definition (in some order, which one painstakingly imposes). Am I correct on that?
May
10
comment Macro that inserts arguments into an environment
I have looked into Lua a bit, but there were a couple of things that kept me from going that route. Firstly, there's not a lot of packages for it compared to Python for things I'd be likely to do. Secondly, I've been using Python for a bunch of other projects and would be useful to hook into TeX. Thirdly, I find Python to just plain be a good language, one of my favorites. Lua just doesn't seem to have all the features I'd want.
May
10
awarded  Student
May
10
comment Macro that inserts arguments into an environment
Additionally, while I don't have the ability to- I would love it if someone would tag this post with "Python" also. It befuddles me that the tag doesn't exist here, given that there's at least a few different projects relating to Python driving or being driven by LaTex/Tex.
May
10
asked Macro that inserts arguments into an environment