« first day (1698 days earlier)      last day (3532 days later) » 

00:15
Not my project, but a pretty neat idea: github.com/Nicowcow/rulex Thoughts?
00:53
@SeanAllred Coffee is on me if you write a Vim plugin :(
01:10
@Nasser Would something like pythontex or pweave work for you?
@DavidCarlisle A fault indeed, but perhaps forgivable :)
@TorbjørnT. I tried pythontex 12000.org/my_notes/python_in_latex/index.htm but all these solutions are not really workable. The best way I found is to either using a real programming language that supports HERE-DOCUMENT such as perl or Ruby or Python and use this for the logic code and use it to emit raw Latex. Second option is to use Latex and program the logic in Latex....
but Latex programming is really not as good or powerful as these other languages.
@Nasser Well, it's not intended to be.
@TorbjørnT. I know. That is the whole issue.
For example, I am not stuggling to make \foreach work inside a table. While in Python, I would simply generate the whole table with its content as pure latex and be done with it. Then use the latex file generated as is. i.e. I can generate everything from the script. I have the data, and build the table itself directly in the script and at the end write to a file. This is what I have been doing.
opps, s\I am not stuggling\I am now stuggling\
 
3 hours later…
04:15
Hello everyone!
It feels really awkward to be saying this in this manner (especially after having been on SE for more than an year).
0
Q: Tweaking even/odd format and header format in a CUED Thesis Template

