LaTeX Pros and Cons

Discussion in 'Math' started by WBahn, May 26, 2015.

  1. WBahn

    Thread Starter Moderator

    Mar 31, 2012
    17,736
    4,789
    MOD NOTE: This was originally an off-topic set of posts in the following thread:

    http://forum.allaboutcircuits.com/threads/cubic-formula-theory.111624/

    As such, there is some content here that applies to the context of that thread and might be confusing without that context.


    Try:

    [tex]\cos\left ( \phi \right ) [/tex]


    \cos\left ( \phi  \right )

    The problem is that when you just have text ("cos" in this case) in a Latex equation weird things can happen. But most of the common functions it can deal with as "\cos".

    Another option is to mark the "cos" in a "\text" tag.


    [tex]\text{cos}\left ( \phi \right ) [/tex]


    \text{cos}\left ( \phi  \right )

    Personally, and this is pure personal preference, I like leaving a space prior to escape characters and also munching the parens together:


    [tex] \cos \left( \phi \right) [/tex]


    Also, in most cases you can actually leave the 'left' and 'right' out. I think I have encountered situations in which they are needed, but I actually haven't been able to come up with one recently.


    [tex] \cos \( \phi \) [/tex]


     \cos \( \phi  \)
     
    Last edited: May 31, 2015
  2. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    Thank you Wbahn, for your thoughts on LaTex.

    I have a deep rooted objection to bending knee to a machine.

    I was brought up in the days of 'ergonomic design'.

    Machines should be designed (as far as practicable) to offer controls that present their function(s) in the most usable manner, including, but not limited to,
    layout of those controls in a manner designed to guide the user.

    Latex does not conform to these characteristics.

    I was using codecogs since I am away from my normal latex generator at the moment.
     
  3. MrAl

    Well-Known Member

    Jun 17, 2014
    2,425
    490
    Hi,

    When i first saw Latex i thought it was great -- finally a way to type math equations and have them look normal. But then the reality set in. Website Latex engines would break down, people couldnt read the equations anymore, etc.

    So i use it now and then just for the fun of it really, but i have learned over time that the best way to show the equation if you are going to use Latex, is to show the equation using both Latex and also an ordinary text line like a=b+c/d. That way if anything goes wrong with the Latex line (and it will) the reader can always fall back on the regular plain text line.
    Things may change drastically in the future too which could make Latex unreadable, so the text line would still be there. Imagine a nicely written and laid out post on some interesting topic, but nobody can read the equations anymore. An additional text line fixes this and doesnt take many more bytes in most cases.
     
    Last edited: Jun 1, 2015
  4. WBahn

    Thread Starter Moderator

    Mar 31, 2012
    17,736
    4,789
    I don't have any fundamental issue with doing it this way (and I acknowledge the benefits). I would point out that there are some disadvantages.

    First, it's like the man with two watches -- he never knows for sure what time it is. If the ordinary text equation and the LaTex equation aren't in agreement, then which one should be used? The flip side is that if it's just a typo, then the fact that there is disagreement brings out that fact (like an error detecting code). The man with one watch "knows" what time it is even if that time is wrong.

    Second, text equations are notorious for being presented incorrectly and misinterpreted. For instance, I can't even begin to count the number of times I've seen a=b+c/d when the person meant it to be a=(b+c)/d. In general, that's less likely to happen in LaTex (or other typeset presentation).

    An alternative I used to use (and still use on my website since I don't have a LaTex engine) is to typeset the equation in Word (which actually has -- though it isn't as nice as it used to be -- a pretty user friendly equation editor with fairly decent typesetting) and then do a screen capture to make the equation an image file.

    Third, the presentation of more complex stuff in text can get very cumbersome, especially where you don't have good control over spacing and such, whereas LaTex allows for a much nicer and easier to grasp presentation (and, of course, code that is even harder to read directly).

    Fourth, I don't think we have to worry too much about LaTex code becoming unreadable in the future. It is, after all, just text. So there will always be people more than willing to develop translators to go from LaTex to whatever might take its place. It's like worrying about not being able to read ASCII text files because the world is moving to Unicode.
     
  5. MrAl

    Well-Known Member

    Jun 17, 2014
    2,425
    490
    Hi again,

    Yes, some very good points. There are different ways of looking at it and to do an error analysis we'd have to consider lots of possible cases.

    When this happens (lots of possible cases which may contain errors) i always believe that more information is always better than less. Let me give a quick example...
    Say we have again the simple:
    a=b+c/d

    We can have two variations of this simpler example:
    a=b+c/d
    a=(b+c)/d

    Now regardless which one is the correct one (the true intended equation for the post) if they only write one and they made a mistake, we'd have to guess what they meant. But if they write two (making a mistake in only one) then we can see that something is wrong right away and either query for the correct form, or try both methods and see which one works.
    This gets even more interesting as the formulas get more complicated, where guessing is almost impossible without knowing the underlying theory so that we can go back over every detail of every step in the development of the formula.
    I stress this because it has happened to me too many times already. I read something off the web, and it's either wrong or incomplete, and there is no second source anywhere to be found. That leaves me with hours of rework sometimes.
    Granted they could make a mistake in both formulas, but when mistakes are made they are usually random, and so the chances of making the same mistake in both formulas is more remote, and this gives us a chance to piece together the correct parts, some from the first and some from the second.
    It is true however that a properly formatted Latex might reveal errors more easily due to the correlation to the way we usually like to write out math expressions.

    There is another advantage of using plain text too like a=b+c/d or a=(b+c)/d and that is that we can copy and paste this immediately into an automated solving program like that which is found on Wolfram. With the latex im not sure if any software can handle that, but even if it can i think more software would be able to handle the text version than the Latex version.

    It's nice to see a properly formatted Latex presentation though, i have to agree with that. It is a matter of personal choice i guess. In favor of Latex, the engines have gotten more reliable i think.

    Back to the original topic:
    I wanted to post a full example of using the formulas i posted but i just didnt get to that yet. Maybe sometime today.
     
    Last edited: May 28, 2015
  6. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    You folks do realize LaTex is translated into a graphics file for display purposes?
     
  7. The Electrician

    AAC Fanatic!

    Oct 9, 2007
    2,281
    326
    When you say "That way if anything goes wrong with the Latex line (and it will) the reader can always fall back on the regular plain text line.", what do you think is going to go wrong with the Latex line that couldn't also go wrong with the text line?

    I don't think things are going to change drastically in the future to make Latex unreadable. The whole point of TeX is to have a stable system. As they say at: http://en.wikipedia.org/wiki/TeX

    "TeX was designed with two main goals in mind: to allow anybody to produce high-quality books using a reasonably minimal amount of effort, and to provide a system that would give exactly the same results on all computers, at any point in time."

    Further: "Even though Donald Knuth himself has suggested a few areas in which TeX could have been improved, he indicated that he firmly believes that having an unchanged system that will produce the same output now and in the future is more important than introducing new features."

    TeX isn't going to go away for time scales that matter to this forum.

    Latex can give much improved readability to huge mathematical expressions such as those in this post: http://forum.allaboutcircuits.com/t...nding-of-transformer-help.105099/#post-799340
     
  8. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    I weep for the death of good quality engineering.

    Since the result is supposed to be the same on all computers, have you any idea what happened in my post#5?

    The formula looked perfect on the LaTex generator.
     
  9. The Electrician

    AAC Fanatic!

    Oct 9, 2007
    2,281
    326
    I think WBahn explained it, didn't he?

    Maybe I don't understand what you mean by "LaTex generator"; do you mean something other than what happens here when you post LaTex? Is there another site where you composed your LaTex?
     
  10. MrAl

    Well-Known Member

    Jun 17, 2014
    2,425
    490
    Hello again,

    I am sure you make some valid points, but it's just an opinionated argument anyway. What you are talking about is the ideal situation, where everything goes right all the time, and we know from experience that it simply does not. Having redundancy, even if nothing else, helps reduce the overall errors. This is evident in life critical technologies. Sure this isnt life threatening, but if you've ever gotten a formula that you really wanted to use only to find out it is not correct, you probably wished there was a second source. I proposed that the second source be right in the same text as the original, where the redundancy could help eek out the correct formula in the event of an error in either one.
    Also, and this comes up too, is there a way to copy and past Latex into a formula editor and have it spit out a form suitable for any program that can use that formula to calculate real results? I used computer programs that need text input lots of times, and unless i can find a Latex to Plain Text converter i'm shot, and it must work correctly too.

    From experience i have seen the Latex engines go down and it could last for a few weeks. In the mean time nobody could read the posts. Maybe that has improved though over the years, and i hope so.

    It's also very very hard to put a time limit on the life of the data presented to this forum from various sources. Who knows who will still want to read it 100 years from now, or read it on a secondary server 100 years from now. I cant say, you cant say either. And Donald wont be alive and someone will have taken his place with their own ideals and thus ideas about how Latex should or shouldnt be done.

    The main point is that Latex is a much more complicated system then plain ordinary text. There are many programs that can read plain text because they are more basic in structure and have been around for a long time. I dont believe that there is a more universal media format than plain text.

    I should add that plain text with repeated text strings can be converted into much more neater forms after aggregating some of the similar strings. So your text formulas you provided could be greatly simplified. Actually, same with the Latex ones :)
    Most of the formulas we talk about are much simpler anyway so i dont think the solution to a third degree equation is a good example. If we wanted to exaggerate we could post the solution to the quartic :)
     
  11. The Electrician

    AAC Fanatic!

    Oct 9, 2007
    2,281
    326
    We've drifted away from the OP's topic, but I'm going to respond once more to your argument in favor of plain text formulas.

    Well, of course it is. Your argument is also opinionated, isn't it? Opinions are allowed as long as the discussion is civil.

    Then why didn't you provide a second mode of display for the huge formulas in this post: http://forum.allaboutcircuits.com/t...nding-of-transformer-help.105099/#post-799340
    Wouldn't you agree that really big formulas are more likely to incur errors?

    This is rare, and if a person is really worried about it, they can post dual formats as you proposed above.

    I don't agree that LaTex is much more complicated; I think that adjective is too strong. This forum has a sticky thread with a LaTeX tutorial for the beginner, and many people post with it, so apparently it's not overly burdensome.

    Yes, computers can read plain text; there's no argument there, but people can't read huge formulas in plain text. It's impossible to keep track of the multiple levels of parentheses without printing it out on paper and drawing lines connecting pairs of parentheses when the formula is many lines of single-spaced text, each the full width of the page.

    The main point I'm trying to make is that you lose your audience when you post huge formulas in text, because they're huge, and doubly so because they're in text. I think the readers skip over huge symbolic formulas whether in text, or in standard mathematical notation, but much more so in plain text. I avoid posting huge symbolic formulas because I think they rarely lead to insight about the problem at hand. Modern mathematical programs allow finding a symbolic solution to problems where in the past it just wouldn't have been feasible. One is impressed by the result but gets no insight. I occasionally post such a thing just for the amazement factor, and to show how practically useless it is.

    Professor Middlebrook did some work about the problem of dealing with the huge expressions (he called them "high entropy") that often result from analysis of even relatively simple circuits with more than, say, 4 nodes: http://ardem.com/whatis_D_OA.asp

    I'm suggesting that there's usually little utility in posting huge formulas, especially in plain text that goes on for many single-spaced lines.

    It would be interesting to have a poll to find out what the readers prefer: if huge formulas are posted, would they prefer them in LaTeX or plain text--or maybe no huge formulas at all.

    I can see at a glance where there are repeated strings in the LaTex version of the cubic solution; it takes much more than a glance to find the repeated strings in the plain text. The issue I'm raising is human readability, not whether a particular expression could be simplified.
    .
    And simpler formulas are less difficult to format in LaTex, and therefore there is correspondingly less reason not to use LaTeX; the cubic solution is an example of a not-so-simple formula (also the topic of the thread) adequate to show the greater readability of LaTeX compared to plain text.

    We could post the solution to the quartic, but your post: http://forum.allaboutcircuits.com/t...nding-of-transformer-help.105099/#post-799340 provides a perfect example of formulas that are especially not simple.

    Edit: An alternative to creating LaTeX expressions would be to do what WBahn mentioned, and which I do also. Create your mathematics in some other software and capture a screen shot of the expressions in standard mathematical format, then attach that image to your post.

    I always do this for any but the simplest expressions. LaTeX looks nice, but no nicer that the standard mathematical format from Mathematica.
     
    Last edited: May 30, 2015
  12. WBahn

    Thread Starter Moderator

    Mar 31, 2012
    17,736
    4,789
    LaTeX definitely has some peculiarities. And it is not the case that all rendering engines output the same graphics for the same input. I think that the MimeTeX engine that is used by this forum produces substantially poorer output than the engine I used when I did my dissertation (don't recall which one it was, but it was a free one). But MimeTeX is good enough for anything that is likely needed here.
     
  13. MrAl

    Well-Known Member

    Jun 17, 2014
    2,425
    490

    Hi again,

    I think you are arguing For/Against, while i am arguing For/For. I am in favor of using BOTH forms to help reduce errors.
    Latex for the readability, Plain Text for the redundancy and ability to copy and paste into almost any other math application.
    I wanted to read your Middlebrook link but it did not take me to the issue of very long expressions, which i wanted to find out what he had to say about that. Perhaps you can sum that up.
    If you look at your cubic solution in Latex, you can read that as a human, but that's about all you can do with it. This may change in the future but right now that's it i think. With the text lines, as long as they are, i can copy and past all of them in less than 10 seconds into my program and start calculating solutions by the 10's of thousands at a time in less than 30 seconds.
    So all i am saying is that both forms have their pro's and con's, and having both i think is better, and that is really my preference.

    Back to main topic:
    I intended to show an example using the lines i presented in a previous post, but still have not done this and so i have to apologize about this. I also have a shorter form for the solution set which i'll post probably as a graphic. I just have to get a chance to do this.
     
  14. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    Thank you, WBahn for making the effort to split this off.

    My comments were not a complaint about this site, indeed this is the sort of place where we could be discussing making things better.

    It should be perfectly possible to have available keys with mathematical symbols, greek characters, and formatting instructions in this day and age.

    I should not need to mess about with LaTex, or other markup language, that is a job for a machine.

    So why are we the technical whizzkids not demanding such be made available?
     
  15. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,802
    832
    First, neither tex nor plain text equations is going to help the poster who doesn't understand the following:
    a = b+c/d ≠ (b+c)/d
    This is fourth grade maths here and I have seen hundreds of Internet memes which prove my point.

    Here's another
    SCI_FacebookMath.jpg

    The text equation is ?=6/2(1+2). (I couldn't find the obelus symbol or division symbol, either on the forum or on Windows 7; not to say that it isn't there, but I couldn't find it. Which is an example of a point later in my post.)
    What do you get for an answer, without looking below...

    .
    .
    .
    Or how about this form:

     \color{blue} ?=\frac {6} {2(1+2)
    What did you get for the answer to the this equation? 9? 1? Did you change your mind seeing the tex equation?

    Secondly, I have to respectively disagree with studiot. The power of tex is that it allows for clear expression of many terms, fractions are clear, parentheses can visually show what the contain, integrals and sums are explicit., exponents are raised and not dependent on interpreting a non-standard character, transcendental functions and constants can be represented directly.

    Specifically addressing the display of those special charcters - each platform may display them differently; LaTex attempts to standardize their display.

    As a 'tool", it is exactly what a computer does well. I don't find using tex awkward. I write out my text equation and then insert appropriate tex directives.

    Just my 3 cents (inflation) ;)
     
    Last edited: May 31, 2015
  16. KeepItSimpleStupid

    Well-Known Member

    Mar 4, 2014
    1,143
    203
  17. bertus

    Administrator

    Apr 5, 2008
    15,647
    2,346
  18. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    All you youngsters miss the point entirely.
     
  19. MrAl

    Well-Known Member

    Jun 17, 2014
    2,425
    490
    Hi,

    Nice to see this new thread. Very nice, thanks.

    My main point is that redundancy is a good thing. Very little will help the uneducated so i dont think this should be able that. If they dont know the difference between 6/(2*3) and 6/2*3 then nothing will help them, so it's not about Latex or non Latex anymore. This thread is about "To Latex or not To Latex" if you will, or maybe to use Latex or plain text, or both.
    With most formulas we deal with on here and in many places on the web we usually have somewhat simpler formulas so it doesnt take much more to post a second line in plain text. It's always going to be up to the individual though.
     
  20. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    Not to me it's not.
     
Loading...