« first day (1697 days earlier)      last day (3237 days later) » 

3:46 AM
@Canageek Ok
 
 
5 hours later…
8:28 AM
@DavidCarlisle I'm going to try to get some order into the expl3 naming of LuaTeX primitives (so they all have predictable names independent of what happens about prefixes)
@DavidCarlisle I'm thinking the \Umath... ones all belong under \umath... rather than \luatex_umath...: does that sound OK? (XeTeX also has them and the names are going to get long otherwise).
 
8:39 AM
@JosephWright yes any dropped prefixes sounds good to me. I see you're reporting more bugs on luatex list...#
 
@DavidCarlisle Indeed
@DavidCarlisle I'm going to work through the primitive stuff and try to get a sensible set up in l3names
@DavidCarlisle Probably I'll add all of the XeTeX primitives and all of the pdfTeX ones that are shared with LuaTeX (or XeTeX) as well as the LuaTeX ones and the Umath ones
 
@JosephWright see the floatrow question here yesterday? I'm wondering about suggesting a change to \newinsert in the kernel so before it gives up it tries \@next\@freelist and if that is still a classic box (and typically it will be unless you are declaring inserts after setting floats which would be odd) then it just declares the insert to be that box and then does \extrafloats{1} to keep the freelist length the same
 
@DavidCarlisle didn't see the question
 
3
Q: problem of "floatrow" package in yathesis

MartialI am using yathesis to edit my thesis. In the main file of the template, the package "floatrow" is added automatically. I use Mac OS X 10.10. Before today, the MacTex version is 2014. and my work is compiled successfully. Tonight, I installed the MacTeX 2015 (old version is uninstalled). Then th...

@JosephWright ^^
@JosephWright no reply from Olga Lapko :(
 
@DavidCarlisle Not surprising
 
8:57 AM
@JosephWright I could try to invoke lppl and fix the thing but I'd rather wait a bit longer. arguably it's covered under version 1.3 (since it just links to the unversioned LPPL url)
 
@DavidCarlisle Yes
@DavidCarlisle CTAN will probably do an in-place if asked
 
9:55 AM
Nice! tufte-latex has been updated and one of the changes is that it loads xltxtra when the engine is XeLaTeX. :(
 
@egreg I see that's Will's what does it do exactly? Something bad I guess from your comment
 
@DavidCarlisle Nothing useful and something bad. It used to be a wrapper for fontspec and xunicode before the latter was automatically loaded by the former. The main issue is that it redefines \textsuperscript and \textsubscript to use font features, which in most font don't work (usually just a limited set of superscript/subscript characters is available). Will added the no-sscript option for coping with the problem and a separate package realscripts.
 
@egreg he's coming to Darmstadt, you can complain there:-)
 
@DavidCarlisle Oh, that's good! But that's just one more reason for not using the Tufte classes. ;-)
 
10:22 AM
@egreg its redefinition of \showhyphens doesn't work either:(
 
@DavidCarlisle It did, the last time I tried it.
\showhyphens{supercalifragilisticexpialidocious}

*********************** \showhyphens: ***********************

Underfull \hbox (badness 10000) detected at line 0
 \EU1/lmr/m/n/10 su-per-cal-ifrag-ilis-tic-ex-pi-ali-do-cious

*************************************************************
 
@egreg strangely that's exactly what I tried just now, but then try...
\showhyphens{supercalifragilisticexpialidocious elephant}
 
@DavidCarlisle The words must be separated by commas.
I've never understood why this incompatible change.
 
@egreg it's a bug, I'll complain (once I've got a fix to suggest)
 
@DavidCarlisle The macro was written by Jonathan Kew, Will just copied it.
 
10:26 AM
@egreg I know, but it's still a bug
3
 
@DavidCarlisle It uses \@for
 
17 secs ago, by David Carlisle
@egreg I know, but it's still a bug
 
@DavidCarlisle Jonathan didn't want to lose time in an interface, probably he just needed it for testing.
 
@egreg Indeed: have just had to add a fix for siunitx in this area
 
@egreg I'm tempted to suggest just using the original definition but replacing \normalfont by cmr so it avoids the external font library path
\gdef\showhyphens#1{%
  \setbox0\vbox{%
    \color@begingroup
    \everypar{}%
    \parfillskip\z@skip\hsize\maxdimen
    \usefont{OT1}{cmr}{m}{n}%
    \pretolerance\m@ne\tolerance\m@ne\hbadness\z@\showboxdepth\z@\ #1%
    \color@endgroup}}
although need to do something about missing characters...
 
10:31 AM
@DavidCarlisle That would somewhat limit the usefulness in case Russian hyphenation is being tested, I guess.
 
@egreg nah I mean fiddle it so it doesn't drop them, not sure if that's possible in xetex though, more experiments required...
 
@DavidCarlisle Hyphenation happens at a different stage than in Knuth TeX, which is the reason why the primitive \showhyphens doesn't work.
 
@egreg yes I know but I wonder if it's not possible to force it through the tfm path so \showhypens works without dropping all the characters, perhaps not. A quick fix of course would be to do a pre-pass over the argument replacing space by comma
 
10:51 AM
@DavidCarlisle Fails: characters over 255 are ignored. If \normalfont is used (with an OpenType font), the changed hyphenation machinery enters into action, so showing the underfull box is not sufficient.
@DavidCarlisle Chasing for rep answering to duplicate questions? :)
 
