« first day (3836 days earlier)      last day (1100 days later) » 

7:31 AM
Hello to all,
Do you know if there is a package that allows you to align and number a series of calculations in a simple and user-friendly way?
0
Q: Is there a package that can automatically align and number a series of calculations?

AndréCThis is what I am currently doing with the alignat environment of the amsmath package. But I find the syntax heavy and not very user-friendly. I would like the numbering to be automatic a) ... b) ... c) on each line and that the spacing between the columns is easy to configure. Is there a package...

 
8:09 AM
@JosephWright Is it possible to set table-columns as a synonym of columns? See here: tex.meta.stackexchange.com/questions/8766/two-columns-meanings/…
 
 
1 hour later…
9:14 AM
@DavidCarlisle why did you delete your answer?
 
@UlrikeFischer I left a comment under the question
 
@DavidCarlisle I agree.
 
9:43 AM
Maple generates Latex like this   \text{``$-$"}   and  \left(``1"\right)  and \text{``atomic"}  and \text{``$\mathcal\{L\}$"}

Are these valid?   The problem, I am not able to write this latex string to sqlite3 database, due to having "  inside a string quoted longer string.

I can ask at Maple forum, but wanted to check first if this is valid latex. I have not seen " used like this before in Latex.
 
@Nasser if this should give quotes, it should use '' (two single quotes) and not " which will e.g. explode if you load the german language.
 
Well, they all compile OK. So I guess, I need to change the way I write this Latex to sqlite3 database then. Now I put a " on each side of the Latex to write it, but having " inside is causing the database to complain. I'll try to use single quote now instead and see. if not, will try two single quotes.

In earlier version of Maple, it did not do this, so this is using the latest Maple version, where lots of changes were made to its Latex conversion program.
 
@Nasser almost certainly it isn't valid. with \text it will probably work but is wrong, but your middle case with \left must be in math mode and there what on earth is it trying to do with quotes in math mode????
 
9:58 AM
@Nasser why don't you want to complain at maple? Do you think code that errors if used by a german is okay?
 
@Nasser are you asking for quotes or is maple adding them itself, why do you ever want a minus sign in quotes?
 
The latex generated compiled OK using lualatex. But I also save it to a database (sqlite3). Currently I save it as string, like this

"latex generated by Maple goes here"

I changed it to

'latex generated by Maple'

and now sqlite3 did not give an error. So I have nothing to complain about now. May be the quality of the Latex is not the best, but this is different issue.
Earlier version of Maple did not generate these, i.e. no `` and " inside the latex, so that is why this is first time I see this error writing to the database.
fyi, here is screen shot showing the math, and the Latex generated.
I do not know how to put better resolution image there.
@DavidCarlisle Yes. this is all in Math mode. i.e. the Latex generated is for math expressions and all of it is meant to go inside "\[ \]" later on.
 
10:29 AM
@Nasser but you didn't answer the question. are you trying to write a minus sign - and the quotes are intended to be part of a pargramming language string delimiter to hold the latex expression. or are you trying to write a minus sign in quotes "-" ?
 
@DavidCarlisle first of all, it is not me who it writing the latex. It is Maple :)

I simply ask Maple to convert its solution to latex. Here is the math
And here is what Maple generated for the Latex.

