« first day (2057 days earlier)      last day (2868 days later) » 

1:10 AM
@yo' Glad to hear!
@Nasser I hope it will be less hideous then MathJax
 
 
6 hours later…
7:16 AM
Ladies and gentlemen, this is the sound of silence.
 
 
1 hour later…
8:38 AM
@Canageek yes that's why 2e is called 2e (2+epsilon) not 3 because 3 was already a working format before we even had the idea of doing 2e.
 
9:29 AM
hello guys
oh, this room doesn't seem to be very active
 
9:45 AM
@BartekBanachewicz no cricket results to post at the moment
 
@DavidCarlisle I was gonna about how to get started with tex
but got an answer elsewhere
Apparently TexStudio is what I want
 
@BartekBanachewicz possibly, never used it myself but it seems quite popular. The point is that tex files are just plain text so you can use whatever editor you want.
 
that part is rather obvious
the builds apparently aren't
 
@BartekBanachewicz you might think so, but after spending 20 something years telling people who have installed an editor but not a tex system that it doesn't work that way, I don't think it's obvious at all anymore:-)
@BartekBanachewicz build?
 
@DavidCarlisle well, turning your text input into whatever output format you want?
in Lounge<C++> on Stack Overflow Chat, 7 mins ago, by Morwenn
Haha, yeah, the multiple compilation steps are bring with LaTeX too. I generally end up clicking the same buttons multiple times just in case.
 
9:51 AM
@BartekBanachewicz well I tend to just use the command line and process file.tex by issuing the command pdflatex file of course most tex aware editors let you bind a command or sequence of commands to a key, which is good if it saves typing but bad if it means you have no idea what's happening behind the scenes.
 
@DavidCarlisle do I really need to know what's happening there?
 
@BartekBanachewicz hard to say, i do (but I'm one of the developers of latex, so I need to know what's gone wrong:-) for other people it just depends whether you want to know.
 
10:12 AM
I always use latexmk -gg foo.tex and let it recompile all from scratch all the time. But I do not do huge documents.
 
10:30 AM
@BartekBanachewicz IMHO you are using something that works like a recipe. Ingredients have to be put in a certain order to obtain the correct outcome. That's how TeX works and that's the "price" you pay for using it. Automation tools like latexmk try to guess the order for you, and they do succeed in most of the cases, but there's absolutely no guarantee of a correct output.
If your workflow is simply, say, pdflatex+ bibtex, most IDE's have some preset for that.
 
Yay, apparently I got a comment by me flagged as rude for the first time ;-)
Either ... this one:
I am deleting my answer since it is apparently totally impossible to clearify this question. Read the appendix manual and you will find subappendices. — Christian Hupfer 21 mins ago
I leave it to you to figure this out — Christian Hupfer 14 mins ago
It's good to be 'rude' ;-)
 
Who I need to blame for \ifGin@setpagesize?
 
@PauloCereda Uwe Kern
 
@DavidCarlisle :) Any fix? :D
 
@PauloCereda No, DPC ;-)
 
10:43 AM
@PauloCereda go and swim on a pond for a day and try again tomorrow
 
@DavidCarlisle <3
@David: on a more serious note, is it already reported? :)
 
@PauloCereda \usepackage{graphicx} would work (load before xcolor)
@PauloCereda it's already fixed in texlive, you just need your mirror to catch up
 
@DavidCarlisle It worked, thanks. :) As always, a package of yours saved the day. :)
 
@PauloCereda it's also the package that introduced \ifGin@setpagesize? :-)
 
@DavidCarlisle ooooooh :)
 
10:50 AM
@PauloCereda @DavidCarlisle introduced this feature bug to answer questions about this feature bug in order to catch up with @egreg
 
11:07 AM
I've managed to build my first document. Yay me.
4
Simple things were surprisingly simple
So good job on that I'd say :)
 
@BartekBanachewicz :-)
 
11:45 AM
Stop for lunch and I find a bug report on a package by @DavidCarlisle 😋
 
12:05 PM
@egreg I see no bug reports on my packages, only xcolor which isn't one of mine.
 