@egreg Odd question about slanted fonts: 3B2 hasn't used TeX for some time I think
 
@egreg yes probably true, I thought there was a missing character hook but I guess that was luatex...
 
@JosephWright Never heard about it.
 
@JosephWright it uses tex syntax for maths
 
@DavidCarlisle Yes but so do other things :-)
 
11:02 AM
@JosephWright yes but I mean a user probably doesn't know if it uses tex or not (as far as I know they grabbed bits of the tex source, I don't think 3b2 (now APP) actually ever used tex-the-program)
 
11:53 AM
hi
I have $k^{1.5} \lesssim m$ which I want to mean k^{1.5} is approximately less than m
but the approximately less than symbol is at the wrong height
is there a better way of doing this?
 
12:07 PM
@Lembik That is just how the symbol looks like in the font.
 
@Lembik I see nothing strange:
 
thanks.. it looks horrible to me!
but I found an answer that suggests \apprle which is better
14
A: \stackrel with \sim symbol

Gonzalo MedinaThe amssymb package offers you \lesssim, and, as egreg comments, the wasysym package offers \apprle, which raises the tilde a little bit. Here they are, side by side: \documentclass{article} \usepackage{amssymb} \usepackage{wasysym} \begin{document} $T\lesssim S \qquad T\apprle S$ \end{docume...

I don't know what the MnSymbol version is like as I get the promised name clash
 
12:25 PM
@DavidCarlisle I see Chris is on form
 
@JosephWright Seems i am not suscribed to that mailing list.
 
@Johannes_B Indeed not :-)
 
:22355892 I replied, i see you did too
 
@JosephWright A smile, that is what i wanted to see ;-)
 
@DavidCarlisle Yes
@DavidCarlisle It's not like we did some work on XeTeX recently or anything
 
12:36 PM
@JosephWright actually I could mention that:-)
 
I am new to animations and tikz but I would like to put some numbers on a circle and then rotate the circle one "notch" at a time. What should I read up on for that?
i.e. what is the modern way of doing that ?
 
@JosephWright That one just edited itself to be spam tex.stackexchange.com/a/251932/37907
 
