1:10 AM
@Skillmon No problem! It's a really nice trick you did there, so I thought I would force more people into looking at it before it gets lost in the sea of posts in the site :-)

7 hours later…
8:12 AM
@UlrikeFischer @DavidCarlisle It occurred to me that the better (more robust) way to create tex code from inside lua may be to print from lua with catcode other, then pass the result through \scantokens on the tex side.
@DavidCarlisle Done!
4
I know, I know … comma! Nothing that can't be fixed with the inspector inside the browser. One can create totally bogus palindromes that way too, of course, but that would be unethical.
@DavidCarlisle I gave the green tick back. I've had my five minutes of palidromical bliss!

8:32 AM
@HaraldHanche-Olsen yay!

@PauloCereda :) Most of that reputation was earned long ago. I haven't managed to spend much time on the main site in recent years.

@HaraldHanche-Olsen mine too. :) I don't answer too much questions anymore...

9:01 AM
@HaraldHanche-Olsen scantokens is such a kludge luatex's scantextokens is a bit better but it shouldn't be needed as if you set up a catcode table with whatever catcode regime you were going to scan with, you should be able to print with the right catcodes.
@HaraldHanche-Olsen :-)

9:12 AM
So UK general election tomorrow?

@FaheemMitha yes

@DavidCarlisle sorry, I already added an answer to tex.stackexchange.com/questions/520045/effect-of-in-macros/…. Also you got a typo in your comment (' instead of @)
How can I loose exactly 1 reputation point? I'd have 30503 reputation if it was possible...

@Skillmon doesn't matter anyway the OP probably prefers an answer specific to theer case, I put in alink to tex.stackexchange.com/questions/8351/… but actually there is a better duplicate question more or less "what is @" somewhere but I couldn't find it. (I don't really like marking duplicates to questions that ask about the answer (\makeatletter rather than the question "what is @ doing" although that seems to be common practice)

@DavidCarlisle yes, marking as duplicate to the question "what is \makeatletter?" does give the desired answer if one understands it and transfers to ones own problem, but isn't a perfect fit, indeed.

@Skillmon downvote one of @egreg's answers

9:26 AM
@DavidCarlisle does downvoting cost reputation? I'm sure I downvoted some questions in the past and it didn't cost me anything.
@DavidCarlisle or is this true only for downvoting answers?

@DavidCarlisle Yes, but it seems there is just no way for tex.print to create short (non-letter) command names.

@DavidCarlisle great, now campa found the duplicates but multiple of them, which one do we choose?

@DavidCarlisle The difference between the pdftex and luatex \scantokens being the end-of-file token? Anything else?

@Skillmon doesn't really matter:-)
@HaraldHanche-Olsen luatex kept scantokens the same but addded scantextokens but yes that's the only difference.
@HaraldHanche-Olsen oh you get that with tex.print as well as the token library? really? that's bad I'll test later.

@DavidCarlisle Er, wait, I misspoke. Or mistyped. I meant token.set_macro. Haven't got my brain working yet, slept late.

9:34 AM
@HaraldHanche-Olsen Luigi suggested to me to use \csname/\endcsname and this here gives a newline:
\begin{filecontents}[noheader]{luatest.lua}
token.set_macro("foo","\\csname\\@backslashchar\\endcsname")
\end{filecontents}
\documentclass{article}

\begin{document}
\makeatletter % because of the @ in \@backslashchar
\directlua{require"luatest"}
\makeatother
\show\foo
abc \foo abc
\end{document}

@UlrikeFischer Yes, that is a good workaround. Except in my case, where other code is scanning for literal \\  tokens. But that could be solved with an \edef.

@HaraldHanche-Olsen Oh that's Ok then so you can use tex.print with a known catcode table

0

I am reading the cash flow statement from the annual report of Almarai for FY 2018. There if I add the total outflows and inflows I get a figure of 22,47,411,000 but in the annual report it says 35,57,726,000 FY 2018. What am I missing here? I got the annual report from here: https://www.almar...

@Rohan er that isn't about tex or cricket, did you mean to post it here?

I just need help
So confused with this

9:47 AM
@Rohan I think you need to stay more or less on topic if asking questions, even in chat.

Room title says "... and Friends". You are my friend.
And friends help each other

@Rohan er no, the "friends" there refers to related programs like bibtex and makeindex

ohh
So you are not my friend?
:(

@Rohan no really you should not do this. we all have issues unrelated to tex that we need to solve in other aspects of life but this is not a general help forum it's a tex related site.

@Rohan Also, you already asked the question in what I suppose is the right place. Only 11 minutes ago! Give the people there time to respond.

9:52 AM
:52870903 What? (I removed my post since @HaraldHanche-Olsen essentially said the same.)

Is it known that zref-abspage is one page off? I just tried and it is 0 on the first page for me...

@DavidCarlisle Oh right, I had forgotten about \scantextokens. Leaky brain syndrome.

@Skillmon I get 1:
\documentclass{article}
\usepackage{zref-abspage,zref-user}
\begin{document}
\pagenumbering{roman}
\zlabel{test}
\zref[abspage]{test}
\zref[page]{test}
\end{document}

@UlrikeFischer I don't mean with the \zref mechanism but with direct access to the counter \arabic{abspage} gives 0 on the first page.

@Skillmon ah, yes, that is to be expected. The counter is advanced at shipout.

9:59 AM
@UlrikeFischer yes, and initialized as 0 not as 1, so that it is one off on every page...
@UlrikeFischer that's counter-intuitive if one does \newcommand*\cleartoevenpage{\clearpage\if@twoside\ifodd\c@abspage\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}.

@Skillmon but it's like accessing the standard page counter that way, it's user error.

@DavidCarlisle no, it's not. At the same time \c@page is 2 while \c@abspage is 1.

@Skillmon well after clearpage I suppose it's safe enough but in general accessing the page counter in the page body will give variable results.

@DavidCarlisle I know that, that's why I only use it after \clearpage where it should be just as safe as the usage in \cleardoublepage.

@Skillmon yes I know you know, I'm just stating the party line:-) but anyway as of last week zref has its own github issue tracker you could send an inaugural issue:-)

10:04 AM
@DavidCarlisle and if I add a new counter that is initialized as 1 (just as \c@page) I get correct results. So I'd say this is a bug in zref-abspage.

@Skillmon blame @UlrikeFischer: she's in the Oberdiek Package Support Group.

@DavidCarlisle If you were so kind to point me to that issue tracker? :)

@Skillmon actually it would be issue 2 (1 was transferred in already) github.com/ho-tex/zref/issues

@Skillmon ? new counters are normally zero.

@UlrikeFischer yes, but take a look at \showthe\c@page in the preamble.
@UlrikeFischer \c@page is odd on odd pages and even on even ones (after \clearpage), but \c@abspage is odd on even pages and even on odd ones.

10:10 AM
@Skillmon that's because latex sets it to 1 in the format. And abspage is not really meant for even / odd. What will you do if page=even (and so the layout) and abspage=odd?

@UlrikeFischer say that's user error, because someone messed with the page counter.

@Skillmon then if they should always be in sync why can't you use \c@page in your test? Why are you using abspage at all?

@UlrikeFischer the problem is that the documentation says there is an "abspage counter with absolute page numbers provided" but in reality it isn't.
@UlrikeFischer because I did. That's why. Even if it's unnecessary, it still showed a bug.

@UlrikeFischer I must say I'm inclined to agree with @Skillmon that starting from 1 would be more sensible, not sure if it can be changed though, it would affect documents in somewhat unknown ways, depending on what they are doing with the counter.

@DavidCarlisle if you don't change it, at least change the documentation to state that it is off by one.

10:22 AM
@Skillmon nobody reads the documentation

@DavidCarlisle when and how does tex advance the page counter?

@DavidCarlisle I do. And if one doesn't read the documentation one doesn't know that there is a counter abspage in use. Also if this is stated in the documentation you can tell future naggers that this is stated in the documentation.

@UlrikeFischer \c@page=1 in the format and  \stepcounter{page}% in \@outputpage in the output routine

How do I get e-TeX in luatex -ini? The -etex switch doesn't seem to work...

10:38 AM
@DavidCarlisle well, it is on the agenda to have an abspage counter in the format. So it could be done similar. I considered to advance the zref-counter at the end of the shipout, but I'm not sure if we can do it. pdf starts the page index by 0 and it could be that someone uses it this way. (perhaps we should have two counters "pdfabspage" and "texabspage".) @Skillmon

@PhelypeOleinik it's always there (or not there depending on your point of view) you need tex.enableprimitives... to expose the commands
@UlrikeFischer the public view of the absolute page count in pdf viewers and print drivers etc is always 1-based though

@DavidCarlisle this is called the page label, the page index (e.g. in number trees) starts with 0. And it is a pain - in tagpdf I was in various place one off. So I quite understand @Skillmon's feelings ;-)

10:55 AM
@DavidCarlisle Ah, that's it, thanks! The manual just says that the -etex switch isn't needed anymore, but nothing (near that part) about tex.enableprimitives. I should've known reading it would be a bad idea ;-)

@UlrikeFischer my day job mostly consists of mapping between c and fortran or c# and fortran or python and fortran or ... and that mostly consists of mapping between 0-based array indices and 1-based ones, I know about adding and subtracting 1:-)

@DavidCarlisle people should stop this quarrel and use 0.5 as a compromise solution.

@PauloCereda or work modulo 1 so 1 and 0 are equal

@DavidCarlisle :D

@DavidCarlisle and I found an answer where I used the abspage counter: tex.stackexchange.com/a/486164/2388 (and added 1). I think we should leave it alone, and simply document it for the small set of people who read documentations.

11:31 AM
@DavidCarlisle you could do it like one of my professor, he starts every array in every programming language at 1, allocating extra space in languages which would otherwise start by 0.

11:41 AM
@Skillmon that doesn't really work in a math library where the end users are passing in their arrays:-) (not to mention that if you have a 5 by million array declaring it as 6 by a million just to avoid subtracting 1 is a bit costly

12:32 PM
@DavidCarlisle don't tell me, tell my professor. But make sure to address him correctly or else he'll just throw your message away. He's really cocky.

1:08 PM
Dijkstra on numbering from zero – I find this persuasive.

1:21 PM
@HaraldHanche-Olsen If you read Swedish you might enjoy to read this text on this question.

@David Purton I am unfamiliar with shell scripts, could you tell me how I should use your script? tex.stackexchange.com/questions/504201/…

1:48 PM
hmm, that was new. Two Mac users came by with a strange problem. Turns out that with a Mac keyboard with active keys (Danish Mac layout), if you want a ^, and you press ^ (which is an active char) so listens for the next char, and you then press the arrow keys, you end up with ^ and some invisible low number control seq that latex does not understand.
I'd always used ^ + space on those keyboard, so this was new.

@mickep Thanks! Interesting reading.

@Raaja Are you on Windows? Then you could install Cygwin (cygwin.org), copy the script into a file, make it executable (chmod 755 myscript.sh) and run it on the command line (./myscript.sh myMultiPage.pdf).

@Raaja that pings me not David Purton, @ pings only work on pages where the person has been, leave a comment under the question, but if you are on windows you may not have a shell installed but you could easily write a .bat file to do teh same it is just listing the commands to execute
@AlexG yes but that's a lot of work just to execute half a dozen commands in sequence...
@HaraldHanche-Olsen I don't:-)

@daleif That's odd. I certainly don't get that with the Norwegian layout, and if I switch to Danish, I can't reproduce it either. Maybe it depends on the editor in use?
@DavidCarlisle No wonder, if your livelihood depends on there being different conventions. ;->
@DavidCarlisle worse, that scripts actually executes one command – the rest of the script is just building the command line. @AlexG

2:06 PM
@HaraldHanche-Olsen it's mainly a documentation issue almost all math things are 1-based, it is so much more natural to say that the ith element of an array is the coefficient of the ith term in a sequence or the value of the ith derivative or whatever else is being computed. Nobody calls the leftmost column of a matrix the 0th column.

@HaraldHanche-Olsen I quite agree with David. While I know the mathematical background why natural numbers should start at zero, for an index it is simply confusing. If I want to address the first n elements, I don't want have to write s[0] ... s[n-1].

4
For those who are curious, these are my new Enten. :)
It's an Entenkrippe!
Oh boy, German is so awesome! I can make up words and they work! :)