user212835
12:23 PM
@barbarabeeton: Dear Barbara, any news on the math class of \typecolon? David and me had a discussion on this tex.stackexchange.com/questions/314620/… ? Did you find any old documents for/against viewing it as a relation (\mathrel)? As of this very moment, I'd use it as "x ⦂ int → int", with spacing around a colon being slightly larger than inside the type, which is here "int → int".
 
@Fran: I am still clicking the image. One day it will gimme the file thingy. :)
 
@MarkMcGregor -- i'm the person who compiled the table of symbols that were submitted to unicode and adopted (mostly) in unicode 4.0. i earlier alleged that i assigned the same class to \typecolon as to \colon, but on rechecking, i found that was not true, and the class "fence" was incorrectly assigned to \typecolon. but since \colon is actually relation, by this assumption, \typecolon should be also. i've marked the table to be fixed.
 
@barbarabeeton ... or at least : is relation (\colon is mathpunct)
 
user212835
12:39 PM
@barbarabeeton: thank you, i see.
 
@DavidCarlisle -- not in my table. : (U+003A) is punctuation and \colon (U+2236) is a relation. i can't help it if someone else has switched the two. (i'm looking at the latest version of the table, which isn't posted publicly yet because some updates are still needed. but no change for the colons was noted before this class question.)
 
user212835
@DavidCarlisle, @barbarabeeton: Thank you for the discussion; I've got to leave now. If you find any (old) documents confirming particular arguments for spacing; feel free to drop a line, say, to Mark dot McGregor at gmx dot de. As of today, I consider the fat open colon as a typing judgement.
 