1:07 PM
Diving into unicode-math code for the first time in too long. Oh dear. Good idea for bugging me about feature requests and bugs :) Hope to get a fair bit done this weekend. The main motivation, of course, is to fix alphabets!
Oh I see my name is still coming up here :) Sorry for the apparent inconveniences! To add some historical perspective on xltxtra — the original need for it was multi-fold. First of all, back then XeTeX didn't handle vertical character spacing correctly and macros like \LaTeX caused linestretch problems. So TeX logos needed to be \smash'ed to work correctly. Of course that seemed like a good time to define a common place for a \XeTeX macro, too.
Then Ross Moore's xunicode package turned up, and I wasn't happy with the idea of loading it automatically in fontspec (to give him credit, and so it was a little more visible what was going on). And then things like 2e footnote symbols were broken, unless you loaded fixltx2e, and a few other things that still have remnants in the package. So to sensibly start off a XeLaTeX document you needed many lines of boilerplate.
xltxtra was just a wrapper for all that stuff, and over time started shrinking again. (E.g., xunicode refuses to load under LuaTeX so it's hacked inside fontspec now.) And the "opentype" script thing turned out to be a bad idea, hence realscripts. And now fixltx2e is gone too! So xltxtra has become pretty minimal and only lingers for backwards compatibility reasons.
@DavidCarlisle How about I just change it to iterate over spaces? Or does it also need to zap punctuation? (And no reason that can't happen too.)
 
1:30 PM
@WillRobertson Hi! The original \showhyphens just takes a list of words separated by spaces, with expl3 it's a breeze splitting at spaces. :)
@WillRobertson I think I have somewhere an expl3 version.
 
What is your take on the newclude package. A user came by with a bibtex problem, and it turned out the it was fixed if we removed newclude and the use of \include* (or even \include).
 
@WillRobertson Here it is:
\documentclass{article}
\usepackage{ifluatex}

\ifluatex
\usepackage[english,ngerman]{babel}
\makeatletter\AtBeginDocument{\let\l@english\l@usenglishmax\language\l@english}\makeatother
\fi


\usepackage{fontspec}

\ExplSyntaxOn
\seq_new:N \l__xetex_showhyphens_seq
\box_new:N \l__xetex_show_hyphens_wrapping_box
\box_new:N \l__xetex_show_hyphens_temp_box
\box_new:N \l__xetex_show_hyphens_final_box
\box_new:N \g__xetex_show_hyphens_word_box

\cs_new_protected:Npn \xetex_show_hyphens:n #1
 {
  \box_clear:N \l__xetex_show_hyphens_final_box
 
1:47 PM
Hi @will, by the way, i was the one sending you the mail about the typo in ifmtarg :-)
 
@Johannes_B which typo (there is an almost verbatim copy of ifmtarg in memoir, though I'd rather refer to etoolbox)
 
@WillRobertson yes as @egreg says spaces would be better although of course the original just accepts more or less any tex input, which would be harder (and probably not necessary)
 
@daleif Just a \newcommand{\empty}{1]{<code>} unmatching brace in the documentation. Nothing to worry. :-)
 
@Johannes_B :-)
 
1:53 PM
@Johannes_B I haven't followed LC for a while.
 
@daleif Helpers always welcome, we are quite a few.
 
2:07 PM
@Johannes_B a funny thing about English: "quite a few" and "quite few" mean nearly opposite things. :-)
Based on the context, I think you meant "quite few" not "quite a few". ;-)
 
@PaulGessler Oh, you are right. Stuff like that happens when typing an email at the same time. Feel free to help out, we are quite few.
 
@Johannes_B how's the ping volume today? Getting hit in the head? :-)
 
@PaulGessler It is just perfect now ;-)
 