The Dark SideI have prepared my PhD thesis in the LaTeX template of Cambridge University, available here. (I'm using an older version 1.1, which can be accessed here.) Now, I am experiencing two major problems with this template, when I compile everything in the twoside format (by so defining it in the docu...

I can't officially place a bounty till two days, as per the rules.
But I'm in real dire straits with a submission deadline, and this minor ailment that I can't fix is a big concern for me.
So, +10 (upvote), +15 (accept) and +50 (bounty) assured to anyone who appropriately fixes this in the next 24 hrs.
:: Kneels down and begs ::
Please ..., anyone!
 
3 hours later…
07:18
@TheDarkSide It is quite normal for the outer margin to be larger one: tex.stackexchange.com/questions/42063/illogical-twoside-margins
@TorbjørnT. I was just making exactly that comment on the question!
@TorbjørnT. I'm also very suspicious of two-sided printing here: in the UK theses are normally required to be one-sided, at least for final submission (mine was)
@JosephWright You would know more about that than me.
@JosephWright Thanks, but I'm not in UK. Just using the CU format because my univ. doesn't have a template, and this is a common one adopted, which goes well, in
@TheDarkSide I guess it's rather too late for this, but really only use a template if you are at the specific institution it is designed for
(and I'm deleting it soon to preserve my anonymity.)
07:22
@TheDarkSide No rules on two-sided versus one-sided?
Two sided from common experience with friends/group seniors.
Plus, it is 320 pages, one sided will be extremely cumbersome.
@TheDarkSide Two volumes, perhaps, but that happens
What! Never heard of that!!
@TheDarkSide Subject-area dependent. In areas where long theses are common, two volume binding is well-known. I was at a meeting recently with some people with experience in geology, and apparently 400 pages is normal.
@TheDarkSide I'm a chemist so 150-250 pages is more the typical range
Both Joseph and @TorbjørnT., if the inner margin is smaller, won't there be problems in binding? You want a bigger margin on the side where it is supposed to be bound?
@JosephWright ^
07:39
Oh. OK Sorry, I missed visiting the post you linked, @TorbjørnT.
Urgh, why did they change the image upload, now I have to start a file manager to add an image, annoying.
The answers here, particularly Jan's explicit answer shatters my beliefs about binding.
Does that mean I can compile my thesis as a oneside, and still get the margins right for two sided binding?
08:00
@daleif No, just click in the box to be able to select a file. Or you can copy the image itself (not the file), and paste that.
@TorbjørnT. Ahh too early in the morning, glasses didn't work ;-)
@TheDarkSide Don't think it will be exact, and it would depend on how much is lost in the binding. (But I'm not an expert in page layout etc.)
Ah, finally ... TheDarkSide is here ;-)
08:22
@TorbjørnT. Okay! So, my rough imagination is that, if I'm shrinking what I've decided to print on a page to lets say 98%, the rest 2% can make up for the binding deficits, while still not compromising on the 12pt convention by any visible amount?
@ChristianHupfer Lol, what? You probably mean the abstract dark side, or did you run into me on some other SE site (Physics, Academia)?
@TheDarkSide Nope ... I mean the dark side
Bwahahaha ...
08:48
@TheDarkSide why shrink for binding? it is more normal to just reduce \textwidth a bit. the geometry package allows specification of binding offsets so does the arithmetic for you to adjust the text width and margins appropriately.
09:15
@DavidCarlisle Sir, I don't think I got it fully. For example, in the relevant class file here, there are commands for adjusting the margins in here, but I didn't want to tinker with them even a bit, because I'm not sure about my TeX skills. Could you guide please?
Hmm, thinking about it for a minute, if I tweak the evensidemargin marginally, so that the text blocks are not affected, it might do the job.
But I'm not sure how to keep the text blocks unaffected, I think just adjusting the margin on one side won't do that.
Clearly, my aim here of tinkering is solely to ensure it gets bound properly, and binding doesn't eat into the margins in an ugly manner. Nothing else.
Any inputs on how to implement that?
@TheDarkSide that class looks like it's a rather random collection of commands collected from various ages, Do you have to use it? In particular it loads geometry but then doesn't use it it sets the page size using explicit setlength commands but anyway since geometry is loaded you can overload the settings in the preamble, see texdoc geometry for documentation, normally you use options to \usepackage but as the package is already loaded you can use \geometry see bindingoffset key.
:: Googles "bindingoffsetkey" ::
And Google leads me back here.
@DavidCarlisle - Sir, based on the example here (a different answer to a related issue), I should add the specifications to the geometry package usepackage command. But if the setlengths are getting defined afterwards, will just saying \usepackage[a4paper, bindingoffset=0.4in, vmarginratio=1:1]{geometry} work? I don't think it should, but I don't know.
Wait, did you mean overloading these class file settings, by specifying these in the preamble of the tex fiel being compiled? @DavidCarlisle
@DavidCarlisle - So, that means I can add \usepackage[a4paper, bindingoffset=0.4in, vmarginratio=1:1]{geometry}, in the preamble of my tex file being compiled and it won't make a mess of my document in terms of the content I've squeezed in on each page. (That's my sole reason for persisting with this, I'm close to submitting, too late to tweak too much) :)
09:46
@TheDarkSide Out of interest and completely unrelated to the matter at hand. How did you come to use this template? What did you google for and why? Why did you choose this specific template? I am very interested to hear something about it.
Hi @Johannes_B, incidentally I was just going through this post and this comment of yours.
I got it the sheepish way (as you can guess).
@TheDarkSide Seems the link is missing?
Oops.
That, now.
So, resuming, I got it the sheepish way.
@TheDarkSide What do you mean with sheepish way?
Univ. doesn't specify a template, => what template to use (BTW TeX amateur)
=> Ask group seniors what they used
=> Use the one they used.
=> Experience some problem.
=> try to find work-arounds
=> Realize there are better templates available, why did I use this!!
Actually, the point is, I didn't even know it was CUED till I tried squeezing in work arounds, I knew this only as "the template my seniors used"!
=> Sheeple!
But realization has dawned too late, now I have to submit.
09:53
@TheDarkSide What do you promise yourself from a template? What is your definition of a template? What would make a good template? And finally, how do you (try to) judge the quality of a template?
There is a template site around latextemplates.com/cat/theses Looking at the descriptions of those three provided templates, which one would you choose? And i am not suggesting to use any of those ;-) I am just interested.
@Johannes_B Ah. I see what you are arriving at. You mean I should've known enough enough TeX to tweak stuff for myself.
:(
@TheDarkSide OK don't change now:-) If you are that close to submitting I wouldn't mess with anything just add \addtolength\oddsidemargin{1cm} \addtolength\evensidemargin{-1cm} or whatever length ypu need to add 1cm (here) to the binding edge
@TheDarkSide No, i am just interested in what you were thinking when searching. I am something of a template terrorist. Don't be scared.
@DavidCarlisle Thanks, and if I read it right, this will cut from 1cm from the other side and add it to the binding edge (niavely)?
@TheDarkSide yes all the typesetting/page breaking will be unchanged you will just shift the text block of every page 1cm to the right
09:58
@DavidCarlisle Looking at forest.sty, it requires elocalloc, which basically makes it run 2015+ only. Do you think this is a good idea?
@Johannes_B no it requires elocalloc but not latex 2015
@DavidCarlisle Thanks a lot. Should I add it in an over-ruling manner in the preamble of the tex file being compiled, or in the cls file itself?
@DavidCarlisle But that wasn't contained in 2014, right?
@Johannes_B originally I suggested a bit of inline test for the latex version that defined \locbox on new latex or loaded etex.sty but he didn't like the look of that and asked for a package, so I wrote elocalloc
@Johannes_B no, but neither was the new forest
@DavidCarlisle Right, fair point :-)
10:02
@TheDarkSide preamble, don't mess with existing class/package files or you'll do a system update and have all your changes lost:-)
@Johannes_B he explicitly waited until tl2015 updates started again and elocalloc had been out for a week before pushing the updated forest to ctan
Yeah, thanks a lot @DavidCarlisle. I will try and get back to this chat room.
Thanks @Johannes_B.
@DavidCarlisle I got confused because a german user needed elocalloc for forest in TL 2014. maybe she did manually update it.
@TheDarkSide Take care of your thesis right now, when you are done, i'd really like to here some insights to my questions. :-)
@Johannes_B would be interesting to find out
@DavidCarlisle shall i ask?
@Johannes_B that would be one way;-)
10:14
@DavidCarlisle She seems to be using a dtx and renamed it to tex it seems. I left a comment.
@Johannes_B life would be simpler without users
10
@DavidCarlisle :-)
@WillRobertson, @JosephWright can we use @PauloCereda's hummingbird rather than a purple T for the latex3 github thing?
@DavidCarlisle I'll sort it
10:40
@DavidCarlisle github.com/latex3
@DavidCarlisle I added the team e-mail address whilst I was at it
@DavidCarlisle Everyone on the team who has a GitHub account is down as a manager: you could have done this :-)
1
Q: What other advantage, than using of special (math) symbols, is in using TeX editors over Write/MS WOrd