@barbarabeeton "someone else" == someone called Don Knuth, do you know him? :-) plain tex has \mathcode`\:="303A where leading 3 = relation and \mathchardef\colon="603A % colon as a punctuation mark
 
lua experts. I am getting some strange error in this code, when I run it by make4ht, but it run ok with lualatex. I do not see a syntax error. Does any one spot a silly error in my syntax? It compiles OK with lualatex, but give tex exceeded capacity in make4ht. Here it is
\documentclass[11pt]{scrartcl}
\IfFileExists{luatex85.sty}
{
\usepackage{luatex85}
}
{}
\usepackage{amsmath}
\usepackage{luacode}
\usepackage{breqn}

%----------------------------------------------
\begin{luacode}
  function foo(arg)
  \ifdefined\HCode
     tex.print("\\begin{dmath*}")
     tex.print(arg)
     tex.print("\\end{dmath*}")
  \else
     tex.print("\\begin{align*}")
     tex.print(arg)
     tex.print("\\end{align*}")
  \fi
  end
\end{luacode}


\begin{document}

\directlua{foo("\luatexluaescapestring{\unexpanded{
TL 2016. To see the error, please compile with make4ht --lua foo.tex
The strange thing, it works with lualatex.
 
does that work at all if you use luacode that's essentially verbatim so tex commands don't expand so how can \ifdefined\HCode work?
 
12:49 PM
@DavidCarlisle but I am using luacode and not luacode*, which I understand it supposed to understand latex \commands?
inside lua, I mean. Or may be I am wrong. I remember asking about this before. Let me check
 
@Nasser oh sorry does it, I don't use the package at all myself, I'd just use \directlua
 
@DavidCarlisle I understand that luacode should work, but not luacode*. I am checking now. I get no error with lualatex.
 
@DavidCarlisle -- fair enough. rats! i was sure i had started with the plain assignments, but obviously i hadn't. okay. one more thing on the list of things to be fixed in the stix table. (and check everything against plain.tex. sigh.)
 
@Nasser yes you're right commands expand in luacode
 
@DavidCarlisle here is the question tex.stackexchange.com/questions/312322/…
Here is the error with make4ht
/usr/local/texlive/2016/texmf-dist/tex/generic/tex4ht/html4-math.4ht))
(/usr/local/texlive/2016/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/usr/local/texlive/2016/texmf-dist/tex/generic/tex4ht/html4-math.4ht))
(./foo3.aux)
! TeX capacity exceeded, sorry [input stack size=5000].
<to be read again>
\a:display
l.33    }}")}

 28056 words of node memory still in use:
   17 hlist, 3 vlist, 2 rule, 4 local_par, 3 dir, 3330 math, 30 glue, 1 kern, 7
 penalty, 2 glyph, 61 glue_spec, 3 temp, 1665 if_stack, 2 write, 184 special no
@DavidCarlisle I found the error. make4ht does not like breqn. I switched the logic. Will fix it.
 
1:09 PM
@egreg I'm sure you were watching: bbc.co.uk/sport/rugby-union/36557956
 
1:20 PM
oToo busy driving.
 
Now that I figured how to pass data from Latex to lua, the sky is the limit :) I need to learn about regular expression use in Lua, so I can change strings inside lua, and send new Latex code back to Latex. This now works
\documentclass[11pt]{scrartcl}
\IfFileExists{luatex85.sty}
{
\usepackage{luatex85}
}
{}
\usepackage{amsmath}
\usepackage{luacode}

%----------------------------------------------
\begin{luacode}
  function foo(arg)

  \ifdefined\HCode
     tex.print("\\begin{align*}")
     tex.print(arg)
     tex.print("\\end{align*}")
  \else
     tex.print("\\begin{align}")
     tex.print(arg)
     tex.print("\\end{align}")
   \fi
  end
\end{luacode}


\begin{document}

\directlua{foo("\luatexluaescapestring{\unexpanded{
 
@DavidCarlisle ^^^
 
I just wish someone can come up with shorter command than "\luatexluaescapestring{\unexpanded{
 
@PauloCereda Having my ice cream in Fiesole
 
btw updating should not be necessary. You should be able to create a fontspec file will all the details. Have a look at the Inconsolatazi4.fontspec file. But something like:

\defaultfontfeatures[MinionPro]{
Extension = .otf,
UprightFont = *-Regular,
BoldFont = *-Bold,
ItalicFont = *-It,
BoldItalicFont = *-BoldIt,
}

That should do the trick
 
1:27 PM
@egreg yay, ice cream! :D
 
1:53 PM
so there are like tex table editors online
but doesn't using such an editor kinda defeat the purpose?
 
2:09 PM
@BartekBanachewicz No. The main point of them is to make the tedious part of inserting all the & etc. into the the table. Spreadsheet like functionality is much better than a plain editor for doing that.
@ArTourter Thanks! I'll give that a try.
 
@AlanMunn hmm
I'm really beginning to wonder if HTML would've been a better choice for this
 
@BartekBanachewicz What is 'this'?
 
I wanted to compile my guitar notes into a handbook
and by "notes" I mean various diagrams, tables, stuff like that
seems to me that LateX is very text-oriented
while what I mostly need is being able to have highly customizable visualizations of table-like things
ah.
 
@BartekBanachewicz For many people, LaTeX is very math oriented. :) But LaTeX also excels in automating things, so for repetitive formatting of content that can be given an adequate semantics it can be enormously useful.
 
something like that, for example
@AlanMunn hmm, interesting
so I could, for example, specify the list of notes once in LaTeX, and build other structures from that?
 
2:13 PM
@BartekBanachewicz Well now you're bumping up against the "what I want to do is possible but not really a beginner's task". :)
 
music theory is kinda about seeing connections in a 12-element dataset over and over
 
@BartekBanachewicz Don't get me wrong, I don't think that's a task for someone who's being introduced to LaTeX right now.
 
@AlanMunn I don't need the 5-line musical notation bits if that helps :)
anyway the above is an SVG
I was thinking that TikZ would be apt for stuff like that
@PauloCereda that might well be possibly true
on the other hand, it's not that I am in a hurry
 
@BartekBanachewicz No, that's not the issue. All of this would be doable using TikZ, but it would really require quite a bit of expertise.
 
I am willing to learn, I'd just like to know that I'm going in the right direction with this
The "specify and reuse data" bit isn't really new for someone who's a computer programmer :)
 
2:15 PM
@BartekBanachewicz You also have to keep this in mind.
 
True, true
 
@BartekBanachewicz I'm not trying to discourage you; I think what you want to do is actually quite suited for a TikZ solution, but you'll need some patience to learn it.
 
that's fine
as long as I don't encounter a wall that will make me rewrite everything in SVG at some point
 
@BartekBanachewicz Also, you need to first think about what would be a reasonable syntax for entering this sort of thing. If you can figure out what needs to be entered vs. what could be generated, that would be helpful. I don't know enough music theory to be able to help you on that front.
 
well one thing that's possibly helpful in my case is that theory doesn't change at all
so even if I have to hardcode things, I only need to do this once for eternity
so too much on the generation front might not be needed in the end
it's more of a "save myself some typing" deal
 
2:23 PM
@BartekBanachewicz You mean you just want to reuse the same circle of fifths diagram over and over again once you have one you like? What about your tabular customization. What sorts of things do you need there?
 
@AlanMunn I'd like to include this table for example
 
@BartekBanachewicz This is quite simple to do.
 
in general there's a truckload of useful materials on the internet
but the problem with them is that they often come as PDF or JPG renders that are kind of hard to work with. The very reason I wanted to do my own compilation was to have an editable source that I can tailor for my needs
 
@BartekBanachewicz Well nothing you shown me is something that I would say "don't do this in LaTeX", in fact both of these things are eminently doable with it. So I guess if you persevere and take things a bit slowly at the beginning, you can do what you want. The TikZ manual is extremely good and has lots of tutorials in it; also there are tons of enlightening questions about TikZ on the site.
 
that sounds... good
 
2:29 PM
@BartekBanachewicz But seriously, don't try to run before you can walk... :)
 
what could possibly go wrong? ;)
 
@BartekBanachewicz To get you started:
4
A: How to conceive a macro for drawing a pie-chart circle of fifths?

IgnasiIt's not a macro but some TikZ code to start. \documentclass[tikz,border=2mm]{standalone} \begin{document} \begin{tikzpicture} \newcommand{\myangle}{27.6923} \foreach \nota/\text [count=\sector] in {Mib/Mi$\flat$,Sib/Si$\flat$,Fa/Fa,Do/Do,Sol/Sol,Re/Re,La/La, Mi/Mi,Si/Si,Fas/Fa$\sharp$,Dos/Do$\s...

 
oh, sweet, thanks!
I'm pretty amazed how close the answers look to the original picture
 
@BartekBanachewicz Just a word of advice: as a beginner, stick with TikZ not PSTricks; the latter is less widely used these days, and the documentation is much poorer.
 
hmm, I see that \pgfforeach is used to generate the actual labels; would LuaLaTeX work for that in a similar way?
I'm quite familiar with Lua
 
2:35 PM
@BartekBanachewicz LuaLaTeX is simply regular LaTeX with an interface to Lua (more or less). But if you're using TikZ anyway, there's probably not much need for using Lua directly unless you require lots of numerical calculations.
 
@BartekBanachewicz tikz in luatex works just like tikz in pdftex all done on the tex side, of course you can drop into lua and do stuff but typically you'd be then using lua to generate some tikz markup rather than tikz-pgf itself knowing about lua
@AlanMunn picture mode?
 
@DavidCarlisle Only the true avant garde use picture mode.
 
@AlanMunn Je ne comprends pas français
 
I wonder why some of the vertical lines are thinner
 
@BartekBanachewicz Viewer artefact? What does your \begin{tabular} line look like?
 
2:40 PM
@BartekBanachewicz assuming you didn't specify it that way, some pdf renderers are better than others at that, zoom in or out and see if they snap back
 
@AlanMunn \begin{tabular}{ l | *{12}{c|} }
@DavidCarlisle oh ok it looks fine on 100% zoom
so that might just be zoom artifact
 
@BartekBanachewicz it gets even more noticeable if you give the table cells colour backgrounds as then the viewer can round the cell background out by a pixel and obscure the rule completely. (Causes a question here every other week)
 
@BartekBanachewicz so I wrote the package most people use for coloured tables so I've been posting "it's not my fault" every few days since about 1995
 
man that must be annoying
Also, on an unrelated note, I couldn't even talk in 1995, so there's that ;)
 
2:44 PM
@BartekBanachewicz it's good to know people are using your software
 
oh that part must sure be nice
I presume you've made a FAQ about that issue which is subsequently ignored
of which I'd be guilty now :D
 
@BartekBanachewicz it's in the package documentation nobody reads that of course:-)
 
@DavidCarlisle It doesn't have enough pictures.
 
@AlanMunn I could add a donkey
 
@DavidCarlisle And then pin the table on the donkey.
 
2:54 PM
@AlanMunn we should do that for the latex3 guide
 
3:45 PM
@DavidCarlisle No ducks? I am disappointed. :)
 
@PauloCereda ducks are tricky in picture mode, you really need ms paint for that
 
@DavidCarlisle awwww <3
 
@DavidCarlisle This looks like a squeezed number 8 to me, covering an orange 7
 
@ChristianHupfer you just don't appreciate true art
 
@DavidCarlisle I do appreciate true art , but not 'art' ;-)
 
4:05 PM
@DavidCarlisle It's a Möbius duck!
 
 
2 hours later…
6:13 PM
@PauloCereda Back from my tour; the dome by Brunelleschi is still there.
@PauloCereda Fiesole is on the hills you see on the left
 
 
3 hours later…
9:07 PM
@Nasser If you want to live dangerously, just redefine \@doimport to do the same whether the * is given or not.
\makeatletter
\def\@doimport#1{\@ifstar
  {\@sub@import#1\IfFileExists}{\@sub@import#1\IfFileExists}}
\makeatother
 
9:58 PM
@egreg thanks, I just deleted the question and took your advice and changed all to non-star, I did not want to deal with it and try to make it work with star. So it works now ok. I do not know what I used the star version, but this is old code.
 
@Nasser No problem, but the question was just a misunderstanding of what TEXINPUTS is, as I explained.
 
@egreg yes. But I got mislead by someone else answer where they said Latex always uses TEXMFHOME to find style files. I just did not know there are exceptions. Now I know.
 
@Nasser Here are the relevant lines from texmf.cnf, showing how kpathsea builds TEXINPUTS:
TEXMF = {$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFLOCAL,!!$TEXMFDIST}
TEXINPUTS.latex = .;$TEXMF/tex/{latex,generic,}//
@Nasser The TeX programs never look at TEXMFHOME directly.
 
@egreg I see., Thanks. So the answer I was reading was not really accurate? Here it is  tex.stackexchange.com/questions/12267/…

If you use mystyle.sty in multiple documents, you might consider putting it in a place that is searchable by TeX. Usually, this is the output of the command kpsewhich -var-value TEXMFHOME (more precisely, the tex/latex/ subdirectory of that directory). Once you put the file there, you should run the command texhash. Then, kpsewhich myfile.sty should print the path to the file. After doing this \usepacakge{myst
 
@Nasser Yes, it's accurate, but it is about a different problem.
@Nasser The missing link is that the value of TEXMFHOME is handed to TEXINPUTS
 
10:12 PM
@egreg yes, and that is what was not clear to me and in the answer given, but the question there was about similar issue, using subfiles and such. Any way. Now I know to avoid the star version. I have to edit many many files now to remove the star version but at least now it works.
Latex is too complicated. There should be a PhD in Latex offered at universities.
 
10:25 PM
@egreg seen texlive list? You have a present...
 
@DavidCarlisle Another bug!
 
I am getting close to do what I want with luacode, but I need small help in figuring how to tell it to keep the new lines in place. I am using \luatexluaescapestring{\unexpanded{ to pass stuff to lua. It all works, but all the newline are lost on return. I looked at couple of questions and just wanted to ask if I should get into catcode and stuff to do this and if I am in the right direction before I spend much time on this. Here is a MWE of what I am doing
\documentclass[11pt]{scrartcl}
\IfFileExists{luatex85.sty}
{\usepackage{luatex85}}{}

\usepackage{amsmath}
\usepackage{luacode}

%----------------------------------------------
\begin{luacode*}
  function foo(arg)
   tex.print("\\begin{verbatim}")
   tex.print("")
   tex.print(arg)
   tex.print("\\end{verbatim}")
   tex.print("")
  end
\end{luacode*}


\begin{document}

\directlua{foo("\luatexluaescapestring{\unexpanded{
x=10;
y=20;
A=zeros(10);
s="this is string";
   }}")}
\end{document}
This compiles OK but produces this:
 
@egreg clearly your fault
 
But the call had this:
\directlua{foo("\luatexluaescapestring{\unexpanded{
x=10;
y=20;
A=zeros(10);
s="this is string";
   }}")}
I wanted the newlines to remain there. Is this something to fix using catcode as shown in this answer: tex.stackexchange.com/questions/191328/…
Just need to know if the fix is in the answer there, as the answer is way over my head, and just wanted to know if I read it more, it will tell me what do to to fix this.
I am trying to pass the code as string to lua to add formating to it and send it back to Latex.
I could ask the above at main site if needed.
 
10:40 PM
@Nasser verbatim is a bad beast. I'm not sure why you don't want to use something like minted instead.
 
@egreg This was just an example. I do not mean to use verbatim evatually. I am using listing actually. But the newline is the issue? I mean the same thing would happen if I use listing, no? Since newlines are lost. Will make new MWE example with listing now.
@egreg here it is same issue.
\documentclass[11pt]{scrartcl}
\IfFileExists{luatex85.sty}
{\usepackage{luatex85}}{}

\usepackage{amsmath}
\usepackage{luacode}
\usepackage{listings}

%----------------------------------------------
\begin{luacode*}
  function foo(arg)
   tex.print("\\begin{lstlisting}")
   tex.print("")
   tex.print(arg)
   tex.print("\\end{lstlisting}")
   tex.print("")
  end
\end{luacode*}


\begin{document}

\directlua{foo("\luatexluaescapestring{\unexpanded{
x=10;
y=20;
A=zeros(10);
s="this is string";
   }}")}
 
@Nasser apart from the fact that the newlines are lost in the tex parsing before you passed to lua, if you change it so they were passed to lua you's get a Lua syntax error as you can not have multiline strings in quotes you need [[..]] but why not just use \n where you want a newline?
 
@DavidCarlisle you mean add \n in the code itself before passing to lua? But this is plain code, I copy from my Matlab editors and past as is in my Latex document.
 
@Nasser well pass it through sed first, to add the quoting for lua and tex, why make it complicated?
 
I am trying to send the code, as is, to lua, and in lua, will added the environment around it, and send it back to Latex. This is the idea.
 
10:48 PM
@Nasser or more to the point why not leave it in a file input by the listings input command then tex and lua quoting would not be an issue at all?
 
@DavidCarlisle sorry, how is using sed will simplify things? I am lost here. I simply asking if one can pass the code as is to lua from latex and not lose the newlines.
@DavidCarlisle some code fragments are not in files. It also easier to put it in code, this way I can something format it to fit
 
@Nasser if it was easier you wouldn't have spent a day asking questions how to do it
 
I simply asking if there is way to pass the code as is to lua without losing the newlines.
 
to pass newlines just set \endlinechar=`\^^J but as I say you would need to fix the lua code to accept multiline strings
 