2:25 PM
Oh, I missed @WillRobertson :-(
 
3:03 PM
@Johannes_B QUACK
 
3:30 PM
@PauloCereda Quack.
Feature request: Instead of the usual unpleasant *plonk*, we get a *quack* when pinged in chat.
5
 
3:56 PM
Good maen
 
yo'
@Johannes_B QUACK!
 
@yo' QUACK :-)
 
yo'
Visited the Czech National Gallery in Prague today, and I gotta confess that cubism is pretty cool
gotta switch to linux to do some work, I don't have an internet connection there. So see you tomorrow!
 
 
1 hour later…
5:29 PM
@Johannes_B The plonk is scary.
 
@ArthurReutenauer I wouldn't say scary, but it isn't a nice sound. Especially when writing something in a hurry.
 
6:04 PM
@yo' Nice! I'd love to hear recommendations on what I should see when in Pruage. Oh, you are going to see Sendlec Ossuary while there, right?
 
6:24 PM
1
Q: achemso package: TOC entry behaves strangely

Suman ChakrabartyI am trying to write a manuscript for J. Phys. Chem. Lett. using the achemso package. But I am encountering a strange problem with the TOC entry (defined by \begin{tocentry} ... \end{tocentry}) when I use the journal=jpclcd class option. With journal=jacsat, the TOC entry gets printed in a separa...

Don't you love it when a bug report turns out to be something you did deliberately :-)
 
@JosephWright Are all of these issues documented in the manual? If not, that might help things. Your manual is a lot easier to read then submission guidelines.
@JosephWright Better still would be a \wtf command that tells you why it is laying out your document like this, but that would be a ton of work
@JosephWright Well to do in a useful manner. Printing "Because chemistry journals can't agree on anything" would be easy
 
@Canageek I've just had a very interesting e-mail from the ACS: will see what happens
 
@JosephWright I'm hoping they do like the engineers did and standardize
 
@Canageek Unlikely but also not really necessary
 
@JosephWright They could put all the journal editors in one place and make them fight in a steel cage match; losers all have to adopt the winners format
 
6:38 PM
@Canageek What I find odd is not that the journals have different styles in print/PDF but that they worry about it at the submission stage
@Canageek JACS will win
 
@JosephWright No, but it would be simpler. Less pain when copy/pasting citations into a powerpoint
 
@Canageek this depends on how long you will stay, you need few days just for Prague center, if you want to go to Sedlec, you should go to Kutná Hora as well, it is nice late gothic city
 
@JosephWright I think Steward Cantrill (Nat. Chem.) would do pretty well
@michal.h21 Oh that is an idea. I should have taken less time in Krakow and more in Prauge I think. I only gave myself ~4 days (Depending on how long the train from Krakow takes
 
@Canageek I was thinking specifically the ACS journals
 
@JosephWright That sucks. I don't like their citation layout as much sa the RSC one
 
6:41 PM
@Canageek The context was achemso, remember :-)
 
@JosephWright Right. ACS standardizing everything would be nice, as long as they don't do Biochemistrys fomrat
 
@Canageek Obviously overall I favour the JCS style (Journal of the Chemical Society: whatever the RSC are calling Chem Comm/OBC/Dalton/PCCP this week :-))
@Canageek Quite the opposite: each new journal seems to find a new way to differ from every other one they have. For example, I had to add a switch for Latin phrases in italics. Every ACS journal did no-italics until a recent launch!
 
@JosephWright ACS Central Science?
 
@Canageek ACS Nano according to my notes
 
@Canageek train from Krakow is about nine hours, you can go at night and sleep in train. when are you going there?
 
6:44 PM
@JosephWright Ah.
 
@Canageek I got a tip-off about Central Science before it launched :-)
 
@michal.h21 Fly to Krakow on the 2nd, fly home on the 16th.
@JosephWright Still not quite sure what the aim is there. Papers seem scattered.
 
@Canageek ah, so 4 days are for Prague or whole Czech R.?
 
@michal.h21 4 days for Prauge. Most of that time is the confrence in Krakow, I just taked on as much vacation as I could afford to the end
 
@JosephWright Did you clean out the comments by any chance under tex.stackexchange.com/a/251816/3235?
 
7:19 PM
@percusse Yes
@Canageek Make more money?
 
@JosephWright I'm not even offically a Ph. D. student yet. Also can only take so much time off from work
@JosephWright I don't know how grad students are paid in the UK, but I make $20K/year (14,400 EUR), of which I pay back ~$5K for tuition, so take home about 11,000 EUR
 
@Canageek I meant: 'Perhaps the aim of launching _ACS Central Science _was to make more money' ;-)
 