Libor SupcikWhat are the features of Lyx, Bacoma, Papeerea or SharedLatex (besides the option to insert symbols) that you can not do well with LibreOfficeWrite/MS Word ?

@Johannes_B Indeed
10:58
@DavidCarlisle ooh royalties <3
11:33
@JosephWright yes but I didn't know if the purple thing meant something, so didn't want to zap it without asking:-)
yo'
yo'
11:54
@StevenB.Segletes, I just think the person did not know any better. I've also gotten a manuscript back where the copyeditor wanted . to be added after each floating table. Luckily we had the last word. Clearly it was not a person who previously had dealt with science publications. — daleif 1 min ago
@daleif ^^ I disagree. Very likely the person had been molesting scientific works for ages.
12:19
@yo' well given that this particular publisher does not publish that many books from natural science, they might be forgiven their lack of knowledge of the traditions we use.
yo'
yo'
@daleif ah. First time seeing a "float" on their job? :D
yo'
yo'
12:35
@barbarabeeton You know what they say: when you "assume", you make an "ass" out of "u" and "me" :^)Steven B. Segletes 28 mins ago
Oh I see what he did here.
13:08
@yo' They do not even know the concept. We might have been the first to publish math books writen via LaTeX through them.
If anybody wonders why it is so silent, i am trying to apply some fixes to Thesis.cls from the template site. Some replacements of the hard codings. Let's hope they are good and we get less questions :-)
13:26
Hi everybody! Yet another time, I was looking for @egreg: I’ve asked him if he was willing to teach me a lesson about this question, but I see he’s not here. Maybe anyone of you would be so kind as to take his place as a teacher? (If I’m not abusing your time and your wisdom, of course! :-)
13:36
@GustavoMezzetti Commands set up using \DeclareRobustCommand automatically behave inside \protected@edef, and unlike \noexpand, \protect knows about 'context' (\edef, \write, typesetting)
@GustavoMezzetti Here I am.
@JosephWright: Yes, i know that. It would be disastrous, of course, if a \noexpand got into the way at he wrong place. But what I do not understand is egreg’s remark that \noexpand should be avoided in the situation mentioned in the question I cited above, when you know that you are performing an \edef.
@GustavoMezzetti What I wanted to say is that \noexpand\textit{xyz} may save your day, but you can't do it in general, if you happen to want \edef\temp{#1}.
@GustavoMezzetti Well \proected@edef will deal with not just one token: what if #1 contains another problematic case?
@egreg: Hi! Thank you for giving me your advice. I‘m always glad to learn from you!
13:45
@GustavoMezzetti Of course using \protected macros would solve the issue, but that's for LaTeX3
@JosephWright: Well, of course: you must know what you are doing. But even with \protected@edef you must prepend each fragile command with \protect
@GustavoMezzetti No
@GustavoMezzetti Anything fragile should be declared using \DeclareRobustCommand: it's a long time since the extra token usage was a problem
@GustavoMezzetti There are still some fragile macros, but quite unlikely to appear in moving arguments. For them \protect is still necessary.
@egreg A decreasing set, hopefully
@JosephWright Some package author thinks different. ;)
13:48
@GustavoMezzetti Remember that if they are in the user input you can't be sure of the \edef, so \noexpand would not be appropraite
@egreg Indeed, or probably don't know
@JosephWright There's at least one package that makes \cite fragile, AFAIR.
yo'
yo'
@egreg indeed, Springer does it, for instance :(
@egreg Yes, true
3
Q: \protect with \cite inside \caption

Paul BuckinghamI've read several posts and other webpages now on using \protect in front of \cite inside \caption. They all advise using \protect in this situation, and many go as far as to say that you must use it. Now, I've been able to use \cite inside \caption without \protect and still get no errors. For ...

@JosephWright: In was concerned with the case in which you do define a fragile command yourself using \newcommand*… But I see that this discussin is beginning to look rather pointless: I understand what you are telling, and my doubts have now gone. Thank you very much for your explanations!
13:52
@GustavoMezzetti If you do it yourself and know enough TeX to handle \edef and \noexpand then you should be safe enough ;-)
@egreg: I must begin to study LaTeX3: where should I start from? I guess that it requires e-TeX extensions (you mentioned \protected).
@GustavoMezzetti Yes, it does. Look for answers with expl3 or xparse
Hey, guys, you are typing faster than I can read! Please excuse me, but I’ve got a disease that hinders me in typing on the keyboard…
yo'
yo'
@GustavoMezzetti That's a tough question. I would recommend using interface3.pdf as the primary source of information.
I had already planned to read expl3.pdf and interface3.pdf (obviously in that order). About the latter, I am wondering whether should I read it sequentially, form the first part on, or in a different order.
14:00
@GustavoMezzetti: you could start with xparse, which is built on top of L3. It might give you an overview of things to come. :)
yo'
yo'
@GustavoMezzetti do not read it thoroughly. Read it well enough to understand the concepts (types of variables, types of arguments). But it's more a reference manual than a learning manual!
@PauloCereda: That one I’m already reading. And I’m pleased to see that there is again a general provision for delimited argument, something that was lost in passing from plain TeX to LaTeX.
Correction: argument_s_.
@GustavoMezzetti Yes, but delimited arguments should be used very sparingly in LaTeX. They're more a convenience for “inner” macros rather than user level ones.
@egreg: Thank you. Just one more thing: what were you hintng at when you spoke of the case of na\noexpand\"ive?
@GustavoMezzetti You can't expect the user types in \na\noexpand\"ive when feeding the argument to a macro, can you?
If you expect the argument to be \textit{string} then you can add \noexpand at the beginning of the replacement text for the \edef. But again, if string contains “dangerous” macros, you have a problem.
14:14
@egreg: OK, I was wondering if there was any deeper reason. (:-) I am obliged for your explanations. Hey! It looks like posts may be edited! (:-) (Just discovered!)
@GustavoMezzetti Yes, there's a short grace time for editing.
How much short? For instance, two minutes is not that short for me.
@GustavoMezzetti Not sure how much.
OK guys, I thank you all very much for your time and your wise advice, as well as for your enjoyable company. See you next time!
 
