last day (15 days later) » 

16:07
1
Q: pgf-pie alternative -- why doesn't it work?

JosephI came across a pgf-pie alternative presented as evidence that, according to its author, "TeX can do things that LaTeX can't". There is an error in it which I haven't been able to identify. Is it really true that "this is TeX and cannot be done in LaTeX"? \documentclass{article} \usepackage[utf...

You only need to load the positioning library, i.e. add \usetikzlibrary{positioning} to your preamble, since otherwise TikZ does not understand below right=\x *5 mm and 6 mm. Whether or not I would use \globaldefs and so on for this is a different question. You should ask some Italian pizza expert for this. ;-)
@DavidCarlisle Let's see what our Italian pizza experts say. Sorry, you are not trustable in these regards. ;-)
@DavidCarlisle, translated, it was said: "This macro would never be possible without TeX" (that is, if you use LaTeX, it is impossible).
@DavidCarlisle, in the context it did really mean that: "using LaTeX you cannot do it, therefore you must learn e-TeX/plain-TeX". It comes after a lengthy discussion on the superiority of TeX over LaTeX for some kind of project; when asked to provide an example of the said superiority and something that cannot be done in LaTeX, the macro author showed his code.
@marmot, really stupid of myself forgetting to include that library. It solves one part of the question -- I'm even thinking of deleting it altogether, but I'll wait for the comments on whether "this cannot be done with Latex".
You're welcome. However, I am not sure I understand what "with LaTeX" means. Of course, you can replace \newcount by \newcounter and work with \stepcounter, \setcounter and the like. Other than that, what do you expect from a LaTeX code? Yours is not TeX because it has \documentclass and so on in already.
@marmot, that's what was meant: the guy said there were no equivalent commands in Latex for his "plain TeX" "macro", i.e., that you cannot use LaTeX commands to do the same thing, which I thought was very suspicious. So if I can replace plain TeX macros with Latex ones for this example, the affirmation is plainly false, as I see.
I do not want to start a fight with a "guy" I do not know, but I do believe what you are saying is true. Again, I am not sure what "LaTeX but not TeX" precisely means. If it means "LaTeX but no TeX primitives" I think you are right.
16:07
@marmot, should I just delete this question, then? it's not really useful for other people. I'm not in the mood for replacing tex with latex macros either.
@Joseph I wouldn't say it is useless. As far as I can see you have achieved a nice alternative to pgf-pie, which is known to be hard to customize. I feel it can be super useful if you add a little bit of explanation what the different keys are good for and how it is to be used. I am struggling to understand constructions of the type \pgfkeys{/pizza/legenda-a/.style={/pizza/legenda}} but I must admit that I didn't try hard to understand them. Of course, I cannot exclude that others complain about you using TeX syntax.
it wasn't I who did it, but what could be complained about using TeX syntax? the objective of the code I came across was just to prove TeX syntax is superior and can achieve more.
@Joseph I do not know if I agree on this statement. After all you use a lot of LaTeX in your code. But I am not an expert, so it could be that there are things that require plain TeX or TeX primitives.
there was just a code snippet, not the full MWE, just this:
```
\makeatletter
\pgfkeys{/pizza/fatia/.style={}}
\pgfkeys{/pizza/legenda/.style={}}
\pgfkeys{/pizza/legenda-a/.style={/pizza/legenda}}
\pgfkeys{/pizza/legenda-b/.style={/pizza/legenda}}
\pgfkeys{/pizza/legenda-b/texto/.style={/pizza/legenda-b}}
\pgfkeys{/pizza/legenda-b/forma/.style={/pizza/legenda-b}}
%% inicio da definição de \pizza
\def\pizza{
\newcount\conta@fatias
\conta@fatias = -1
\def\soma@fatias{0}
\def\fatia[##1]##2##3;{
\globaldefs 1
\advance\conta@fatias by 1
% guardam as opções e texto da fatia:
sorry for taking your time -- I don't know if there are things that require primitives in this code, but I just found is suspicious because it was shown as evidence that plain TeX must be taught to university thesis classes authors, instead of LaTeX.
16:39
@Joseph That's all fine. I am not an expert on this so I would like to avoid to make a strong statement. But I guess a question of the type "Is there anything that can only be done in TeX but not in LaTeX" might get a lot of attention (or has already been asked).
 
1 hour later…
17:56
@marmot, i'm searching for a question like that. haven't found it yet -- perhaps it's not an adequate way to put it, but in general terms it's really intriguing and worthwhile to know. perhaps David Carlisle can answer, and I'll take his word for it!
18:18
I am really not an expert but perhaps tex.stackexchange.com/q/49/121799 comes close.

last day (15 days later) »