@JosephWright Ohhhh. Yeah. ACS sure needs a lot of money for a non-profit.
 
@Canageek UK Chemistry stipend is £13900 for the student, fees paid directly
 
@JosephWright You can choose to pay lump sum right off your pay or a bit at a time.
@JosephWright Wow, that is a lot more then I get. Course, SFU is one of the lowest stipend unis in Canada, since it is in Vancouver, the most expensive city
 
7:25 PM
@Canageek It's gone up quite a bit in the last ~15 years: when I did my PhD (1999-2002) I got about £6000 a year
 
@JosephWright Huh, you are about as old as my PI then
;)
 
@Canageek Quite possibly. A younger colleague has just been promoted to (full) professor in my department :-)
 
@JosephWright he is a bit older. Also, I know you use Professor a lot diffrently then we do.
@JosephWright (Here it means anyone with tenure)
 
@Canageek Yes, hence the (full) part in my message :-)
@Canageek I wouldn't count under your system: I'm still on probation
 
@JosephWright Ahhh, wasn't sure. Thought you might mean had a named chair or something.
 
7:28 PM
@Canageek Personal chair
 
@JosephWright That sounds like I should bring in a spare office chair from home so I don't have to use hte terrible ones they provide us with.
 
@Canageek :-)
@Canageek I have indeed done that in my own office
 
@JosephWright I have a spare one, but it won't fit in my spot since I'm in the corner.
 
7:49 PM
@JosephWright not planning to push to ctan, but so I don't lose it github.com/davidcarlisle/dpctex/tree/master/luaregisternames
 
8:06 PM
\begin{chat}
@all: hello
 
@gone hello
 
I'm new to Latex and haven't chatted here b4, but I have a question about the Standalone package. Would any one be able to help?
 
@gone don't ask if you can ask, just ask. But if the question requires any example code it is better to ask on the main site rather than in chat.
 
lol.
I thought I'ld ask before I asked anyway....

Standalone generates the STA file. It looks to me as though its putting an undesirable space between the token and its value. E.G.

\newcommand {\atest }{Inline}\input {\myTest {highlight.sty}}
there is a space between \atest and the curly brace
 
@gone those spaces are not seen by tex anyway so they have no effect
 
8:10 PM
yea, but what about the \myTest one?
The actual problem I'm having is with grand-child files using \input to load the Highlight.sty file, but they don't remember the declarations.
 
@gone same, try typesetting zz zz \LateX zz zz you will see the space after command names is dropped, it is just the delimiter for the end of the name.
@gone oh but what's that supposed to mean as in what is the definition of \mytest the argument of \input has to expand to a filename
 
I agree wrt my first question, but I'm not sure that's the case with
{\myTest {highlight.sty}}
 
@gone it is:-)
@gone what is \myTest ?
 
\myTest is a var I pass from the main.tex using \providecommand
\myTest is the path
 
@gone how is it defined
 
8:14 PM
the grand-child has: \input{\myTest{highlight.sty}}
which has no space
 
4 mins ago, by David Carlisle
@gone those spaces are not seen by tex anyway so they have no effect
 
I'm using the subpreambles option obviously
 
@gone so what's the definition of \MyTest is it just the path or a command taking an argument?
 
It's a litereal string I'm using to test with: \providecommand{\myTest}{Figures/}
 
@gone so that's wrong then
@gone \input{\myTest{highlight.sty}} is therefore \input{Figures/{highlight.sty}} which will fail unless your file is literally Figures/{highlight.sty} with the braces in the file name.
@gone you do not want the braces, and now you see why spaces after command names are ignored, you want \input{\myTest highlight.sty}
@gone but why are you including a .sty with \input rather than using \usepackage ?
 
8:20 PM
Ok, so where you have the space between \myTest and highlight.sty is ok?
That was generated by the highlight package on Ubuntu.
So I can include it via a \usepackage?
Didn't know that.
As I mentioned, I'm new to LaTeX, and I'm writing my document in a modular fashion. I have a structure (main) with chapters (children). The children need to import code snippets (grand-children)
 