u left(r , t\right) = mathit{Typesetting}mcoloneq mathit{msup}left(mathit{Typesetting}mcoloneq mathit{mi}left(\text{``$mathcal{L}$\"}\right), mathit{Typesetting}mcoloneq mathit{mrow}left(mathit{Typesetting}mcoloneq mathit{mo}left(\text{``$-$\"}\right), mathit{Typesetting}mcoloneq mathit{mn}left(``1\"\right)\right), mathit{Typesetting}mcoloneq mathit{msemantics}=\text{``atomic\"}\right)left(\frac{J_{0}left(10 sqrt{-s}, r \right) s}{J_{0}left(20 sqrt{-s}\right) left(s^{2}+1\right)}, s , t\right)-mathit{Typesetting}mcoloneq mathit{msup}left(math
 
Why is maple inserting all these \mathit{Typesetting}? There are not in your math.
 
And I think you are asking about \text{``$-$\"} in there. Right? right now I am not sure why it is there. This is what Maple generated I am afraid.
 
10:45 AM
@Nasser so the output is not usable. if you actually typesert quotes around the - (and other things) then it is not understandable if you read it. whether or not you get an error from lualatex is not really the point.
 
@UlrikeFischer Maple uses it own style file and this is needed to compile its Latex. Maple style file comes with Maple itself when one installs it on the computer. So you will not be able to compile it otherwise. I'am now trying to compile it myself to see what the pdf looks like but getting some latex errors. I am trying to find out why.
if I can't get it to compile with lualatex and using Maple style file, then I will report it to Maplesoft.
 
@Nasser if there use their own style, they can theoretically process any input how senseless it may look, so you shouldn't ask us if the input is valid, but them if it is valid in combination with their style.
 
11:06 AM
has anyone written a script to remove everything from the latex source that is not used? I find myself doing this a lot every time I make a MWE and it's quite slow
 
11:33 AM
@Anush for an mwe it should be fairly easy just delete the whole preamble, and hopefully by then the body of the document only uses a few environments or commands so you should be able to easily add the ones needed.
@Nasser you still have not answered the question, it is impossible to tell from your remarks whether you are trying to typeset the three characters "-" or the one character -.
 
12:06 PM
In which cases are \group_align_safe_begin:/\group_align_safe_end: (or similar) really necessary? In the following they aren't necessary, even if there are alignment characters outside of a brace-scope in a delimited argument. As soon as I add \unravel to the last line it doesn't work anymore.
\documentclass[]{article}

\makeatletter
% primitive expandable optional arguments
\long\def\myoptarg#1#2#3%
  {%
    % #1: after
    % #2: default
    % #3: maybe real arg, maybe opt arg start
    \romannumeral
    \my@optarg@ifbracket\my@mark#3\my@mark\my@optarg@true\my@mark[\my@mark
    \@firstofone{\z@#1}{#2}{#3}%
  }
\long\def\my@optarg@ifbracket#1\my@mark[\my@mark{}
\long\def\my@optarg@true\my@mark[\my@mark\@firstofone#1#2#3#4]{#1{#4}}
\makeatother

\def\testinalign{\myoptarg\TESTINALIGN{default&argument}}
 
12:20 PM
It seems to me like expandable argument grabbing has no issues with & being there or not, but I remember that I once had issues with an \afterfi construct (\def\afterfi#1\fi{\fi#1} with usage such as \afterfi abc&def\fi, which had to be used as \afterfi{abc&def}\fi instead to avoid the issues).
 
12:36 PM
@Skillmon the afterfi case is easier to see, the & triggers the inserttion of the cell template and what happens after that depends. The case where you have brace delimited argument is also clearly guarded. Just looking at the unbraced [&] now...
 
@DavidCarlisle yes, those were all pretty easy (the \afterfi one not so much, since it feels like being the same as the [&] case from \myoptarg).
 
@Skillmon I think main thing is :
\my@optarg@true \my@mark [\my@mark \@firstofone #1#2#3#4]->#1{#4}
#1<-\z@ \TESTINALIGN
#2<-default&argument
#3<-[
#4<-AB&CE
you are putting #4 back braced
 
@DavidCarlisle yes sure, but it wasn't braced before, and there was no unmatched brace during parsing.
 
@Skillmon I'm just working backwards through tracingall, haven't got that far yet:-)
 
@DavidCarlisle haven't yet started with \tracingall, I'm still looking at other things..
@DavidCarlisle found the reason.
 
12:45 PM
@Skillmon good saves me worrying about it:-)
@Skillmon ?
 
@DavidCarlisle The thing is that TeX doesn't do the & replacement while searching for \noalign or \omit. Putting a \relax before \testinalign will result in the expected error.
 
@Skillmon ah yes
@Skillmon \halign is weird
 
@DavidCarlisle it is.
 
1:14 PM
@DavidCarlisle @FrankMIttelbach It is obvious that user241086 is just a new identity of marmot/SchrödingersCat who is a troll. I was trolled pretty hard by that person on the PGF repo, so I recommend to avoid any interaction. Ignoring is the only defense against such trolls.
 
@HenriMenke yes I deleted my answer on that question.
 
@HenriMenke yes, it was obvious, it is not the first identity.
 
Is it expected that +v fails to treat every newline character the same?
 
1:30 PM
@Skillmon there's been some discussion of some v edge cases, what do you have?
 
@DavidCarlisle I have played :)
\NewDocumentCommand \foo { +v }
  {
    \tl_analysis_show:n {#1}
  }
\endlinechar=`\a\relax
\foo|
.
.
|
and compare this to
\NewDocumentCommand \foo { +v }
  {
    \tl_analysis_show:n {#1}
  }
\endlinechar=`\a\relax\foo|
.
.
|
@DavidCarlisle in the first case, the first line break after | is displayed as a and every consecutive one is ^^M (as expected from normalisation), but when moving the \foo| in the same line as \endlinechar the first line break is turned into a space.
 
welll you'd expect them to be diferent wouldn't you? let me see
 
@DavidCarlisle why should they be different?
Is \endlinechar only applied at the next line? And is \foo only executed after the entire line was read and the endlinechar was already applied?
 
@Skillmon the endlinechar is added when the input line is stripped of trailing spaces and added to the input buffer so the existing endlinchar is already at the end of line on which you set \endlinechar
 
@DavidCarlisle ok, and then same for the first line of \foo|. Makes sense (I thought this was done only later during tokenisation).
 
1:37 PM
@Skillmon you'd have to check the source to be sure (the texbook probably lies) and I haven't checked in recent years but that's how it works in my head
 
@DavidCarlisle well, and my experiment indicates the same :)
 
 
1 hour later…
2:39 PM
@JosephWright, @PhelypeOleinik I just realised that \keyval_parse:NNn isn't safe in an alignment (well, it never was, but now that we use an expandable implementation that might be a problem). Any thoughts on this?
(I'm having the same issue with expkv currently, but I haven't yet thought of a good solution to that other than documenting that one should use braces if one needs & in a key name or value)
 
@Skillmon Isn't \group_align_safe_begin: enough?
 
@PhelypeOleinik yes and no. Control in \keyval_parse:NNn is going forward and backward between parsing and execution of user code. User code shouldn't be affected by \group_align_safe_begin:, so we can't just put begin at the start and end at the end when parsing is completely done.
 
@Skillmon Well, yes, but when would a user need that (& being prematurely detected) behaviour?
 
@PhelypeOleinik what would be needed is something like putting \group_align_safe_begin: before \__keyval_loop_active:nnw runs, putting a \group_align_safe_end: before the \exp_not:n code in \__keyval_pair:nnnn and \__keyval_key:nn, and a \group_align_safe_begin: after the \exp_not:n code.
@PhelypeOleinik only when one builds a table's body using \keyval_parse:nnn and needs to output the contents of more than one column per key or pair. And that only if TeX isn't currently scanning for \omit or \noalign, so if the column already contains unexpandable stuff. To summarize: Rarely.
 
@Skillmon :-) I'd say one safe_begin and one safe_end is enough. There are better ways to build a table than \keyval_parse:nnn
 
2:50 PM
The other solution would be to slow down \keyval_parse:nnn by delaying output to after parsing is done completely (which would be either expensive because it would require reading and reinserting the entire list for each element), or by using \tex_expanded:D, which we don't yet require.
 
@Skillmon or to rewrite the format table environments to use direct box manipulation and not use \halign
 
@Skillmon You could have a fallback code for pre-2019 engines...
 
@PhelypeOleinik well, this would also only be an issue if some key or value contains & without braces around it...
@PhelypeOleinik not yet another macro which has to be maintained in pre-2019 and post-2019 variants (didn't I already add enough of these in l3tl?).
@DavidCarlisle you might give it a go! :)
 
@Skillmon I was just going to tell @PhelypeOleinik to get it done.
 
@Skillmon Even with safe_begin and safe_end? Can I haz MWE? (too lazy to think of one :)
@Skillmon Not all of the code will change, I believe? So only a couple of macros defined conditionally
 
2:54 PM
@PhelypeOleinik with a safe_begin and safe_end this would then only be a problem if the user needs to output multiple columns during the parsing.
 
@DavidCarlisle In 10 years or so it might be ready to be used :)
 
@PhelypeOleinik the output macros, more or less.
 
@Skillmon I don't think supporting that should be an aim.
 
@DavidCarlisle I second that
 
@PhelypeOleinik faster development time than longtable v5 then.
 
2:55 PM
@DavidCarlisle :-) We're so efficient!
 
3:05 PM
@DavidCarlisle I just saw a longtable question about footnotes not staying on the right page. When I said that it works, I got the answer back "but not with reledmac and lots of footnote apparates and \footnotemarkA/\footnotetextA" ;-)
 
@UlrikeFischer I think there is an open issue about reledmac footnotes, possibly even an answer...
May 12 '13 at 20:06, by egreg
@AlanMunn I'll answer with the immortal words by Jill Knuth: "Don't use footnotes in your books, Don". ;-)
@UlrikeFischer another github repo? :-)
 
