Technical Word processor with maths ?

12346

Comments

  • Reply 101 of 131
    kalikali Posts: 634member
    Quote:

    Originally posted by PB

    Documentation on boxes.



    You can try something like



    {\\setlength{\\fboxsep}{1cm}\\makebox[\\textwidth]{\\framebox{$your equation$}}}



    \\fboxsep is the space \\framebox will leave around the equation. In the example, 1cm may be a little too much. You can have variable values of \\fboxsep accross equations.







    It didn't worked well. I also tried the other suggestion but it gives an ugly thing. Is there something to declare in the header ?
  • Reply 102 of 131
    kalikali Posts: 634member
    Another thing :



    When I make several equations, one on top of the other and all linked by an equality, I want them to align to the equality (to the left). By default, LaTeX center all the equation, like this (the stars are necessary here, other wise the equs will be aligned to the equality !!!) :



    **************a = b + c - d



    **********= gamma * sigma - bc



    ****************= d + g



    I want this :



    a = b + c - d



    * = gamma * sigma - bc



    * = d + g



    How can I do that ?
  • Reply 103 of 131
    kickahakickaha Posts: 8,760member
    eqnarray



    \\begin{eqnarray}

    a & = & c\\\\

    & = & d + 4\\\\

    x & < & 13 \\cos(y)

    \\end{eqnarray}



    This uses the array coding style to align everything based on the second column. Note the lack of anything in the first column in the second row. That's legal.
  • Reply 104 of 131
    kalikali Posts: 634member
    Quote:

    Originally posted by Kickaha

    eqnarray



    \\begin{eqnarray}

    a & = & c\\\\

    & = & d + 4\\\\

    x & < & 13 \\cos(y)

    \\end{eqnarray}



    This uses the array coding style to align everything based on the second column. Note the lack of anything in the first column in the second row. That's legal.




    I just tried it. It works, but the spacing is too wide, and there is an equ. number for each line, which is too much and useless.
  • Reply 105 of 131
    kickahakickaha Posts: 8,760member
    Anytime you see an environment, like eqnarray, that adds equation/section/figure numbers, tack a * on the end, and you get the non-numbered form.



    And you can adjust the spacing as we already pointed out.



    \\begin{eqnarray*}

    a & = & c\\\\

    & = & d + 4\\\\

    x & < & 13 \\cos(y)

    \\end{eqnarray*}





    So which books do you have on order to learn LaTeX?
  • Reply 106 of 131
    kalikali Posts: 634member
    Quote:

    Originally posted by Kickaha

    Anytime you see an environment, like eqnarray, that adds equation/section/figure numbers, tack a * on the end, and you get the non-numbered form.



    And you can adjust the spacing as we already pointed out.



    \\begin{eqnarray*}

    a & = & c\\\\

    & = & d + 4\\\\

    x & < & 13 \\cos(y)

    \\end{eqnarray*}





    So which books do you have on order to learn LaTeX?




    This is better, but I don't like the spacing on each side of the =.



    Which books ? I dunno yet. In the past 10 years, I made three large books on theoretical physics. One about Classical Mechanics, one about Quantum Mechanics, and a bigger one on Relativity Theory (Special Relativity, Classical Field Theory, Gauge Theory and General Relativity). The first one is about 200 pages. The second one is about 500 pages, and the bigger one is about 1000 pages. They were never published (not yet). They all were made in Nisus with Expressionist. Last year, I moved to OS X and it became necessary to update my writing tools (and all my documents !). I want to publish the bigger book, or a part of it.



    Since the last days, I'm experiencing LaTeX for the first time. To make the exercice more interesting, I'm updating the first book (the smaller one, on Classical Mechanics). I do lots of copy/paste from Nisus to TeXShop. I already made a document of about 30 pages, full of equations and figures. It's nice, but I don't like much the spacings. I still have to tweak the code. Maybe someone here could be interested in seeing the source code (it's all in French, sorry) ?
  • Reply 107 of 131
    kalikali Posts: 634member
    What is the default font used in LaTeX, for the main text and what is the font used for the greek in the mathematical expressions ? I like these.
  • Reply 108 of 131
    pbpb Posts: 4,255member
    Quote:

    Originally posted by Kali

    What is the default font used in LaTeX, for the main text and what is the font used for the greek in the mathematical expressions ? I like these.



    The main document uses the cmr family, Computer Modern Roman; the greek in the equations are from cmmi, Computer Modern Math Italics.
  • Reply 109 of 131
    pbpb Posts: 4,255member
    Quote:

    Originally posted by Kali

    It didn't worked well.



    Could you be please a little more explicit? I don't see where is the problem.
  • Reply 110 of 131
    pbpb Posts: 4,255member
    Quote:

    Originally posted by Kali

    I just tried it. It works, but the spacing is too wide, and there is an equ. number for each line, which is too much and useless.



    You can tell which equations take a number and which not. For example,



    \\begin{eqnarray}

    a & = & c \

    onumber \\\\

    & = & d + 4 \

    onumber \\\\

    x & < & 13 \\cos(y)

    \\end{eqnarray}



    will eliminate numbering from the first and the second ones, while the third one will normally take its number.



    As for spacing: when you have many aligned equations, you have to leave more space, just to make the content more readable and show more clearly the alignment. That's how displayed equations should be shown, and LaTeX takes automatically care of that. Now if you want, for some reason, reduce the spacing, you can declare something like:



    \\begin{eqnarray}

    a\\kern-5pt & = &\\kern-5pt c \

    onumber \\\\

    \\kern-5pt & = &\\kern-5pt d + 4 \

    onumber \\\\

    x\\kern-5pt & < &\\kern-5pt 13 \\cos(y)

    \\end{eqnarray}



    This will reduce spacing in both sides by 5 points. Obviously each equation can have its own spacing, if needed, and you can have asymetric spacing (left with respect to right) too.
  • Reply 111 of 131
    kalikali Posts: 634member
    Quote:

    Originally posted by PB

    Could you be please a little more explicit? I don't see where is the problem.





    Sorry, I made several typos error in my code. Now it works but :



    I typed this :



    {\\setlength{\\fboxsep}{1cm}\\makebox[\\textwidth]{\\framebox{$your equation$}}}



    It works, but I need to adjust visually spacing. 1 cm is much too wide. But if I type this :



    \\begin{equation}

    {\\setlength{\\fboxsep}{0.25cm}\\makebox[\\textwidth]{\\framebox{a=b}}}

    \\end{equation}



    then the equation number is misplaced. Too low. Not centered.



    When I used the other suggestion for a box, it gave me a box with a misplaced equation number (inside the box !?? YUK!) and the equation appeared all squeezed. Ugly as a butt.



    Expressionist suggested me this code, which works (but...) :



    \\begin{equation}

    \\vbox{\\hrule\\hbox{\\vrule$\\ \\matrix{\\ \\cr

    \\mit U(r)=-{GMm \\over r}\\cr

    \

    m \\ \\cr}\\ $\\vrule}\\hrule}

    \\end{equation}



    I understand nothing of this code, except that in Expressionist I made a small matrix with a single column with three rows (for spacing), placed and empty space on each row and the equation in the middle. That way, spacing is looking nice (don't forget Expressionist and MathEQ are WYSIWYG math editor).
  • Reply 112 of 131
    pbpb Posts: 4,255member
    Quote:

    Originally posted by Kali

    I typed this :



    {\\setlength{\\fboxsep}{1cm}\\makebox[\\textwidth]{\\framebox{$your equation$}}}



    It works, but I need to adjust visually spacing. 1 cm is much too wide. But if I type this :



    \\begin{equation}

    {\\setlength{\\fboxsep}{0.25cm}\\makebox[\\textwidth]{\\framebox{a=b}}}

    \\end{equation}



    then the equation number is misplaced. Too low. Not centered.







    My bad. Just remove completely the \\textwidth. Your code should be



    \\begin{equation}

    {\\setlength{\\fboxsep}{0.25cm}\\makebox{\\framebo x{a=b}}}

    \\end{equation}
  • Reply 113 of 131
    kalikali Posts: 634member
    Quote:

    Originally posted by PB

    My bad. Just remove completely the \\textwidth. Your code should be



    \\begin{equation}

    {\\setlength{\\fboxsep}{0.25cm}\\makebox{\\framebo x{a=b}}}

    \\end{equation}




    Sorry. I made a mistake again. It works perfectly now. Thanks.
  • Reply 114 of 131
    kalikali Posts: 634member
    But why do I have to interfere constantly to adjust spacing everywhere ? LaTeX isn't supposed to free our thinking from layout and presentation ? I find myself constantly adding \\vspace{0.25 in} between some paragraphs to adjust manually spacing, after compilation, just because compilation is giving me bad placements. Very often, text is too close from equations. I want a constant spacing between equations and text. Is there a command for that too ? Even with a book, I can't memorize all those commands, and I can't predict the results. This is frustrating.
  • Reply 115 of 131
    kickahakickaha Posts: 8,760member
    You're over thinking it, most likely.



    All those spacings have names, and you can set each one of them individually to address the whole document at one shot.



    Or, it could be that you simply don't care for the default spacings in LaTeX. Personally, I think it's the best thing out there, and I rarely, if ever, adjust spacings. But then, I'm used to the form in my journals and such. It looks 'right' to me.





    Seriously, get a basic book like those listed in here, and you'll be much happier. Those various adjustments are some of the first things you learn.
  • Reply 116 of 131
    kalikali Posts: 634member
    I have (again) other requirements on my text :



    1-I want constant spacing between paragraphs.

    2-I want constant spacing between text and equations.

    3-How can I type a small sentence (text) and a centered equation on the same line ? Example :



    And here we have************a = b - c.



    Not this :



    And here we have

    ******************************a = b - c.



    4-How can I place a figure anywhere on a page ? I don't want it to appears on top of the page only. What should I add to this code :



    ****text of paragraph #1 *********



    \\begin{figure}

    \\centerline {

    \\includegraphics[width=2.75in]{Fig1}

    }

    \\caption{L'espace-temps newtonien.} \\label{espace-temps}

    \\end{figure}

    \\vspace{0.25 in}



    ****text of paragraph #2 *********



    so the figure appears BETWEEN paragraphs #1 and #2 ? Not on top of the page.
  • Reply 117 of 131
    kickahakickaha Posts: 8,760member
    Quote:

    Originally posted by Kali

    I have (again) other requirements on my text :



    1-I want constant spacing between paragraphs.

    2-I want constant spacing between text and equations.

    3-How can I type a small sentence (text) and a centered equation on the same line ? Example :



    And here we have************a = b - c.



    Not this :



    And here we have

    ******************************a = b - c.





    $eq here$ is short hand for 'in-place' math. Try:



    And here we have \\hfill $a = b - c$.



    Quote:

    4-How can I place a figure anywhere on a page ? I don't want it to appears on top of the page only. What should I add to this code :





    \\begin{figure}[h]

    \\centerline {

    \\includegraphics[width=2.75in]{Fig1}

    }

    \\caption{L'espace-temps newtonien.} \\label{espace-temps}

    \\end{figure}

    \\vspace{0.25 in}



    The [h] means here. You can give several options in a row, and it will attempt to comply in that order. So [htb] would mean 'try here first, then the top of a page, then the bottom'.
  • Reply 118 of 131
    kalikali Posts: 634member
    Quote:

    Originally posted by Kickaha

    \\begin{figure}[h]

    \\centerline {

    \\includegraphics[width=2.75in]{Fig1}

    }

    \\caption{L'espace-temps newtonien.} \\label{espace-temps}

    \\end{figure}

    \\vspace{0.25 in}



    The [h] means here. You can give several options in a row, and it will attempt to comply in that order. So [htb] would mean 'try here first, then the top of a page, then the bottom'.




    This is very hard to control and predict. I've tried it and, very often, the figure appears randomly elswhere. I've found myself to tweak the text and the paragraphs spacement so the figure appears exactly where I want. Actually, I found myself "fighting" the system (LaTeX) too much. This isn't normal. I guess I'm trying to work the old way, the wrong way with LaTeX. But then, what is the book template I should use ? I'm really confused here.

  • Reply 119 of 131
    kickahakickaha Posts: 8,760member
    The figure actually follows a well-defined deterministic placement algorithm, not random. It's explained quite well in several texts on LaTeX.



    First off, don't do *ANY* tweaking until you have *ALL* your text and figures and equations in there in their *FINAL* form. Remember, content, not format. I've literally had a change from a three-letter to a four-letter word bump a document from 10pgs to 10.5. Get that *content* right, and then, and *ONLY* then start thinking about flow and format. Often times you'll find yourself fighting LaTeX because you keep thinking "Dammit, I *just* put that where I wanted it, and now it moved it!" Resist that. Resist it hard. This is not a word processor or manual layout system, this is an automatic typographical 'compiler'.



    Yeah, it's quite different, and a lot of people get up in arms over it because it isn't Word- or Pagemaker-esque. It's better.



    For one thing, if you see systematic changes you'd like to make (such as paragraph spacing), do *NOT* make adjustments per paragraph... you'll go insane. Find the setting for *that particular* spacing, and adjust it there. Clean, simple, fast.



    LaTeX isn't something that you can learn in a night or two by asking questions on a forum. Buy a recommended text. Really. That's the best advice any of us can give you. You'll find that it has more than you expected, and that it's easier than you might think.
  • Reply 120 of 131
    Quote:

    Originally posted by Kali

    This is very hard to control and predict. I've tried it and, very often, the figure appears randomly elswhere. I've found myself to tweak the text and the paragraphs spacement so the figure appears exactly where I want. Actually, I found myself "fighting" the system (LaTeX) too much. This isn't normal. I guess I'm trying to work the old way, the wrong way with LaTeX. But then, what is the book template I should use ? I'm really confused here.





    I had a very similar experience fighting LaTeX's system of floats when I first used it several years ago. In my case I was writing a "how to" guide that included a high ratio of images to text. LaTeX seemed to deal with this by just putting the images in a series every couple of pages or so. The overall effect was reminiscent of those very old books that print graphics on special "plates" inserted in amongst the standard pages.



    Enough griping. Anyone who has a robust general purpose solution to this will have my gratitude as well as Kali's.
Sign In or Register to comment.