@gone if you had no space it would be \myTesthighlight.sty which would try to execute the command \myTesthighlight
@gone if you are a beginner you probably shouldn't be using standalone. it's useful sometimes for some specialist tasks but personally I've never needed to use it (and have been using latex for nearly 30 years)
 
the \input {highlight.sty} is in the grand-children, and I've been able to have it read the file (since I didn't get an error) but when it gets to the body of the document it gives me Undefined Control Sequence error for symbols that are in the style file.
I'm kind of stuck with the template I'm using.
 
@gone as I said at the start, questions are best asked on the main site where you can use {} code blocks. make a small complete example that reproduces the problem and post as a question. Usually if you can reproduce the error locally it's easy to suggest a fix.
 
I'm using an \input to load the children, and that works. The Children don't have a \begin{document} or \end{document}.
In the children, I call up the code snippets inside a {figure} block. I've tried using \input, \include, \includestandalone, \import, \subimport.
 
@gone sorry I'm out, too much guesswork involved at this stage. make an example that demonstrates the problem.
 
8:31 PM
@DavidCarlisle \catcodetable?
 
@JosephWright Can I ask why?
 
@gone although in general standalone/import etc complicate the issue for little gain, it's usually better just to use the standard commands.
 
yep, I started writing my question, but I get shot down too frequently on Stack Exchanges. (hence my nickname actually). I don't find the forum a friendly place at all.
But thanks for your comments, and I'll do as you suggest.
 
@JosephWright no the register number from csname thing
 
@percusse The usual: comments are meant to be transitory, etc., and those ones did not really feel like they needed to be retained
 
8:33 PM
@gone we are not like stack overflow, we almost never downvote and are generally tolerant of new people :-)
 
@DavidCarlisle Yes, but the code doesn't cover \catcodetable does it?
 
@JosephWright Since when are we doing this? There are loads of questions. Do you have a specific reason for this or somebody flagged it?
 
@JosephWright oh sorry, yes catcodetable is like \box it doesn't have a foodef command so the csname holding the number is a \chardef
 
@percusse Anything with >20 comments gets flagged by Community. I read over the various ones it had flagged recently, actioned some and ignored others.
@DavidCarlisle Ah, fair point
@percusse Sometimes we remove them, sometimes we remove some of them, sometimes we leave them
 
@JosephWright Can you please next time let us know so we can clean up by ourselves?
@JosephWright Yes we is the buzzword I guess.
 
8:35 PM
@percusse ?
@percusse Tricky: I then end up adding more comments and depending on everyone to read over the flow and work out what makes sense
 
@JosephWright Nevermind.
We don't have any other issues apparently other than longer comments.
 
@percusse We don't remove that many comments but at the same time they are meant to be for clarification, etc., and I hope we handle it fairly
 
@JosephWright Yes. I should go back and read the rules apparently.
 
@percusse If you are unhappy I'll ask the others to take a look
36
Q: Why does plain TeX have a \bye command?

GausslerIn plain TeX, \bye marks the end of the TeX document. Yet why is such a command even needed? TeX should be quite able to see for itself that here, the file stops, and there is nothing more to find. I do not see why it needs a command to tell it so. I realise that LaTeX also has such a command, \...

Apparently this is the highest-viewed question in the past month
 
@JosephWright No, I guess it's me who is missing the point. Who are others by the way?
 
8:42 PM
@percusse Stefan and Martin: mods can see deleted comments, etc. and undelete them
 
@JosephWright And why would we do that? It was your call. I don't need the comments back. It was just a fun question. I'm just surprised that you deleted them without even letting us know. Because I'm pretty sure that's not how we operate. But, sigh, anyway. Do your thing thanks.
 
@percusse I'll add a note
@percusse Usually I add a comment if I clean things up as they've got 'heated' to try to prevent issues
 
@JosephWright And a good source of rep. ;-)
 