@DavidCarlisle ;-). I wonder what will happen when such texts will need to be tagged. Already one level is a bit of a challenge and in tagpdf I actually removed some footnotes to save me the troubles (and it improved the text ...).
@DavidCarlisle ;-) but I think even if the package is mentioned in the tex faq, it would be better if it disappears as soon as possible.
 
3:25 PM
@DavidCarlisle @PhelypeOleinik if we supported that using the first solution I've laid out, \keyval_parse:NNn would get 10 % to 15 % slower.
 
@UlrikeFischer we can remove mention easily enough but putting out a "quick fix" version is probably needed.
@Skillmon and more useful for 0.0000000000000000000000001% of the users who need that feature. Clearly a win.
 
@DavidCarlisle I was just curious :)
 
@DavidCarlisle yes, a real fix will need a bit time imho.
 
@DavidCarlisle (also, I think the number of users actually needing this is 0)
 
@DavidCarlisle how much of an user is that?
 
3:27 PM
@Skillmon 0.0000000000000000000000001=0 in TeX arithmetic, so we agree
 
@DavidCarlisle thanks. I guess I just have an ever expanding preamble
 
@Anush it is such a bad idea to copy a preamble from one document to another (or copy it off some internet "template"). Start with an empty preamble and only add packages if you need them,
4
 