@DavidCarlisle thanks for the hint. I will look to see how to make lua accept multiline string. I thought it will accept a string with embeded newlines in it, like a raw string, as in perl. But will look into this,. I know very little lua.
 
11:20 PM
@Nasser this works (you might want to find a better character than X) but it seems needlesly complicated compared to inputting a file
\documentclass[11pt]{scrartcl}
\IfFileExists{luatex85.sty}
{\usepackage{luatex85}}{}

\usepackage{amsmath}
\usepackage{luacode}

%----------------------------------------------
\begin{luacode*}
  function foo(arg)
   tex.sprint("\\endlinechar=13 \\begin{verbatim}")
    for line in arg:gmatch("[^X]+") do
    tex.print(line)
    end
   tex.print("\\end{verbatim}")
   tex.print("")
  end
\end{luacode*}


\begin{document}

{\endlinechar=`X %
\directlua{foo([[x=10;
y=20;
A=zeros(10);
s="this is string";
 
@DavidCarlisle thanks! But I just found a way around it! thanks to your hint. I found if I use \catcode\^^M=12 \newlinechar\^^M then Lua will accept it as is, as I expected. Please see below. So not need to do anything in lua land. This is much simpler. I am just looking at one final small issue. Here is the code
\documentclass[11pt]{scrartcl}
\IfFileExists{luatex85.sty}
{\usepackage{luatex85}}{}

\usepackage{amsmath}
\usepackage{luacode}
\usepackage{listings}

%----------------------------------------------
\begin{luacode*}

function foo(arg)
print(arg)
tex.print("\\begin{lstlisting}[language=Matlab]")
tex.print("")
tex.print(arg)
tex.print("\\end{lstlisting}")
tex.print("")
end
\end{luacode*}


\begin{document}

\catcode`\^^M=12
\newlinechar`\^^M

\directlua{foo("\luatexluaescapestring{\unexpanded{
x=10;
Here is the PDF
I am just trying to find out, what causes those flfl to show. That is all. Getting very close !
I just tried different catcode and it worked
That should be

\catcode`\^^M=12
\endlinechar=`\^^M
 
@Nasser hmm I thought that should be a lua error but it's getting late the fl are character 10 in OT1 encoding so you need to hide any newlines while the endlinechar is catcode ctrl-m (that is the default anway no need to set it in that case)
 
@DavidCarlisle I do not know what is going on, this is little bit over my head. But \catcode\^^M=12 works, but I get these extra flflfl which I do not how to get rid of. \endlinechar=\^^J did not do it. I am trying to avoid having to do any parsing in lua. Any way, getting close. May be I should make MWE and ask at main board if I can't find what is going on
 
@Nasser they are ends of lines so just stick % to hide all your line ends
 
@DavidCarlisle but I do not want to touch my code itself. I can't add % to end of code lines?
 
11:32 PM
@Nasser you can't leave \catcode\^^M=12` as a global setting it will print fl for every line you have to make that local in a {} group just around your special code
 
@DavidCarlisle ok, this too complicated for me. I know nothing about groups and such. I'll ask at main board if ok, this will be easier?
I think if this work, it will be great. It means I can now use lua to format all my code.
For HTML and for Latex, all inside one function.
 
@Nasser you must know about groups if you have used tex for more than two minutes, stick { before your catcode change and } after the directlua call and then don't have any other ends of lines in that group apart from your verbatim code
@Nasser but lua isn't doing anything useful here at all, you are just passing it in and printing it out?
 
@DavidCarlisle I still get the extra flflflf with {} around everything. THe above is just a simple example. In practice, I will have \ifdefined\HCode in there and will do something completely different for HTML and for Latex, and will get more complicated. But it is much simpler to do this inside LUA code than in Latex.
 
@Nasser seems unlikely:-)
 