@DavidCarlisle @UlrikeFischer You can't avoid such confusion anyhow, to some extent, at least when you work with polynomials and more generally, power series: They naturally(!) start with a zeroth term (the constant term). I agree that the interpretation of first, second, third, etc gets tricky with zero based counting, though.

@UlrikeFischer or the storage layout of a banded 2 dimensional array in row major order with 0 based index: nag.co.uk/numeric/nl/nagdoc_27/clhtml/f04/f04bbc.html#ab

@DavidCarlisle The ith derivative is not a good example. There is no doubt what that means, no matter where you start counting. The zeroth derivative is the original function.

2:13 PM
@AlexG thanks I shall try that right away
@DavidCarlisle ok that was unintentional ;) but thanks for the guidance. I shall play with it as @AlexG proposed.

@HaraldHanche-Olsen yes but typically the original os stored elsewhere and the matrix has the value of the 1st derivative in the first element and the value of the second derivative in the second element but saying that in 0 based languages is harder than in 1 based ones
@Raaja basically if the name isn't in the pop up that appears when you type @ then the ping will not work.

@DavidCarlisle Huhh ok, I usually read the name and directly type it (I, so far, have never waited for it ;))

Oh goodness, winter hats started and I managed to get a hat even before clicking I hat hats :(

@yo' Thanks for the warning. I have taken evasive action.

@Raaja note that proposal above is equivalent to saying that you could cross the road by building a private jet and flying 99.99% round the world and land on the other side. It may work but may not be the simplest way.

2:18 PM
@AlexG and yes I am on windows

@HaraldHanche-Olsen fortnuately, this hat wasn't at TeX.SE!

@DavidCarlisle ok clear.

@yo' Oh right, I have to hate hats in every site! No wait, it seems to be a global setting. I'm good, then.

@Raaja Note that without modifying the script, you would have to also install ImageMagick in Cygwin to have it in the right place (/usr/bin/convert).

@HaraldHanche-Olsen Seems edit related. They were using texstudio. In mac I've seen the two ways to get ~ on a DK mac keyboard give either both ascii tilde or one ascii tilde and the other some unicode similar to \sim.

2:21 PM
Huhh ok, seems to get very complicated (in my head), may be I should just stick to the usual command line scripts.

@Raaja The original Bash script could certainly be converted into a BAT script with the same functionality. Then you can just drag and drop a PDF on it in the file explorer.

@AlexG I think I really need to play with it before understanding your message in detail.

@HaraldHanche-Olsen yep, it's global

@Raaja BAT files are the MS-Dos equivalent of Unix shell scripts. What do you need the Gif for? In case you want to embed it into a Web Page of your own, you could easily produce SVG (animations) instead of PDF and embed these. SVG is much superior than GIF. (SVG is vector graphics and thus freely scalable.)

@UlrikeFischer and today's new git idiom is: git log $(git describe --tags --abbrev=0)..HEAD --oneline 2:38 PM @AlexG just tweaked that particular file to make it work with your suggestions. However, instead of cygwin, I used gitbash ;) which apparently supported chmod 755 x @AlexG thanks @DavidCarlisle ? my git foo sticks to simple commands and "ask Joseph" for the rest. @UlrikeFischer it tells you everything that has been committed since the last tag (ie, is it time to package a ctan release yet) if I run it over all the ho-tex ones I get ### accsupp db65c9a quote - to Lua pattern for [-/] in auto tag function ### alphalph ### askinclude ### atbegshi 4a13ed6 quote - to Lua pattern for [-/] in auto tag function ### atenddvi 129eca2 quote - to Lua pattern for [-/] in auto tag function ### attachfile2 02f0f57 drop character tables 7c859b0 embedfile reference update f47fe01 tds ### atveryend 4e02efe quote - to Lua pattern for [-/] in auto tag function ### bitset ### bookmark 3844659 quote - to Lua pattern for [-/] in auto tag function @DavidCarlisle nice I should have an alias for this. @UlrikeFischer I had a script that report the git status of each and I just added that, it looks like the following if you have bash.... for i in */.git do # status (cd${i/.git}; echo -e "### ${i/\/.git}"; git status --short ) # changes since last tag (cd${i/.git}; git log $(git describe --tags --abbrev=0)..HEAD --oneline ) done @DavidCarlisle You were right. This seems to be the first problem: LaTeX Font Warning: Font shape TU/lmss/m/sc' in size <12> not available Which font is that? If I understand my log correctly its loaded by amsfonts 2:52 PM @DavidCarlisle how is your folder structure here and where do you start the script? @DavidCarlisle It disappears if I remove \renewcommand{\familydefault}{\sfdefault} \normalfont But I don't really get while trying to access default fonts would require T1 encoding... @DavidCarlisle, @egreg, @UlrikeFischer Progress on 'UnicodeMath': I can get the various font changes working, including \text... as well as \math.../\sym... (that one 'interesting'); next is sub/superscript, then (finally) operators. Think I can do the same as latex2unicode.herokuapp.com @PaulPaulsen such a warning is normally harmless. And sorry it is quite unclear what your problem is - you even didn't say what exactly "broke" when you removed fontenc. Try to make a complete document that can be compiled and used for tests. @Sigur -- (I know I'm late to this discussion.) It's seriously discouraged to use author-defined macros in titles, abstracts, bibliographies, anything that might be spun off automatically to an indexing service. The author's definitions will not accompany this bibliographical information, so you're guaranteeing an error in any future citations. 3 @DavidCarlisle and @JosephWright -- Please see my previous comment on using author-supplied macros in titles. 3:13 PM @UlrikeFischer I am sorry. I thought I might get away without trying to boil down the template I want to use to a MWE, hoping that my problem would be a standard case. But then I will try to track it down further. Thanks to everybody who looked into my question! @barbarabeeton and while you're at it, the same goes for \cite in abstracts (for basically the same reason: the definition can be separated from the application) @yo' -- Good point. There's a distinct disconnect between what can be done and what should be done. 3:29 PM @Raaja Ah, very smart ;) @barbarabeeton yeah. And I forgot that some people know to add other internal references in Abstract, which is equally non-sense. (like "(see Theorem 4.2)") 3:50 PM @yo', good point. @barbarabeeton, thanks for coming to discussion. I fully agree with your comments. yeah, the metadata (including the abstract) should be completely separable from the article. In my own work, I even manually expand all math macros in the abstract (i.e., chanigin \bZ to \mathbb{Z}), just in case. @barbarabeeton, I'm not producing a paper, it is only a small text that I'm writing and amsart layout is pretty nice for that. So, I discovered that behaviour and I was wondering why that happens. @barbarabeeton, @yo', I am happy that the discussion pops up a lot of good and relevant observations. @PauloCereda This time you were lucky, indeed. ;-) @Sigur -- What I was describing is part of the production flow at AMS. If an article submission comes in with author macros or "internal" cross references in any of the metadata, instructions are given by the production editor for the "cleanup" to expand the problem coding. But of course, something could be missed, or an update could be made incorrectly, resulting in nonsense. This benefits nobody, and the author should really be responsible for accuracy. </rant> @barbarabeeton, I have a published paper with$ in metadata. It is strange when I import it from DOI.
But it was not an AMS journal.

4:03 PM
@Sigur -- Another thing that happens too often is that an author redefines a core command (using \def rather than \newcommand). Another source of errors in making (unnecessary) corrections. I wish a better instructional system existed.

@barbarabeeton, I remember a long time ago during a conference (I was helping with computers and projectors and so on) and a participant came to me and asked me to help him to fix his file because he was not able to produce correctly the output of \c c, that is, ç. The problem: he defined and used in the whole text \c as macro for \mathbb{C}. Can you imagine what happens...

@Sigur -- I don't even have to imagine; I've seen it firsthand. Another favorite is redefining \i; the effect on transliterations of Russian names is appalling. The bibliography is usually where the "unexpected" breaks loose in earnest.

@barbarabeeton, I always say to my students: everyday I learn something new in LaTeX... I never stop studding it.

4:22 PM
@Sigur -- Good for you. And I'm sure you are careful to teach your students the correct (i.e. most reliable) way to do something when you are asked. Just out of curiosity, how do your students learn LaTeX? Is there a formal class, or are they expected to pick it up on their own?

@barbarabeeton, every semester we offer an introductory course to them. We offer 20 places (this is the number of computers we have in our laboratory) and we teach (usually students from first year of undergraduate) how to install it, and how to create some basic documents. Then, they can practice to produce their report.
@barbarabeeton For example, if they have to solve some exercises I ask them to type solution in LaTeX. Of course, they do a lot of mistakes specially because they search on Internet how to type something and they find almost everything... bad and good
But, in resume, I try to read the source to explain that how to have a better layout.

@UlrikeFischer I have a ho-tex directory and each of the repositories are cloned as siblings of each other inside that.
@PaulPaulsen saying "it disappears" without saying what it was doesn't allow anyone to debug anything.

@DavidCarlisle so for example ho-tex/zref/.git?

@UlrikeFischer yes the .git is always there in in any git checkout I just use that to find any subdirectory that is a git repository and ignore any local ones that are not.

@DavidCarlisle did you break etexcmds? ;-)

4:38 PM
@UlrikeFischer No but I think I plan to stop it being used by any of the others.

@DavidCarlisle I was referring to the standard "miktex ..." question ;-) Do you know if etexcmds still needed anywhere in latex? Is any of the possibly clashing context files in use?