1 hour later…
15:36
@Canageek ACS are taking a real interest in supporting LaTeX: I have a call to the US next week to discuss it :-)
@Canageek I guess if they do a good job I'll have to talk to my contacts at the RSC and Wiley!
16:15
@JosephWright Do you mean supporting latex submission to their journals, or supporting latex development team meetings in in Hawaii?
@DavidCarlisle Oddly enough the first one
@JosephWright shame
@DavidCarlisle :-)
@DavidCarlisle Probably I should get the 'user' part of the LuaTeX suggestions sorted
@JosephWright yes not sure how we'll get signoff to take to a wider audience, I guess at some point just mail the current maintainers and show a proposal
@DavidCarlisle The usual problem, I guess
16:22
@JosephWright usual solution too
@DavidCarlisle Some of us will think it's a good idea, others won't, actions will dictate in the end
@DavidCarlisle Englishmen enjoying fun? Shocking.
<3
@PauloCereda but only if Americans pay, and apparently I misunderstood Joseph and that's not happening:(
@DavidCarlisle oh no!
@DavidCarlisle I'll flesh out the docs and send to the team list, and we can then see what comes back
@DavidCarlisle I'd like to have something concrete well before TUG2015
16:50
0
Q: No newline before scientific units without using "~"

ail246Is it possible to define a list of units (like ml, °C, nmol, eq., etc.) and forbid latex to insert a newline before those? I know it is possible to use a ~ between number an unit, but the above described method would be much more convenient for me. Thanks for helping me!