@DavidCarlisle I am sure you are right but it's not just packages. Lots of definitions as well
 
@UlrikeFischer a real fix probably means making marginpar work better in the kernel, that's probably out of scope just making the hack do the same hack it did before without breaking the hook code should be enough I think
@Anush even more so, don't define commands you have not used.
 
@DavidCarlisle yes for now certainly. Do we need a github? Where should we put it?
 
3:39 PM
@UlrikeFischer well we don't need it, you could just mail the changed .sty to ctan, but I think it's not a bad idea to do all such changes in public. doesn't matter where really, Robin gets mentioned in the acknowledgements you could put it in rf-tex (or in your own account) or ....
 
@DavidCarlisle using just a single \group_align_safe_begin:/end: we get 17% slower for an empty key=val list, 5% for a one key and one pair, 3% for two keys and two pairs, and practically no difference starting at 10 keys and pairs.
@DavidCarlisle also, with just a single safe_begin:/end: pair one could still build a table body expandably with multiple columns per element by using \use:e around it.
 
@Skillmon Good enough for an unsupported feature :)
 
@PhelypeOleinik yes, it is. I'm still wary what to do with expkv. Fixing this in expkv-cs only would be trivial, and applying the same fix for \ekvparse seems reasonable. But I'm totally unsure what to do with \ekvset, maybe I just keep it as it is and document this, or apply the same fix to it as well.
I'll open a formal issue in Github for the alignment fragility, and send a PR in a few minutes as well.
 
@Skillmon Cool. Thanks!
 
(well, the PR could also take a little longer)
 
 
1 hour later…
5:07 PM
Ok, there is still some issue that I haven't figured out yet, seemingly, just adding \group_align_safe_begin: and end: at those two points doesn't fully work.
 
