« first day (897 days earlier)      last day (4036 days later) » 
00:00 - 21:0021:00 - 00:00

9:00 PM
@FaheemMitha maybe \thelstlisting ?
 
@user4035 Remember TeX is not a functional language, there is no 'call' or 'return'
 
it says it's the running caption number
 
@user4035 Why can't you just use \int_eval:n directly?
@user4035 Also, note that using ( ... ) is risky
 
What do you mean: (...) is risky?
brackets before function params?
I am so used to C-like languages, who have them
 
@user4035 You are using a delimited argument rather than braces: try something like \sum_elements:nn ( 2 , ( 3 , 4 ) ) and you'll see
 
9:02 PM
@percusse That's the name of the counter?
 
@user4035 Also, that's not :nn, it's :w (non-standard argument form)
 
@JosephWright Actually, I started to experiment with functions to do something complex. For example, process the sequence of sequences
 
@FaheemMitha lstlisting is the LaTeX counter \the<countername> prints it's current value.
 
then I'll need functions, returning a value
 
@percusse Ok, right. Got you. Thanks.
 
9:04 PM
@user4035 I''d say it was wrong rather than risky it completely breaks the syntax \sum_elements:nn should take two n (ie normal) arguments so given \sum_elements:nn(2, 3) the arguments should be ( and 2 the fact that they are not means that the function uses internal syntax so should be :D only used in the kernel.
 
@FaheemMitha No problem.
 
@JosephWright Oh you already said that, I needn't have said it again:-)
 
\cs_new_protected:Npn \sum_elements:nn #1 #2
{
\tl_set:Nx \sum
{
\int_eval:n {#1 + #2}
}
}

\sum_elements:nn 2 3
is it better now?
 
@user4035 much:-)
 
@DavidCarlisle So, there is completely no way to return the values from functions? :(
 
9:08 PM
@user4035 I don't know what you mean by return (or function)
 
@user4035 TeX doesn't return, it expands.
 
@percusse or not in this case as that x hides an \edef.
 
@DavidCarlisle Oh I didn't see you there. I thought I could get away with that :P
 
@user4035 If you evaluate you sum function you get the sum as value, there is no explict "return" statement. basically you should think lisp not C
 
@DavidCarlisle Yes, but lisp doesn't print the value as soon as it evaluates it
tex does
is it possible tell him not to print?
or let me try
:D
 
9:13 PM
@user4035 read eval print loop is the heart of lisp:-)
 
@user4035 Your first version doesn't print anything
\cs_new_protected:Npn \sum_elements:nn #1 #2
{
\tl_set:Nx \sum
{
\int_eval:n {#1 + #2}
}
}
prints nothing at all
 
@DavidCarlisle Sounds like a cheesy Julia Roberts movie :-)
 
@JosephWright This prints 23 for me:

\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\cs_new_protected:Npn \sum_elements:nn #1 #2
{
\tl_set:Nx \sum
{
\int_eval:n {#1 + #2}
}
}

\sum_elements:nn 2 3
\ExplSyntaxOff
\end{document}

And I have no clue, why
 
@percusse that's it: we should commission Ms Roberts to give some introductory L3 videos. Make a change from some smartphone clip of Frank at tug...
 
@DavidCarlisle Hahaha. Fine with me if you really want TeX printing hearts for no good reason in the log file and throwing errors like How can I find the right file?
 
9:19 PM
@user4035 I run your document (after adding \show\sum and get
> \sum=macro:
->5.
l.15 \show\sum

?
(./l32.aux) )
No pages of output.
@user4035 note no pages of output, it just defines sum to be 5
 
@DavidCarlisle plz, give full doc listing, so I could compile it here
 
@user4035 well I copied it from you but...
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\cs_new_protected:Npn \sum_elements:nn #1 #2
{
\tl_set:Nx \sum
{
\int_eval:n {#1 + #2}
}
}

\sum_elements:nn 2 3
\ExplSyntaxOff
\show\sum
\end{document}
 
!!/battle
@PauloCereda Psmith, the TeX bot: The current score is egreg 275 vs. 230 David. So far, egreg is winning.
@egreg, @DavidCarlisle: ^^
 
@DavidCarlisle For me it stops with message
 
@PauloCereda You are walking on thin ice :)
 
9:23 PM
> \sum=macro:
->5.
l.15 \show\sum

?
 
@percusse <3
 
@PauloCereda what score is that or does he just make up the numbers?
@user4035 that's what you intended isn't it?
 
@DavidCarlisle It's your daily reputation. :)
 
@PauloCereda ah that.
 
@DavidCarlisle :)
 
9:24 PM
!!/help
 
@PauloCereda can't you report daily gold badge count instead?
 
@percusse Psmith, the TeX bot: Good night! I'm Psmith, the friendly TeX bot - the p in my name is silent, as in pshrimp. I'm here as a companion to our fellow users in the typographic land. As you probably noticed, I always reply under Paulo's account, but do not despair, I say, my replies are always preceded by my own name. Enjoy your stay at TeX.sx! If you need any help, just ask our chat residents. Cheerio!
 
@DavidCarlisle Ah, yes. I just removed \show, and a correct pdf was generated
 
!!/list
 
@percusse Psmith, the TeX bot: I'm able to recognize the following commands: help, list, cricket, song, fencing, basketball, baseball, ctan, texdef, search, eightball, fortune, battle, reputation, answer, translate, choose. You probably noticed that all commands must start with !!/ followed by the command name, didn't you? Splendid!
 
9:25 PM
@user4035 you shouldn't have got a pdf at all you should have "no pages of output"
 
!!/baseball ?
 
Psmith, the TeX bot, in fixed font mode: Let's take a look at the last baseball results:

- Tampa Bay 2   Boston 3 (FINAL)
- Philadelphia at Cincinnati (7:00 PM ET)
- St. Louis at Pittsburgh (7:05 PM ET)
- Chicago Sox at Toronto (7:07 PM ET)
- Washington at Miami (7:10 PM ET)
- LA Angels at Minnesota (8:10 PM ET)
- NY Mets at Colorado (8:40 PM ET)
- Houston at Oakland (10:05 PM ET)
- San Diego at LA Dodgers (10:10 PM ET)

Our baseball expert Matthew might explain these results later on.
 
@user4035 That's what \show does, hit return and it'll carry on
 
@DavidCarlisle This generates a page with 5:

\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\cs_new_protected:Npn \sum_elements:nn #1 #2
{
\tl_set:Nx \sum
{
\int_eval:n {#1 + #2}
}
}

\sum_elements:nn 2 3
\ExplSyntaxOff
\sum
\end{document}
 
@user4035 Oh OK so no automatic printing then, so I don't understand your comments above.
 
9:27 PM
@DavidCarlisle I didn't use \show macro before
And didn't understand, how it works
for me if the compiler stops with ? message
it means an error :)
 
@user4035 That's what it does. It uses the error mechanism so as always if you hit return it'll carry on, but it shows the definition of the command specified.
 
@user4035 I think this exchange needs a reset :-) Do you want to keep the result of the sum in a variable so that you can use it later? Or do you want to print the result as soon as you perform the computation?
 