@UlrikeFischer I don't think core latex packages should rename etex primitives just in case they need to work in context as that is increasingly unlikely anyway and any document combining such things must know what it is doing and arrange local definitions so things work
@UlrikeFischer if I pull out kvsetkeys and kvdefinekeys make them not use etexcmds at all and not use infwarerr if used in latex then hyperref will have no dependencies on oberdiek and only a few more or less reasonable dependencies on specific ho-tex packages.

@DavidCarlisle I wasn't thinking about packages like pgf which try to work in both worlds, but about files like supp-pdf.mkii.

5:02 PM
@UlrikeFischer I think that's OK (I'll check) but pdftex.def already has to locally take care of catcodes of _ etc for that so if has to locally fix up \protected at the same time it is better to do it there than make every other package avoid the name)

@DavidCarlisle I don't think that supp-pdf.mkii directly can be a problem, we probably would have heard already if there is a clash. I was more wondering if other context files are used somewhere in a similar way. The etexcmds docu mentions m-ch-de which does redefine \expanded.

5:18 PM
@UlrikeFischer if we take the view that latex is based on etex+pdftex primitives+, then a package that redefines \expanded should be treated like one that redefines \def, and asked to change, better to get one or two packages fixed than have to avoid primitive names forever.

@DavidCarlisle yes, good plan ;-)