8:58 PM
@egreg: Tevez will be back to Boca Juniors, it seems.
 
@PauloCereda Yes, so it seems
 
You all have ruined me. Ruined, I say. I can't even read the common document without becoming absurdly uncomfortable and distracted.
 
@SeanAllred Some case of keming?
 
@egreg It's so much more than that, though. So much more.
 
9:03 PM
@DavidCarlisle :)
 
@SeanAllred we wub you. <3
 
@SeanAllred hmm it didn't auto insert itself yes like that
 
@PauloCereda I wub you, too.
 
@PauloCereda bad spelling is even worse than bad kerning
 
@DavidCarlisle You have to link to the image itself, e.g. https://imgs.xkcd.com/comics/kerning.png
 
9:05 PM
@SeanAllred yes but then you lose the mouseover, I'm sure xkcd used to be one of the special cases where linking to the page worked
 
@DavidCarlisle True; the mouseover for this one is gold.
 
thanks Dave. I'm writing my question atm.
 
@DavidCarlisle :)
This photo scares me. :)
 
@PauloCereda rulers of Germany France and Britain?
 
@DavidCarlisle ooh that's naughty. :)
 
9:55 PM
@egreg know about this? something seems to be wrong bbc.co.uk/sport/0/football/33085767
 
@DavidCarlisle That's perfectly in line with the level of other English sport teams.
 
is it possible in Latex to make an array of text, so that I can process it using \foreach\ and take each entry from this array to say add entry in a table later on? i.e. suppose I want to build large \tabular and I have the content. But I need to use loop to make the rows. The data that goes in each row, I'd this to be in some array on the side, that I can loop over, as one would do in normal Perl script for example.
Here is what I mean
\documentclass[12pt,titlepage]{article}
\usepackage{pgf,pgffor}
\begin{document}

\begin{tabular}{|c|c|}\hline
%\foreach\channel in ??
line 1 & 123
line 2 & 456
line 3 & 789
\end{tabular}
\end{document}
 
@Nasser you can do things although latex doesn't have arrays:-) there must be loads of examples on site of generating tables or look at datatool package
 
In the above, I want the table content shown to be in some other variable, and then use a loop to iterate over it. Much better than having to type each row by hand
@DavidCarlisle Ok, will look at datatool. All the examples I saw so far do not do what I want.
 
10:05 PM
@DavidCarlisle You can try beating the Scots at caber tossing.
 
@Nasser it's hard to guess what you want as your example just is already table markup apart from missing \\
@egreg have you ever tried to pick one of those things up?
 
@DavidCarlisle I leave them to the highlanders.
@DavidCarlisle Tiddlywinks seems to be demanding less physical strength
 
@egreg cerebral game, why we are world champions
 
@DavidCarlisle I'd like to do something like this:
\documentclass[12pt,titlepage]{article}
\usepackage{pgf,pgffor}

\mydata{
{line 1}{123}
{line 2}{456}
{line 3}{789}
}
\begin{document}

\begin{tabular}{|c|c|}\hline
\foreach\x in \mydata
       x[#1] & x[#2] \\
\end
\end{tabular}
\end{document}
 
@Nasser datatool will do that, but why? it's more markup than just typing the table.
 
10:10 PM
Which ofcourse does not work now, But that is the idea. i.e store the content in array, and then process it later. But for very long table, it makes this much easier than typing 1000 rows by hand?
 
@Nasser why?
 
@DavidCarlisle I'll look at datatool to see. I just think it is easier for me to separate the content.
 
@Nasser datatool will read in the data from a csv file or inline in the document, which is useful if you have a csv file from excel or something, but I can't see the point of a document structured as you show above, it's just more complicated, more markup and slower
 
@DavidCarlisle There is lot of advantages to separating the data. One can easily change the code that process the data and how the data is typeset using code that process it than if it was hardcoded. But any way, I will look and see. thanks for the reference.
 
in what way is the above simpler, or data more separated than:
\documentclass[12pt,titlepage]{article}
\usepackage{array}


\begin{document}

\begin{tabular}{|*{2}{>{x[}c<{]}|}}\hline
line 1&123\\
line 2&456\\
line 3&789\\
\hline
\end{tabular}
\end{document}
 
10:21 PM
@DavidCarlisle suppose I want to only show rows with certain values? suppose I want to also show the length of the first field in each row? etc.. If I have code the process the data, I can more easily do all of this. This is what I do now in Perl or Python when I generate Latex. It is much more powerful, since the data is separated from the code that generates it.
I could more easily add an IF or an OR to the logic of the code, and run the script again, and get different output generated.
 
@Nasser have I mentioned that datatool does that, you can filter the rows used or just select specific rows or whatever:-)
 