I am tempted ...
@JosephWright Catch some easy rep.
@egreg No, that's not the way things work
27
Q: What package should I use to typeset units?

Denilson SáI know there are a few packages related to typesetting units: unitsdef units, which can be seen as a "base package" used by unitsdef SIunits siunitx, which is the successor to SIunits maybe others? like cjwunits and hepunits What is the difference between them? Do they also work inside Math m...

I suspect
A RedHat user around that can give advice on installing LaTeX editors? latex-community.org/forum/…
@egreg OK, I might get some rep from my dupe suggestion :-)
@JosephWright Shame. ;-)
17:27
Again, what to do with questions that are answered by “RTFM”?
1
Q: Set up [Sharp]C language for listings

user2314351Why must I use style work-around to set C# language in listings? Why \begin{lstlisting}[language=[Sharp]C] cannot be processed by LaTeX? \documentclass[a4paper,12pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{listings} \usepackage{inconsolata} \usepackage{xcolor...

I made a CW
yo'
yo'
18:10
@egreg well, makes sense (in view of our habits, not in view of SOs habits :-D )
But it is not an exactly bad question: the issue is not trivial (and the manual long), and the question is well-stated...
 
1 hour later…
19:19
@DavidCarlisle I see you've said what I thought (team list)
@JosephWright Hm then David seems to have thought what you've seen he said, which is what you thought too? :)
@PauloCereda quack
@DavidCarlisle ooh 'ello!
19:45
@PauloCereda To be honest, the context means that makes more sense than the message I'm thinking about!
@JosephWright quack!
@DavidCarlisle :-)
@JosephWright uh-oh
@DavidCarlisle he is good. Very good. :)
@PauloCereda I am a master of many languages, that one is particularly easy.
@DavidCarlisle Quack quack quack, quack, quack quack!
3
I'm even able to make complex sentences!
19:58
@egreg better than your English attempts.
@PauloCereda See who's mean to others?
@egreg Quack <- see that's not mean
20:19
@egreg David is mean. :)
@egreg ooh complex sentences. :)
@PauloCereda I'll check with @ChristianHupfer but I think the spelling is MAEN
@egreg I might get some units rep after all: the edited question seems to require a bit more detail than the old one
@egreg A DUCK!
@PauloCereda I hope Stefan's Grandma is doing well, I picked up another 20 points today.
yo'
yo'
@JosephWright indeed. Too old to be eaten, though. :P
20:37
@DavidCarlisle LOL
@DavidCarlisle Same here. :)
yo'
yo'
@PauloCereda new computer language, based on "quack", "Quack", "!<space>" and ",<space>"
similar one to WhiteSpace
@yo' Working on it.
@PauloCereda 𝔰𝔭𝔯𝔢𝔠𝔥𝔢𝔫 𝔖𝔦𝔢 𝔇𝔢𝔲𝔱𝔰𝔠𝔥? 𝔔𝔲𝔞𝔠𝔨
2
@DavidCarlisle ooh
yo'
yo'
21:04
@PauloCereda oh yeah!
@DavidCarlisle I love the old k -- it's one of the most confusing minuscules in old Czech texts :-)
21:38
@yo':
quack!!!  quack quack  quack quack  quack quack  quack quack
quack quack, quack!!!!!! quack quack quack quack quack quack
quack  quack quack,  quack!!!!!!!  quack  quack quack  quack
quack  quack, quack!!!!!!!  quack  quack  quack quack  quack
quack,  quack!!!!!!! quack  quack  quack  quack quack  quack
quack  quack quack,  quack,  quack!!!!!!  quack quack  quack
quack  quack quack  quack quack,  quack!!!!!!!! quack  quack
quack quack quack, quack!!!!!! quack quack quack quack quack
quack  quack, quack!!!!!!!  quack quack  quack quack  quack,
:)
@egreg: I wonder if @Arthur will let me include a duck dialect into polyglossia because of this achievement. :)
21:56
@PauloCereda \renewcommand{\chaptername}{Quack}\renewcommand{\appendixname}{Quack}...
I'm tempted to say something like "no problem, if you register a BCP 47 code for it" ;-)
@ArthurReutenauer qck seems good
@ArthurReutenauer @egreg solved our problems. :)
I was going to post a question now, but thought to first check here with the experts. When I have space in my data, below, the \foreach fails. I assume this is by design. I was wondering if there is a work around? or if I should post this as question. I've been googling and find no answer. Here is MWE
\documentclass[]{article}
\usepackage{tikz}% (for other things)
\usepackage{xinttools}