@UlrikeFischer oh I just looked at the main site....
@UlrikeFischer odd that it shows up in etexcmds I'd expect problems with ones that are split out not with ones that are still in the main bundle

@DavidCarlisle in the question an old iftex is loaded, probably it would break with any package doing \usepackage{ifluatex} or so.

@UlrikeFischer oh, I see it's picking up an old iftex (in more recent cases I have added a [2019/...] guard so you get a warning about that but I think the original ones I just did \RequirePackage{iftex}`

5:47 PM
@MarcelKrüger did you see the Kashida question?

6:02 PM
3
@JosephWright ^^^^ an expandable duck created from a well-known tikz expert ;-)

@UlrikeFischer QUAAAAAAAAAAAAAACK

@UlrikeFischer -- That looks like a duck emulation of a war canoe,
2

6:44 PM
@JosephWright @barbarabeeton Source is now here tex.stackexchange.com/a/520103/2388

6:56 PM
@UlrikeFischer Yes... we could implement them as special kind of glue, but it would need very font specific code and I don't think that they are actually supposed to behave that way.

@MarcelKrüger the /ActualText for the search is perhaps something than can be done in luaotfload. But I'm not sure about the kashida itself. If I got the wikipedia explanation right, there is only one per line. This doesn't sound like a font feature but like something that should be done as David suggested in the post linebreak callback, and so probably by babel or some other package.

7:16 PM
@UlrikeFischer I don't think it's just one per line is it? (But we should check with Khaled...)

@DavidCarlisle your wikipedia link said "Kasheeda generally only appears in one word per line, and one letter per word."

7:33 PM
@UlrikeFischer you obviously read more of the words than I did:-)

7:51 PM
@DavidCarlisle ;-).

@DavidCarlisle More GitHub repos I see

3 hours later…
11:18 PM
Good luck to our English friends tomorrow.
@UlrikeFischer ooh
@barbarabeeton:@Sigur and I live 50km from each other and not even a coffee could be yet arranged... :(