5:23 PM
I don't get why this is failing, \halign is so strange.
I now have something that will expand to a \typeout, and it fails when there is no \relax before it, but if there is a \relax at the start of the alignment row everything works out :(
And it doesn't fail at the first macro grabbing it, but at the second one :(
But if I put \group_align_safe_begin: and end: before and after every user code, it works again :(
@PhelypeOleinik and @DavidCarlisle using only a single pair of \group_align_safe_begin:/end: will not work as soon as the user provided code is unexpandable. I'm afraid the only possibilities working reliably is either putting \group_align_safe_end: and \group_align_safe_begin: around the user code as well, or using \tex_expanded:D, or delaying output until after parsing is done (that last solution seems like the slowest).
(don't ask me why it doesn't work, I have no idea)
 
5:39 PM
@Skillmon why doesn't it work?
 
@DavidCarlisle AND THAT'S WHY YOU DON'T MANAGE TO USE VIM, YOU CAN'T EVEN FOLLOW THE SIMPLEST ORDER!
(sorry for all-caps)
@DavidCarlisle somehow, when TeX executes some non-expandable code, it forgets that it was asked to ignore &, but and that's really strange: If the unexpandable bit was before the \group_align_safe_begin: TeX remembers what it was told.
 
@Skillmon s/MANAGE/CHOOSE/
 
6:02 PM
\documentclass[]{article}

\ExplSyntaxOn
\cs_new:Npn \test:nn #1#2
  {
    \typeout{}
    \typeout { while~ searching~ for~ noalign/omit }
    \tex_halign:D { \typeout{0} ## \typeout{1} \tex_cr:D
      \keyval_parse:nnn {#1} {#2} { a, a=b&c }
      \tex_cr:D
    }
    \typeout { with~ relax }
    \tex_halign:D { \typeout{0} ## \typeout{1} \tex_cr:D
      \relax \keyval_parse:nnn {#1} {#2} { a, a=b&c }
      \tex_cr:D
    }
    \typeout{}
  }
\ExplSyntaxOff

\begin{document}
\ExplSyntaxOn

\test:nn \use_none:n \use_none:nn % fails with relax
@DavidCarlisle behold the MWE ^^^
 
 
1 hour later…
7:19 PM
@DavidCarlisle mparhack doesn't install ;-(. (I changed the dtx and wanted to try, but the ins seems to need some adaptions ...). But I will make first dinner.
 
@UlrikeFischer it needs latex mparhack.ins not tex
@UlrikeFischer it needs that because the .ins uses \@ifundefined to check you are not using a pre-1996 docstrip:-)
 
@DavidCarlisle I could also remove the complete test ?
 
@UlrikeFischer yes
 
@DavidCarlisle better ;-)
and now the documentation ...
 
@UlrikeFischer that can be treated same way as the \@ifundefined test
 
7:33 PM
@DavidCarlisle emergency stop at the second page ...
@DavidCarlisle \typein ..., how can I tell l3build to continue without error?
 
@UlrikeFischer emergency stop? let me try...
 
8:02 PM
@UlrikeFischer you could remove the test. you can have a ltxdoc,cfg that does \renewcommand\typein[2][]{\def\answer{y}} but I can only get l3build to use that if I put itt in typesetfiles, then it tries to typeset it
 
user image
2
Saw this out and about today and thought everyone here would appreciate it.
 
@DavidCarlisle I think we have somewhere a setup with small files which answer such questions, but I think I should simply remove this questions and print everything.
 
8:20 PM
@UlrikeFischer yes questions don't really help
 
8:31 PM
@DavidCarlisle it compiles and works and the ctan zip is okay too. Now it only needs a home.
 
@UlrikeFischer you don't want it under your account? :-) we could open up rf-tex or ho-tex as a general home for orphaned packages.
 
@DavidCarlisle the "Orphaned Package Support Group" ? ;-)
 
@UlrikeFischer you could of course just start a new one I have bidi-tex geometry rf-tex ho-tex tkz-sty ... but using an existing one also works
 
8:47 PM
@DavidCarlisle well I think I will simply move it to my account and use my name. I hope I don't get issues ;-)
 
8:59 PM
@LaTeXereXeTaL There is a small typo in the top line of the number plate. It should read "In Don we trust" :)
 
@UlrikeFischer if there are issues we can blame you, so sounds like a good plan
 
9:21 PM
@samcarter_looks_forward_TUG'21 Good catch! LOL
 
 
1 hour later…
10:39 PM
Hi
I have three equations which I am keeping inside the align environment
but as the first equation is a bit long, I want to break it over two lines
i was trying \\ and hspace but its not working
any suggestions would be helpful!
 
11:05 PM
@BAYMAX well either just use \\ and &\quad or (depending on the layout you want) use an \begin{aligned}[t] as the rhs of the long equation
 
11:39 PM
hmm thanks but couldnt get it
 
11:49 PM
\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align}
  a&= 1+ 2 + 2+ 2+ 2+ 2+ 2+ 2 \notag\\
   &\qquad + 2+ 2+ 2+ 2+ 2+ 2+ 2+ 2+ 2+ 2+ 2+ 2\\
  b&=3\\
  c&=4
\end{align}
\end{document}
@BAYMAX ^
@BAYMAX or vvv
\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align}
  a&= \begin{aligned}[t]
      &1+ 2 + 2+ 2+ 2+ 2+ 2+ 2 \\
      &\quad+ 2+ 2+ 2+ 2+ 2+ 2+ 2+ 2+ 2+ 2+ 2+ 2\end{aligned}\\
  b&=3\\
  c&=4
\end{align}
\end{document}
 
oh thanks much
wil ltry them out an dlet u know
thanks
 

« first day (3836 days earlier)      last day (1100 days later) »