\def\mydata{
{This is some text

   $\sin(x)=1$
},
{This is also stuff}}

\begin{document}
\foreach \x in \mydata
{
      \x \\
}
\end{document}
The problem is the empty line after "this is some tex"
This works:

\documentclass[]{article}
\usepackage{tikz}% (for other things)
\usepackage{xinttools}

\def\mydata{
{This is some text
   $\sin(x)=1$
},
{This is also stuff}}

\begin{document}
\foreach \x in \mydata
{
      \x \\
}
\end{document}
@Nasser blank line = \par
22:09
\documentclass[]{article}
\usepackage{tikz}% (for other things)
\usepackage{xinttools}

\def\mydata{
{This is some text
\endgraf
   $\sin(x)=1$
},
{This is also stuff}}

\begin{document}
\foreach \x in \mydata
{
      \x \\
}
\end{document}
@Nasser ^^^ but it's simpler not to use foreach than work around such things, but I know you have a fascination for that macro.
@DavidCarlisle but I do not want to add anything in there. I want to have literal text as is. copy paste it from somewhere., i.e. I do not want to edit it each time and add \endgraf ?
@DavidCarlisle I do not have fascination for that macro, it is the only tool I know now to make a loop in Latex, that is all.
@Nasser well don't use foreach, tex macros are either lon or not long (\newcommand` or \newcommand* in latex definition terms, non-long onses do not allow paragraph ends)
@DavidCarlisle: did enjoy my new programming language? :)
@Nasser \loop \@tfor, simle recursive macro?
@PauloCereda quack
@DavidCarlisle uh-oh. :)
22:15
\documentclass[]{article}


\def\mydata{
{This is some text
\endgraf
   $\sin(x)=1$
}
{This is also stuff}}

\begin{document}

\long\def\x#1{#1\par\x}
\long\def\endx#1#2{}

\expandafter\x\mydata\endx


\end{document}
@Nasser ^^
@DavidCarlisle thanks, but this really does not work for me. I have some raw text, that I want to process. I do not want to edit it, and add \endgraf every where there is empty lines. I was hoping I can just throw it in \def\mydata{} as is, then make a loop to build tables from it. I think this whole thing does not work in Latex. I need to look at different approach to do this.
@Nasser look at the one there is no endgraf, I just iterate over the list exactly as you asked? ooh I left th eendgraf in:-) replace that by a blank line:-)
\documentclass[]{article}


\def\mydata{
{This is some text

   $\sin(x)=1$
}
{This is also stuff}}

\begin{document}

\long\def\x#1{#1\par\x}
\long\def\endx#1#2{}

\expandafter\x\mydata\endx