@DavidCarlisle I am looking at it now. It seems too complicated so far :( but will study it more
 
@Nasser just take an example off the site
 
Is there is simple way to just create "variable" in Latex such as this:
\mydata{
{line 1}{123}
{line 2}{456}
{line 3}{789}
}
? datatool seems way too complicated for what I need. I simply want to iterate over some list of lists. But I do not know the syntax if it is possible.
 
218
A: Is it 'OK' to use the root user as a normal user?

David RicherbyUsing your computer logged in as root all the time is like always carrying around all your keys, your passport, $5,000 in cash, that piece of paper with all your passwords written on it and the only photo you have of Flopsy, the adorable rabbit whose death broke your seven-year-old heart. Oh, and...

 
10:40 PM
@Nasser makes no sense, you say you need that because you want to filter/re-order the rows etc. The complication of dataool is that kind of handling. If you just want to iterate over the list it's simpler not to have the list
 
@DavidCarlisle I want to do the iteration myself and the logic to process it myself, like I do now in scripts. I just wanted to know the syntax to how to define/allocate the data itself inside the Latex file. If not possible, no problem, I'll continue to use scripts.
 
@Nasser well if you are doing it yourself then you get to make up the syntax
\def\mydata{
{line 1}{123}
{line 2}{456}
{line 3}{789}
}
@Nasser the above if that's what you want.
 
@DavidCarlisle thanks! that is all what I wanted. I just did not know how to do it as I am not very good in Latex, I use scripts now (Python/Mathematica, etc...) and in those I know how to declare arrays. I'll now try your method there. THanks again
 
@Nasser python and mathematica have arrays, latex doesn't that's the difference
 
Now I just need to learn how to iterate over \mydata in Latex and for this I'll use the \foreach.
 
10:51 PM
\def\foo#1#2{\ifx!#1\else#1&#2\\\expandafter\foo\fi} \begin{tabular}{cc}\expandafter\foo\mydata!!\end{tabular} (untested:-) @Nasser
 
OMG ! Is this latex code you have there??
Ok, I will look at it more :)
 
@Nasser if you don't want to iterate over lists by hand use datatool
 
@DavidCarlisle why not \foreach from pgf? it seems it has nice syntax. I like simple things.
 
@Nasser pgf is 100000 times bigger and more complicated than datatool so I'm not sure I understand your criterion, You'd have to build whatever datastructure pgf uses internally no doubt that's possible but I'm not reading the pgf manual this time of night.
 
@DavidCarlisle I mean like this
\foreach \x in \mydata{} {\x etc...}
I just need to learn how to access the mydata as you have shown, its rows and columns and use \foreach on them. that what I mean.
 
10:58 PM
@Nasser yes but why this fixation on pgf? why not use dataools loops that are designed to fit with tables, or the primitive recursive expansion as above?
 
@DavidCarlisle sure, will look at datatools loops, I just did not see them yet, I just started looking at these things today. The whole point, I'd like to do all this in Latex rather than scripts. This way the data and the code are all in Latex. Better than using Python or Perl to generate the Latex. Coding is easier in Python than in Latex for me. But if I can do the same thing in Latex it will be better.
 

« first day (1697 days earlier)      last day (3237 days later) »