!!/battle
@PauloCereda Psmith, the TeX bot: The current score is egreg 275 vs. 245 David. So far, egreg is winning.
ooh David got a few points!
 
@percusse Yes, now I know, how to save the result it a variable, and will do something more complex
 
@user4035 No doubt about that :)
 
9:32 PM
@PauloCereda There's also the "voters" page, now.
 
@egreg ooh you'll reach lockstep! :) @percusse: sir watch out!
 
@PauloCereda resistance is futile.
 
@egreg oops I only get on to page 5, I should vote more...
 
My favorite user :-)
2 questions 185 rep 4000+ votes
great!
or @PauloCereda 's voting machine hmmm.... now it makes sense
 
@DavidCarlisle For me, for instance. ;-)
 
9:43 PM
@percusse o.O
 
@egreg you've got more than enough already
 
!!/battle
@PauloCereda Psmith, the TeX bot: The current score is egreg 275 vs. 245 David. So far, egreg is winning.
 
@DavidCarlisle I vote for your answers, particularly those where I get the green tick.
 
@egreg you wait for me to hit rep cap before voting though.
 
I tried to get the sum of all the elements in a sequence, but it doesn't work
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\cs_new_protected:Npn \sum_elements:nn #1
{
%sum = 0
\tl_set:Nx \sum 0
%add each element of the sequence to \sum
\clist_map_inline:Nn #1
{
\tl_set:Nx \sum \int_eval:n {#1 + \sum}
}
}

\sum_elements:nn {1,2,3}
\ExplSyntaxOff
\sum
\end{document}
 
9:56 PM
Hi Need help , any Q pointers or packages to read ascii math text with headers etc and typeset into tabulars
 
@user4035 Use integer variables:
\RequirePackage{expl3}
\ExplSyntaxOn
\int_new:N \l__egreg_partial_sum_int
\cs_new_protected:Npn \egreg_sum_list:n #1
 {
  \int_zero:N \l__egreg_partial_sum_int
  \clist_map_inline:nn { #1 }
   {
    \int_add:Nn \l__egreg_partial_sum_int { ##1 }
   }
 }

\egreg_sum_list:n { 1, 2, 3 }

\int_show:N \l__egreg_partial_sum_int
 
@egreg You were quicker than me. :(
 
@PauloCereda I'm less quick with Java, I suspect.
 
@egreg Still quicker than me. :)
@egreg: speaking of Java, you could use the BeanShell example we did the other day and have some fun with Java and TeX. :)
 
egreg got there first but
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\cs_new_protected:Npn \sum_elements:n #1
{
\tl_new:N\l_sum_tl
\tl_set:Nn\l_sum_tl{0}
\clist_map_inline:nn{#1}{\tl_set:Nx\l_sum_tl{\int_eval:n{\l_sum_tl+##1}}}
}

\sum_elements:n {1,2,3}
\l_sum_tl
\ExplSyntaxOff

\end{document}
@user4035 ^^
 
10:04 PM
@DavidCarlisle An integer should be stored as an integer. And \tl_new:N should go outside the definition of \sum_elements:n
 
@DavidCarlisle Wow, another L3 code!
 
@egreg I tested both codes
 
@egreg yes I know:-) actually I was looking for the usual constructs like fold so that you could map and accumulate with a single call but didn't see them, I blame @JosephWright
 
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\int_new:N \l__egreg_partial_sum_int
\cs_new_protected:Npn \egreg_sum_list:n #1
{
\int_zero:N \l__egreg_partial_sum_int
\clist_map_inline:nn { #1 }
{
\int_add:Nn \l__egreg_partial_sum_int { ##1 }
}
}

\egreg_sum_list:n { 1, 2, 3 }
\l__egreg_partial_sum_int
\ExplSyntaxOff
\end{document}
I tried yours, but it doesn't print the value of \l__egreg_partial_sum_int
what's wrong?
DavidCarlisles code works
prints 6
 
@user4035 you didn't copy what @egreg used: \int_show:N \l__egreg_partial_sum_int
 
10:07 PM
@user4035 For printing an integer you should use \int_to_arabic:n { \l__egreg_partial_sum_int }
 
@user4035 Did you notice they use different types?
 
@user4035 With \int_show:N the value is printed to the terminal
 
@DavidCarlisle I know, I tried the 1-st version
 
@user4035 as in classic tex syntax if you store 6 in a macro \def\foo{6} you can use it as \foo but if you store it in a register \count@=6 you need to reference the register with \the\count@
 
it worked, printing 6 while compiling
@DavidCarlisle I improved your code a little bit, using int instead of tl:

\cs_new_protected:Npn \sum_elements:n #1
{
\int_new:N \l_sum_tl
\int_zero:N \l_sum_tl
\clist_map_inline:nn{#1}{\tl_set:Nx\l_sum_tl{\int_eval:n{\l_sum_tl+##1}}}
}
 
10:12 PM
@user4035 This is wrong. You're mixing types.
 
@user4035 except you should call the variable l_sum_int not l_sum_tl if it is an int. (Currently the syntax isn't checked mostly but we may have a "lint" mode that checks these things)
 
@DavidCarlisle We need a brother to dandelion. :)
 
@PauloCereda buttercup
 
@DavidCarlisle oooh! :)
 
@user4035 If all you want is to print the sum, then
\documentclass{article}
\RequirePackage{expl3}
\ExplSyntaxOn
\cs_new_protected:Npn \egreg_sum_list:n #1
 {
  \clist_set:Nn \l_tmpa_clist {#1}
  \int_eval:n { \clist_use:Nnnn \l_tmpa_clist { + } { + } { + } }
 }
\begin{document}
\egreg_sum_list:n { 1, 2, 3 }
\end{document}
 
10:14 PM
@DavidCarlisle: ^^
 
@PauloCereda I was thinking more
 
ooh! :)
@David: Frank is gonna kill us with all those fancy names. :)
 
@PauloCereda that being the other thing other than dandelion that grows in my lawn
 
@DavidCarlisle Great! We have a cool excuse to explain the name. :)
 
@egreg This is the 3-rd variant of solution. Tested it, works fine
 
10:18 PM
!!/battle
@PauloCereda Psmith, the TeX bot: The current score is egreg 275 vs. 245 David. So far, egreg is winning.
 
@DavidCarlisle What about this? Names corrected.

\cs_new_protected:Npn \sum_elements:n #1
{
\int_new:N \l_sum_int
\int_zero:N \l_sum_int
\clist_map_inline:nn {#1}
{
\tl_set:Nx \l_sum_int {\int_eval:n{\l_sum_int+##1}}
}
}
 
@PauloCereda Can battle be given an argument for past days?
@user4035 This is still wrong. An integer is not a token list.
 
@egreg Sure! I can improve the version. :)
 
@user4035 as egreg commented originally \int_new:N \l_sum_int should be moved out of teh definition, you don't need to allocate it every time just set it to zero each time
 
@egreg Aha, that's why I can print it without \int_to_arabic:n?
 
10:22 PM
@user4035 You're basically redefining \l_sum_int to be a token list variable after the first cycle. The next call of \sum_elements:n will throw an error.
 
@user4035 oh yes sorry I didn't notice you have allocated an int register butthen over-written it with a macro, like going \newcount\foo \def\foo{..}
 
@patrickvogt: Welcome to the chatroom! And welcome to TeX.sx! :)
 
@DavidCarlisle We got egregs 1-st version redefined:

\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\int_new:N \sum_int
\cs_new_protected:Npn \sum_elements:n #1
{
\int_zero:N \sum_int
\clist_map_inline:nn {#1}
{
\int_set:Nn \sum_int {\int_eval:n{\sum_int + ##1}}
}
}

\sum_elements:n {1,2,3}
\int_to_arabic:n {\sum_int}
\ExplSyntaxOff
\end{document}
Why can't this chat keep the tabs in the code?
 
We really
    don't know
        why. :)
 
@user4035 because tabs in code are evil and should be removed whenever encountered:-)
 
10:25 PM
@DavidCarlisle :retab
 
@PauloCereda rehab?
 
\cs_new_protected:Npn \sum_elements:n #1
{
:retab\int_zero:N \sum_int
:retab\clist_map_inline:nn {#1}
:retab{
:retab:retab\int_set:Nn \sum_int {\int_eval:n{\sum_int + ##1}}
:retab}
}
 
@user4035 just think all that, and you could have done:
 
@user4035 If you want to print the value after computing it, just move \int_to_arabic:n { \sum_int } in the body of the definition. But it should be \l_sum_int: a variable should be prefixed by l or g denoting if it's acted on locally or globally.
 
6 \bye
 
10:26 PM
@DavidCarlisle Vim command. :) They tried to make me go to rehab but I said 'no, no, no'. :)
 
I did something wrong
 
@user4035 I was teasing David, :retab is a Vim command. :)
 
@PauloCereda they should send all vim users
 
@PauloCereda I am using Emacs :P
 
@user4035 Don't talk to me anymore. <3
 
10:27 PM
@PauloCereda How did you put the tabs in your message?
 
Nah, I'm OK. :) David is trying to convince me to change my $EDITOR. :)
 
@user4035 And saying \int_set:Nn \sum_int {\int_eval:n{\sum_int + ##1}} is just a complicated way to say \int_add:Nn \sum_int { ##1 }
 
@user4035 They aren't tabs, they are spaces. Tabs don't work in the chatroom. Try pasting the code and then click in the Fixed font button. :)
 
ok
 
For one minute I thought Patrick Volkerding joined TeX.sx. :)
 
10:29 PM
@user4035 or better post code to the main site and keep the chatroom for fencing news
!!/fencing
 
Psmith, the TeX bot, in fixed font mode: Let's take a look at the last fencing results:

- Oh dear, nothing happened so far.

Our fencing expert Alan might explain these results later on.
 
!!/cricket
 
Psmith, the TeX bot, in fixed font mode: Let's take a look at the last cricket results:

- Habib Bank Limited v Sui Northern Gas Pipelines Limited
- Kings XI Punjab v Kolkata Knight Riders
- Royal Challengers Bangalore v Delhi Daredevils

Our cricket expert David might explain these results later on.
 
@PauloCereda oh no is that the old fencing feed or has the new one given up as well?
 
@DavidCarlisle The old one. :) I was testing the new XML based configuration. I'll replace it. :)
 
10:30 PM
@PauloCereda never trust an xml configuration
 
@egregs We got the best version:

    \int_new:N \sum_int

    \cs_new_protected:Npn \sum_elements:n #1
    {
       \int_zero:N \sum_int
       \clist_map_inline:nn {#1}
       {
          \int_add:Nn \sum_int { ##1 }
       }
    }
 
!!/fencing
Psmith, the TeX bot, in fixed font mode: Let's take a look at the last fencing results:

- Oh dear, nothing happened so far.

Our fencing expert Alan might explain these results later on.
 
@PauloCereda much better:-)
 
@user4035 Which is the first I suggested. ;-)
 
@DavidCarlisle LOL cache stuff. :)
 
10:32 PM
@egreg yes
 
!!/choose expl3, emacs lisp, lua, apl
 
!!/fencing
Psmith, the TeX bot, in fixed font mode: Let's take a look at the last fencing results:

- MARS Milk Fund
- MESSAGE FROM CHAIR
- Cadet & Junior World Champs Report - Day 9
- Cadet & Junior World Champs Report - Day 8
- Cadet & Junior World Champs Report - Day 7
- Cadet & Junior World Champs Report - Day 6
- Cadet & Junior World Champs Report - Day 5
- SOUTH EAST REGION LIAISON OFFICER (RLO)
- CADET AND JUNIOR WORLD CHAMPS REPORT - DAY 4
- CADET & JUNIOR WORLD CHAMPS REPORT - DAY 2
- 2013 BYC - PROVISIONAL LISTS OF QUALIFIERS
@DavidCarlisle Sorry, I restarted the bot. :)
@DavidCarlisle Psmith, the TeX bot: The great oracle says: apl
ooh APL!
Isn't the one that you can use any symbol to denote a relation?
 
Yeh (using APL in the day job this morning:-)
 
@DavidCarlisle You mean it?!
Sir, you are awesome.
Unicode heaven.
 
Sometimes the radio is annoying: first Dvoƙák's "New World" symphony (a brick), now Wagner's Sigfried's Idyll (a waste).
 
10:38 PM
@PauloCereda as in you have no chance but to copy examples from the doc as not only do you not know what the syntax means you have no idea how to type it.
 
I think we can close this one
2
Q: Does argument passing in latex change the encoding?

Mukund MuralikrishnanI'am using the graphdrawing library provided in the pgf/tikz package for lualatex. I have this new command defined \newcommand{\drawNewFrame}[1]{ \begin{tikzpicture} \tikz[baseline=1pt] \graph [LinkedList={radius=1cm,type=3},nodes{draw,circle}] { #1 ...

as TL
I have the CVS version it still doesn't work
 
@egreg oh. :(
@percusse: online mode, sir. :)
 
@PauloCereda Next Dittersdorf and Rameau. :)
 