\end{document}
@DavidCarlisle ok, will try again,. yes, I saw it there first. Ok, will let you know
@Nasser ^^
@DavidCarlisle but where is the LOOP??
it works, but I want the LOOP
22:22
@Nasser loops are just syntactic sugar for recursion. see the definition of \x (that's how \foreach etc are defined anyway)
When I also added this: pdflatex hangs
\foreach \x in \mydata
{
      \x \\
}
@DavidCarlisle reason I want the loop, is that I want to do other things and add other logic in the loop, in addition to what I showed. This was just simple example. Is it possible to use your trick, but still use a loop? thanks. I tried this and it hangs:
@Nasser I removed the , from the \mydata list but you can't use \foreach anyway if you want paragraphs
\documentclass[]{article}
\def\mydata{
{This is some text

   $\sin(x)=1$
}
{This is also stuff}}

\begin{document}

\long\def\x#1{#1\par\x}
\long\def\endx#1#2{}
\expandafter\x\mydata\endx
\foreach \x in \mydata
{
      \x \\
}
\end{document}
@Nasser a loop is just a macro defined to call itself, if I had called it \myforeach instead of \x would you have said it was a loop?
@DavidCarlisle ok, I need to use \foreach actually as I said, this is just small example. I want to be able to add things in between the iterations and such. i..e I want the loop to be explicit to allow me to more easily control and inject latex code in between.
22:26
@Nasser you said you were not fascinated by \foreach why do you keep taking working documents and adding it to stop them working?
@Nasser no \foreach is just a simple macro basically defined like the \x I showed, but without the \long there is no possibility that you can do more with \foreach than with \x they are the same thing basically, just minor syntax differences and \x allows paragraphs as you requested.
@DavidCarlisle let me show an example in Python, may be this will help illustrate what I mean. This builds a table from raw data. I'll show the code, then show the output. Here is the code:
data=["\section{some section}
      this is somedata",

data = [
       [r"""http://robotics.stackexchange.com/""",r"""Stack exchange Robotics forum/"""],
       [r"""http://math.stackexchange.com/""",r"""Math Stack Exchange"""],
       [r"""http://mathoverflow.net/""",r"""Mathoverflow"""]
     ]

print '\\begin{tabular}{cc}\\hline'

for item in data:
  for idx,entry in enumerate(item):
     print '\\href{'+entry+'}{\\nolinkurl{'+entry+'}}'
     if idx<len(item)-1 :
        print '&'
  print '\\\\\hline'
Now when I run the above, this is what I get
\begin{tabular}{cc}\hline
\href{robotics.stackexchange.com \\\hline }{\nolinkurl{robotics.stackexchange.com \\\hline }}
&
\href{Stack exchange Robotics forum/}{\nolinkurl{Stack exchange Robotics forum/}}
\\\hline
\href{math.stackexchange.com}{\nolinkurl{math.stackexchange.com}}
&
\href{Math Stack Exchange}{\nolinkurl{Math Stack Exchange}}
\\\hline
\href{mathoverflow.net}{\nolinkurl{mathoverflow.net}}
&
\href{Mathoverflow}{\nolinkurl{Mathoverflow}}
For me, the above is much simpler to do, than having to make macros in Latex or type the table by hand. In the code I showed, I can more easily modify it and change the table or anything else I want. I was hoping to do the same all in Latex if possible
@Nasser sorry you are not making sense;-) a loop is the same thing as a recursive macro, it's as if you took an english paragraph and insisted on using German words in it as you found them more familiar. But if you'd rather have a recursive macro with for in its name, latex provides one:
\documentclass[]{article}

\makeatletter

\def\mydata{
{This is some text

   $\sin(x)=1$
}
{This is also stuff}}

\def\myfor{\@tfor\myitem:=}

\begin{document}

\expandafter\myfor\mydata\do{
\myitem\par}



\end{document}
@DavidCarlisle ok, thanks, I will look at your code and try to understand it.
22:41
@DavidCarlisle I totally agree with @PauloCereda ;-)
@ChristianHupfer that's last time I ask you for help
@DavidCarlisle You've asked very subly then ;-) Well, you seem to be determined, I have to cope with this odds in future... sob

« first day (1698 days earlier)      last day (3532 days later) »