@DavidCarlisle I did
{%
\catcode`\^^M=12
\endlinechar=`\^^M
\directlua{foo("\luatexluaescapestring{\unexpanded{
x=10;
y=20;
A=zeros(10);
s="this is string";
}}")}
}%
 
11:41 PM
oh are you using OT1 encoded fonts with luatex, not using fintspec to use opentype?
 
@DavidCarlisle I am using what I show there
\documentclass[11pt]{scrartcl}
\IfFileExists{luatex85.sty}
{\usepackage{luatex85}}{}
 
at the very least you need (untested)
{%
\catcode`\^^M=12 %%%%%%%%%
\endlinechar=`\^^M %%%%%%%%%%%%%%%
\directlua{foo("\luatexluaescapestring{\unexpanded{%%%%%%%%%%
x=10;
y=20;
A=zeros(10);
s="this is string";
}}")}%%%%%%%%%%
}%
 
@DavidCarlisle good that got ride of many of them, but there is still one there. I'll add more %%%%%
No, still one left. BUt I do not get what you did. Are you saying one needs to add %%%%% as many as there are lines?? I hope this is not what you mean :)
 
@Nasser if it's at the start, use tex.sprint not tex.print for the first line (see the version I used)
 
11:45 PM
@Nasser no one % is enough, I just drew your attention to the lines i changed
 
@DavidCarlisle ok, will try it now
 
@Nasser no it's at teh end so lose the final tex.print('')
 
Ok will do
@DavidCarlisle OMG! it finally works! You are Genius, I would never figured this group thing! Here is final result
Now I can send all my code fragments to LUA and add the correct wrapping depending on tex4ht mode or Latex mode much more easily.
Coding in LUA is so much easier than Latex.
I find I can do many things in Lua now instead of in Latex. For example, I have no need for the timedate package any more. I use lua and use os.date() to get everything I want.
 

« first day (2057 days earlier)      last day (2868 days later) »