How I Format My Homeworks in LaTex
Vložit
- čas přidán 8. 11. 2018
- I've been doing all my homework in LaTex, and figured I'd show you how I format the homework. Pretty straight forward, as I said I'm sure there's better ways to go about it so be sure to check the comment section for peoples input.
This link isn't a video, but really is all you need to learn how to install LaTex.
Installing texstudio on Windows:
www.wellesley.edu/lts/techsup... - Zábava
Hey Andrew, here's some of the LaTeX tips I've picked up from my math department.
First, if you use \begin{align}, it acts just like \begin{equation} but you can align things without having to call the {split} environment.
If you want the equation to not be numbered, you can just put a star in the environment declaration. E.g. \begin{equation*} or \begin{align*}
Don't use align for single line equations though out of habit
@@TRex266 Just curious, why not?
@@tylerweitzel7768 when you have a short equation. e.g. E=mc^2, the equation environment will reduce the space between the line above and your equation if possible, align doesn't do that. Try it out :)
Do you now what's the difference between begin{equation*}... and /{... ?
I always use the IEEEeqnarray from the IEEEtrantools package to format multiple equations. It is the best, trust me. Give it a try. You can have no number by just adding
onumber at the end of the row, or have subequations, and align all the equations' equals.
You don't like wide margins? But then where are you going to write the proof?
Okay fermat. Stinky boomer
Where are you supposed to not have enough space for your truly marvelous proof, without the narrow margins?
Your teacher must be really good for you to care about having such a wonderful homework format.
Oh I do it for my benefit, not theirs.I’d much rather read a latex document when I’m reviewing for an exam than whatever I scratch on a piece of paper
@@AndrewDotsonvideos oh okay that makes more sense HAHA
@@nestycb6702 he replied a comment on a video that was uploaded 2 years ago
You should follow David Mermin's advice and number EVERY equation. Just because you think an equation isn't important enough to be numbered doesn't mean someone else thinks the same thing. And if for some reason you find yourself needing to reference an 'unimportant' equation when showing this to someone, it's really awkward to say "the one equation below the second paragraph under equation 26."
this, i accidently submitted a paper before without numbering each equation and was embarrased as all hell when i got it back, cuz prof said he aint gonna be searching for my shit if it aint labeled right. ref commands on latex are a must
Goku17yen I mean he has a point, but nonetheless, that’s a pretty stuck up thing to say
You can just add the number to that equation later when you need it...
My TA said that you should only number an equation if you're going to reference it in the text. That's it.
@@Moreoverover I disagree with the opinion of your TA, and this is advice I've gotten from professors. Look up "What's Wrong With These Equations?" by David Mermin, in which the author provides some advice on how to incorporate equations into scientific writing, offering a few rules on the matter and including the rule I mentioned in my comment (he calls it "Fisher's Rule"). It's full of good advice, but here's a relevant segment:
For although you, dear author, may
have no need to refer in your text to the equations you therefore left unnumbered, it is presumptuous to assume the same disposition in your readers. And though you may well have acquired the solipsistic habit of writing under the assumption that you will have no readers at all, you are wrong. There is always the referee. The referee may desire to make reference to equations that you did not. Beyond that, should fortune smile upon you and others actually have occasion to mention your analysis in papers of their own, they will not think the better of you for forcing them into such locutions as "the second equation after (3.21)" or "the third unnumbered equation from the top in the left-hand column on p. 2485." Even should you solipsistically choose to publish in a journal both unrefereed and unread, you might subsequently desire (just for the record) to publish an erratum, the graceful flow of which could only be ensured if you had adhered to Fisher's rule in your original manuscript.
Why am I here when I no longer do homework and I've already written a 432 page book in latex?
Idk David, why are you here?
did i ask
@@gtrigwell4058 no but who cares
Because you want attention
Answer: because you're bored.
What I think the comment on not using newcommand is that you are defining one command per bases vector effectively making three commands for what it should be just one with an option to tell it wich vector it is. So for example if you use:
ewcommand{\bvec}[1]{\hat{e}_#1} and then called with \bvec{x} you can replace x with anything, making it much more flexible and useful.
Thanks for this, didn't know you could do this.
Actually, the way LaTeX parses things, you could write \bvec x (i.e. space instead of curly brackets) and get the same result! Saves some key strokes
@@klassjostedt ... At the cost of readability. Sure, you can also write \frac ab and save even more keystrokes, but it takes a lot more thought to decipher that than the simple yet easy-to-understand \frac{a}{b}.
Readability vs. conciseness is a constant debate in programming, but I think LaTeX is concise enough as is.
@@realwermos who's gonna read latex markdown after you've rendered it successfully? unless you want readability for the unfortunate case when you forgot to add a curly brace somewhere, and can't find where
@@Koospa In this case, you're probably right. It doesn't really matter.
But in general, I would say that it's best not to skimp on the curly brackets because they not only help the reader understand what's going on where, it helps you find the portion of code where you messed up on faster.
Also, the mismatched curly brace thing isn't really a problem because in TeXMaker, the matching curly braces are highlighted. In the video, you can see that TeXStudio does the same thing. The only time that would matter is if you decide to go with a bare bones editor like Notepad or something.
Use the Physics Package, trust me, it super good.
I second this
Yesss
I'm sad I just hear about this
Been using latex for a while, but never heard that. What is it?
Adam Fattal A blessing. Look it up and you’ll find a wonderful world.
For problem numbers, I use \begin{enumerate}
\end{enumerate},
and to shrink the margins, I use \usepackage{fullpage}.
Also, you can make a .sty file with all your packages and commands and input it on every new document via \input{/filelocation/foo.sty}.
Hope this helps!
Why did I not think of just creating a sty file...
You can also \ProvidesPackage in your *.sty, put it under LaTeX packages directory, run texhash and just \usepackage.
Just starting my physics major, definitely going to start using LaTex in the future! Appreciate the vid!
I feel like if I were to hand in my homework like this, my prof would think I just downloaded the document off the internet and renamed it lol
I mean
If its a good teacher, he would take his time to read the document and verify its yours
If its some half-assed one, good luck
@@dxrbkn5145 Wait, your saying good teachers do exist?
For your homework, you may wish to try TeXmacs.
Today was like the first day i used latex and I'm super satisfied with what I did. This video was of so much help.
Andrew doesn’t know how to take dot products confirmed 😂😅
As always just one person manage to score on the left of the curve, I won't say his name, but everyone knows it's Andrew.
whew im teaching the basics to myself rn and you got me really confused 😅
I'm starting physics in like three weeks and I never heard of this before 😅 time to do some reading!
Good luck !
I learned this existed 2 months into studying physics. Don't worry, if you haven't already, you'll get there fast.
TeXmacs, the killer app for math homework
Right, I would love a tutorial on TeXmacs!
Thanks for showing us how you do it! Honestly your format looks nice and I can't wait to use some of the tips!!!
If there are packages and patterns you end up using a lot, I sugest you make yourself a style file (.sty). The syntax is a bit different so you'll have to look it up but it's quite the time saver.
Also, I don't know either why someone bothered you with newcommand but I do have a tip for your usecase: You can incorporate arguments in newcommand by adding a set of square brackets. Here's an example:
ewcommand{\eh}[1]{\hat{e}_#1} You can now use \eh{x} as an alternative to \ehx and \eh{y} as an alternative to \ehy. I just think it feels more elegant.
Put $...$ around every 'x' in the normal text to format it correctly as a physical quantity/variable.
For single characters, this is probably enough, but it's more robust (and less error-prone) to do inline math with \(...\) instead of $...$.
This a great. Thx everyone for the really useful advice. I'm a total latex noon so all of this info is super useful.
My discrete mathematics professor just told us we would get a bonus point on our homework (out of 10 points) if we formatted it in LaTeX, and I immedataly remembered this video. Might fuck around and try it out, it might be even more useful in the future.
Man that date trick really saved me
just make a fresh document the day you have to hand the homework in and copy paste all your questions in, then flex on everyone because you did all your homework in a few hours
You can put any kind of date as an argument
I once made a beamer template in the CI layout of our university. A heck of a work, but worth it. Especially if you use LaTeX to write your reports which you have to present afterwards.
The reason why I did this?
They messed up with the slide master in their template. And I like the toc at the side of the slides, so I made my own style sheet for the beamer slides.
Hey Andrew, kinda small but if you write in bold, italics, or underline a lot (I do for labeling solutions) ctrl+b, ctrl+u or ctrl+I will auto insert the \textbf, \textit, etc commands in most latex environments. Also custom environments changed my life.
\section{Problem 1} produces 1. Problem 1
\section*{Problem 1} produces Problem 1
I used to hate wide margins, until I discovered the tufte-latex package. It gives a 1.5 column layout where you can use the margins for figures and footnotes, which is really useful
I am also a LaTeX learner, but I found VSCode + LaTeX Workshop + Github the interface for me. VS Code is modern, it shows the expected text in real time as tips, it has the feature of PDF in browser synced and update everytime you save, and you can commit every change and keep a record of changes or collaborate.
I recently started doing my calc 3 homework in latex too! Its really cool and fun
Yo Andrew in one of your previous video I saw in the background that you a have a binder. I was wondering if you can show us how you organize your stuff in it and the types of organization strategies you use.
One thing to note is that most symbolic packages output latex math code. mathematica and emacs calc will convert any statement to code for latex, making it easy to copy and paste results into a paper.
You're my hero Andrew
To have multiple lines in the equation or multiple equations in the same place, consider using IEEEeqnarray from IEEEtrantools package. It is very versatile and more convenient to use.
Took me like one month or two to get the basics but god damn my shit looks BEAUTIFUL
It may be bothersome at first and more if you leave your assigments to the last possible hour... (I struggled a lot with bibtex) but holyyyyyy God damn man its the best.
I wish I knew about this since highschool
Hey Andrew, give a shot to LyX and make a video on that. You will surely love that. I use that for all my reports and papers.
I always do my hw in Latex too. It looking so pretty must always give me extra points.
I've been doing all of my (admittedly simple) homework in plaintext, (drawing ascii graphs is fun :p) but this looks super cool, I've never seen anyone do something like that before for some reason.
You draw your graphs using ascii symbols?😂😂
@@justgame5508 I do indeed haha. Simple ones, just sketch graphs of course.
Could you also do a video on how to do this for more involved subjects such as QFT or particle physics? One would require to draw diagrams and write a lot of integrals and Lagrangians. Will that still be economic over handwritten solutions? (You will have to solve it by hand anyway unless you cheat and use Mathematica or something :P)
I know this videos like a year old but it just got recommended to me which is weird because I'm in my 3rd year of an aerospace engineering undergrad and I just started investigating LaTeX for doing my aerodynamics homework and lab reports(damn google creeping on us). I haven't taken the plunge into the full on editors yet, mostly been using LaTeX to write equations in Word as it has an equation interpreter, but this showed how simple it can be so I might give it a try, just need to figure out how to insert pictures and diagrams...
For pictures, use \includegraphics. For diagrams, you can \usepackage{tikz}, but tikz comes with the caveat that it's a bear to learn.
@@andrew_ray On Windows, TikzEdt is an amazing editor of TikZ pictures with auto-recompile, so you see what you are drawing with your code.
Also, you need like 5% of TikZ to start and do most of what you need.
I'm no way near understanding advanced TikZ, but even the basic one is plenty useful. And you can slowly add to your repertoire.
I was wondering, do physicists or students use Microsoft word to write their homework’s or research papers, or other programs like Latex?
I've also been doing my homework and even retyping up my handwritten notes in LaTeX! Here's an example of my quantum homework I just turned in! drive.google.com/open?id=1M1SbXnrlpCdGsXesYh9ynB_Us9F5P_L_ also, for doing equations, you can also use the double money sign, $$ whatever your equation is $$, thats what I typically do, doesn't include a number either.
I didn't know the new command function... nice!
hi im new to this, what is the software shown here to write Latex?
When I do my homeworks' in LaTeX I like to use the exam environment. I feel like it makes things a lot easy
I'm brand new to LaTeX,
I would like to know how to make an email, with blue color and with hyperlink as MS Word is making it?
Thanks
i litterally just started learning latex on overleaf
Doing a follow up vidya in a few months once you've incorporated some of the ideas that folks have shared here would be mint.
Great video, thanks alot!
Thanks a lot for video! How do it... Create document with data as result of working my program and export variables to LaTeX document. And when I will change my program and get new data, variables automatically will change in document.
Ya we get it Andrew, Equation 69.
Looks like CodeBlocks or Dev-C++ environment
I think I can get used to it and make my equations look beautiful.
I am super late to this party, but to whomever it may concern: _don't_ reduce the margins. The wide margins seem like a waste of space and look weird if you are accustomed to e.g. Word, but they are correct typographic margins, determined by centuries of trial and error. The "white/black" balance and the shorter line length makes the text much more readable. It takes some time to get used to, but after that it's just wonderful.
For equations this could be more flexible than the align environment, and can be placed as a method
\begingroup
enewcommand{\arraystretch}{2}
\begin{equation}
\label{ecuacion_uno}
\begin{array}{>{\displaystyle}r >{\displaystyle}l}
F &= m a
\end{array}
\end{equation}
\endgroup
hi! what software do you and general academic group use for pictures?
TikZ
Does anyone know exactly what TeX editor he uses? I downloaded the one he linked in the description but it looks nothing like his.
Texstudio
this dude knows what he's doing in life
h
If you use a text editor with snippet support, all those new command aliases you made won't be necessary. I use vim with ultisnips but you might prefer VSCode. You can also get a live update of your document so you don't have to recompile.
Andrew I don't remember the name of it, but there is software that lets you transcribe images and screenshots of latex into actual latex code.
detexify.kirelabs.org/classify.html
That font gave me PTSD from calculus exams.
Hey Andrew, I just installed Miktex from your link, but my toolbar doesn't have all your nice stuff. For example, I see that you got the Structure tab showing your working directory, which would be nice for quickly moving files.
Use overleaf, everything works out of the box, if you dont want to spent hours configuring the software on your PC. I remember I spent half a day once till I made it work in vscode like I wanted.
Nice pauli matrix you got there.
How do you remove the number in front of the section and subsection headings?
Use \section* and \subsection*
The reason why it is showing your new command as an error is that TexStudio does not recognkze it as a valid command. You can change that by adding it in the custom highlights options, I think
are those tensor notes class notes? if so, how r u managing to do them on latex. or maybe u just copying your handwritten stuff onto latex? hmm
also ive been just using stnadard physics packag, and its been going great so far, so i dont need multiple ones, cuz ima forget what i use lol
No, they're for my videos on tensor calc. Which I haven't forgotten about! I just haven't had the time to iron everything out lately.
ahh that makes much more sense
What's your laptop model
In Germany studying CS we're actually required to submit pretty much all our coursework as latex
But I always do it in markdown and then compile it to latex and no one will ever know muahahahaahaha
genius
What a madman you are!
I bet, you even wrote your programs to output data in LaTeX format didn't you!
Damn tables and their '&' separation!
tried to find whether somebody had already mentioned it, however, didn't see anything .. a way to create equations with no number you can add a * to the word equation: \begin{equation*} content \end{equation*} .. not sure, tho, whether the end equation needs a * as well. the * also works when you want to suppress section numbering \section*{Section Title}
use \begin{eqnarray} or \begin{eqnarray*} if you want multiple lines
and are you still including twice?
Markdown FTW !!
Hi. You might just make a new environment, say, "Problem". So that when you reference it (using \cref), it appears as "Problem 69" instead of "Section 69".
Also I recommend using the physics package.
You could use
ewtheorem{prob}[section]{Problem}
For creating a new command called '\prob' which would print 'problem' before your problem
Also, why do you have the braket package twice?
one for each ket vector
jk I didn't know I did
Good job
I must learn LaTeX for my Research Project for my university's last semester, but I can't let go of Macrohard Onfire (Microsoft Office). Ours first semester they told us to start learning about styling and equations, and simply can't see why I should use LaTeX over a WYSIWIG editor like Office 2019.
The math typesetting in TeX is way way more slick than what you get in MS Office. Plus packages. Not to mention, when you get to the point where you will be submitting scientific papers to journals or for conferences they will mostly ask that you submit a manuscript in TeX.
@@johnconrad4439 Admittedly, the current versions of MS Office does accept LaTeX equation syntax.
That said, you can do so much more quality typesetting with less work in LaTeX, especially if you need math (equation numbering is a glaring point that's done oh-so-much-better in LaTeX) or longer texts (think Master's thesis).
Also, as was mentioned - the packages and personal macros can easily be a gamechanger.
And don't even let me started on the ever-deeper rabbit hole that is TikZ for beautiful, directly-inset diagrams and graphics.
@@Alche_mist MS Office does accept latex syntax but would you say the quality of the output is the same?
@@johnconrad4439 The quality of a single equation? Yes.
The quality of the whole document? Nope. No way. Especially in case of larger documents that tend to break in MS Office too easily even if you use all the "anti-breakage" tools it offers.
its definitely useful. but i wouldn't use it for homework, unless my goal is to learn it. otherwise the homworks will take waaaaaay too long and that's time I could make more use of
Thanks for you
Hi Andrew, did you try TeXmacs for your homework? Idea for a new video :-?
U could try using vs code instaed of tex studio it looks better and it has nice plugins for latex
why import braket twice?
I've used LaTex before but using Lyx is even easier. I've been using it for my homework for the past few weeks or so and it's amazing. Like using Word for LaTex.
andrew pls vid on how to set this up
do yourself a favor and use emacs org-mode which has great LaTex support. or use vim. it will boost your productivity.
You can use \section*{} to hide the number.
Instead of using _"\textbf{Solution} …"_ you can use _"\paragraph{Solution} …"_ instead, in case you want to have better semantics in your document. Or make it a subsection* for that matter.
How do you do feynman diagrams in latex?
you'd have to give a look to the TikZ package
Nicely explained here:
www.overleaf.com/learn/latex/feynman_diagrams
Hello,how can I enter a vector symbol.
The most common way is probably *\vec{x}* for the vector _x_ .
My friend: Why were you formating like that, are you stupid?
Me : I am
Starting now first month in uni🧐
How is going? And what are you studying?
you should bold your e since it is a vector
Does anyone know how to adjust headers font size?
\setlength\headheight{15 pt} in the preamble should set it to 15 pt
@@evancarpenter thank you but I mean the headers of the sections, eg: 1. Introduction. Do you know how to adjust its font size?
Phương Ngân ah, the only way I know to change font size would be with \documentclass[FONT SIZE HERE]{article}
Or
The geometry package
thank you very much
Lol... Juts elegant--- the mathematics!
Did you mess up the inner product?🤔
Ciccio&Bombo lol I sure did! I accidentally wrote the dot product of each basis vector with its self. I guess I knew what I meant to write because a would still be the answer
@@AndrewDotsonvideos would you not get a+2? Each unit vector squared give you 1.
My proudest achievement in LaTeX was drawing this coupled harmonic oscillator diagram:
pastebin.com/5dfTyJYP
You can even adjust the angle and spring tension to your liking.
Why wasn't the author "ya boi" though? :/
WhY dOnT u UsE MiCRoSoFT wOrD
How and where did you learn this? I'm trying to get started using Latex but dont know where to start.
you could start with overleaf to get used to it's really easy to use
www.overleaf.com/
I don't want to spam it, but I just want to mention my comment on your video about doing your homework in LaTex. I don't actually have any experience with LaTex, but I think what I said there may help your writing be a little prettier.
3:30 nice
If you don't want an equation to have a number just use \begin{equation*}
I have the same laptop :D
This guy funny af, he should start a CZcams channel or something.
Yeah maybe one day if he’s consistent enough, he can reach a point where he’s severely obnoxious and over-rated
great
Didn't watch the whole video, but I am here to say if you don't use Latex to write reports or do homework then you're a square. All the cool kids use Latex.
LaTeX is awesome and free, let's just stop cracking Microsoft Word just to write documents ^^
There is also TeXmacs...