@egreg :)
 
@PauloCereda still can't login
 
10:50 PM
@percusse can we read any custom headers with \pgfplotstabletypeset
found suitable for http://chat.stackexchange.com/transcript/message/8994738#8994738 but only issue was my data runs in single columns instead of rows and columns
 
@percusse :(
 
@texenthusiast There are some options but I don't know your use case. Is it in a separate data file?
 
11:08 PM
@percusse i am just trying to read the gnuplot set table output # Curve 0 of 1, 50 points
# Curve title: "sin(x)"
# x y type
0.00000 0.00000 i
0.03206 0.00056 i
0.06411 0.00112 i
0.09617 0.00168 i

# Curve 1 of 3, 50 points
# Curve title: "cos(x)"
# x y type
0.00000 1.00000 i
0.03206 1.00000 i
0.06411 1.00000 i
0.09617 1.00000 i

# Curve 2 of 3, 50 points
# Curve title: "tan(x)"
# x y type
0.00000 0.00000 i
0.03206 0.00056 i
0.06411 0.00112 i
 
@texenthusiast Complex numbers probably needs siunitx and S columns. But what should the headers and columns be?
 
@percusse it's not complex number is i implies active points on the plot. these are three sets of data , i will post on main site in few min
 
@texenthusiast Oh I don't know gnuplot output format then.
 
@percusse what's the fscanf equivalent in TeX to read ascii any idea ?
 
@texenthusiast \def
 
11:19 PM
@DavidCarlisle thanks
 
@texenthusiast if \foo is 0.00000 0.00000 i then \def\foobar#1 #2 i{\def\a{#1}\def\b{#2}} \expandafter\foobar\foo parses \foo and defines \a and \b to be the two numbers
 
@DavidCarlisle Wow ok.
 
@texenthusiast of course pgfplotsthingy may have a more pgf interface to that but that's what it'll be doing really, everything in tex comes down to \def and \expandafter in the end;-)
 
11:38 PM
@PauloCereda How come I've more votes than you for the month? :) tex.stackexchange.com/users?tab=voters
 
@egreg I suspect the voting algorithm marked some of my votes invalid. :)
I need to be more careful, apparently. :)
 
11:57 PM
Could you explain what \rlap is and how it works in the following example (Peter Grill's answer)?
\documentclass[twocolumn]{article}
\usepackage[a4paper,margin=1cm]{geometry}
\usepackage{amsmath}
\begin{document}
\begin{enumerate}
    \item The degree of (C) is 3.
    \item The degree of (A) is 1.
    \item%
    $\!
    \begin{alignedat}[t]{4}
      -3x(x+1)&-2x(x-1)\\
              &+4(x^2-3x-1)
                  &&=\rlap{$-3x^2-3x-2x^2+2x+v$} \\
              &   &&\hphantom{{}={}}{+}4x^2&&-12x-4\\
              &   &&=-3x^2 &&-3x-2x^2+2x+v \\
              &   &&       &&+4x^2-12x-4 \\
              &   &&=\rlap{$-x^2-13x-4$}
 
00:00 - 21:0021:00 - 00:00

« first day (897 days earlier)      last day (4036 days later) »