My favorite LaTeX Tricks to save time

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.ค. 2024
  • Get started with LaTeX using Overleaf: ► www.overleaf.com/?.... My thanks to Overleaf for sponsoring today's video.
    Check out the previous videos in my LaTeX playlist: ► • LaTeX Tutorials
    0:00 Getting Started
    0:28 New Commands
    1:58 Conditional Formatting
    4:23 Write your own package
    5:37 Multiple Files
    8:18 Tracking Changes
    9:25 Be Semantic
    12:31 Cleveref
    15:34 Template Files
    16:18 www.overleaf.com
    Today is all about my top tricks and tips to write efficiently in LaTeX. This video isn't going to change how your math documents look, but they will make it was easier to write them. We will see how to use
    ewcommand to replace long common expressions with short ones, see how to use if statements to conditionally format documents, put the preamble into an included style sheet, break your big project into multiple chapters, using Overleaf features like history and tracking changes, being semantic so you focus on meaning as opposed to formatting, and finally using template files.
    For more information on writing your own package as I briefly did in the video moving the preamble into its own package, check out a more detailed guide here: www.overleaf.com/learn/latex/...
    Check out my MATH MERCH line in collaboration with Beautiful Equations
    ►beautifulequations.net/pages/...
    COURSE PLAYLISTS:
    ►DISCRETE MATH: • Discrete Math (Full Co...
    ►LINEAR ALGEBRA: • Linear Algebra (Full C...
    ►CALCULUS I: • Calculus I (Limits, De...
    ► CALCULUS II: • Calculus II (Integrati...
    ►MULTIVARIABLE CALCULUS (Calc III): • Calculus III: Multivar...
    ►VECTOR CALCULUS (Calc IV) • Calculus IV: Vector Ca...
    ►DIFFERENTIAL EQUATIONS: • Ordinary Differential ...
    ►LAPLACE TRANSFORM: • Laplace Transforms and...
    ►GAME THEORY: • Game Theory
    OTHER PLAYLISTS:
    ► Learning Math Series
    • 5 Tips To Make Math Pr...
    ►Cool Math Series:
    • Cool Math Series
    BECOME A MEMBER:
    ►Join: / @drtrefor
    MATH BOOKS I LOVE (affilliate link):
    ► www.amazon.com/shop/treforbazett
    SOCIALS:
    ►Twitter (math based): / treforbazett
    ►TikTok: / drtrefor

ความคิดเห็น • 89

  • @DrTrefor
    @DrTrefor  ปีที่แล้ว +23

    What tricks to you all like for writing in LaTeX?

    • @PrakashKumar-wt9jk
      @PrakashKumar-wt9jk ปีที่แล้ว +4

      Sir how to write list of figure , list of table and list of content in centre?

    • @kevins407
      @kevins407 ปีที่แล้ว +1

      AutoHotKey is my winner.
      I have my preamble modularized and stored as AHK commands. So every time I have a project, I can quickly pick and choose which packages are helpful and can load them with a few quick keystrokes.
      I also have common commands (including graphics, enumerations, etc.) stored as AHK commands.

    • @FelipeBalbi
      @FelipeBalbi ปีที่แล้ว +2

      To make my life easier, I have setup a bunch of custom emacs snippets to expand to common blocks I use all the time.
      I also have a preamble.tex with all my favorite packages and custom tikz colors and styles. I just \input it on whatever new document. Maybe I should convert it into a style sheet

    • @marcoszukunft7104
      @marcoszukunft7104 ปีที่แล้ว

      Really good tricks. I always love the new command to save life. Specially for parentheses: \left( #1
      ight)

    • @richgold5503
      @richgold5503 ปีที่แล้ว

      Very succinct expo. Could you make a video on chemical structure and professional referencing like the Royal Society of Chemistry, please.

  • @jamesknapp64
    @jamesknapp64 ปีที่แล้ว +70

    As a math teacher at a small community college these have been a massive blessing. I've only ever been self taught with LaTex so this series has help make the notes look a LOT better.

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +9

      Thanks for sharing!

  • @martinopinto6323
    @martinopinto6323 ปีที่แล้ว +1

    Oh yes, a new LaTeX video ❤❤ So happy that Overleaf is supporting this!

  • @wjrasmussen666
    @wjrasmussen666 ปีที่แล้ว +5

    More LaTeX!!! Keep them coming.

    • @keira04
      @keira04 ปีที่แล้ว +1

      Agreed!!

  • @file4318
    @file4318 ปีที่แล้ว +1

    These tricks + vim + snippets = faster than by hand

  • @harvey_dent_1
    @harvey_dent_1 16 วันที่ผ่านมา +1

    Thank you soooo much for your awesome tutorial ... it was so helpful.

  • @MyStuffWH
    @MyStuffWH ปีที่แล้ว +18

    I commented on an earlier video that the overly positive tone on Overleaf functionalities was a bit tiring (especially if you are already an Overleaf user!). This video really struck a perfect balance between information and sponsorship, for a product that I really believe in. I really love your content. Keep up the good work!

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +3

      Thanks for sharing, it is a balance with paid partnerships for sure!

  • @fran9426
    @fran9426 ปีที่แล้ว +4

    Been using LaTeX for many years but this video was still very informative!!

  • @potterlover96
    @potterlover96 ปีที่แล้ว +2

    This is amazing! I used LaTeX for my Uni dissertation 5 years ago but barely used it since and I'm trying to get back into it, this has been a massive help!

  • @lucienkalmogo3448
    @lucienkalmogo3448 ปีที่แล้ว +1

    Really this is the best tutoriel about learning LateX on youtube. Thank you very much

  • @keira04
    @keira04 ปีที่แล้ว

    Thank you again! I've written about 10 homework assignments in LaTeX thanks to you, and I'm still learning and growing! :)

  • @2funky4u88
    @2funky4u88 ปีที่แล้ว +1

    this is really helpful, i just started writing my homework in latex this semester (third semester) and it really improved my overall style and made for better and much nicer looking solutions

  • @akashbanerjee8554
    @akashbanerjee8554 ปีที่แล้ว +3

    Great tricks, never knew we can use Latex in such clever ways. THANK YOU

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +3

      Happy to help!

  • @arshadjaveed7877
    @arshadjaveed7877 8 หลายเดือนก่อน +1

    Newcommand and cref are my favourites. Thanks for sharing

  • @mathsupgrade
    @mathsupgrade ปีที่แล้ว +16

    This came at such the right time! I've been learning latex thanks to your videos for the last few weeks. It's really fun and addictive!

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +2

      Great to hear!

  • @jorgebecerril2361
    @jorgebecerril2361 6 หลายเดือนก่อน

    WOW! Thanks for all the tips they are really awesome!

  • @MarcusWagnerBMW
    @MarcusWagnerBMW ปีที่แล้ว +1

    Amazing content, kep doing this, youre helping me so much

  • @JustinInBlack
    @JustinInBlack ปีที่แล้ว +1

    When I need it the most, you made a video about it!!! you are amazing sir!

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +2

      Glad I could help!

  • @PerEng2405
    @PerEng2405 8 หลายเดือนก่อน

    Brilliant tips.Thx.

  • @RSLT
    @RSLT ปีที่แล้ว +2

    Wow, great and time saver, Tricks.

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +2

      Glad you liked it

  • @putrawahyudi4825
    @putrawahyudi4825 ปีที่แล้ว +1

    Thank you, Sir. This video really help me out.

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +2

      Glad it helped!

  • @2003z440
    @2003z440 7 หลายเดือนก่อน

    If you haven't heard of it, I highly recommend the "exam" document class. It allows you to hide the solutions and format the blank spaces where students can answer.

  • @peterflom6878
    @peterflom6878 ปีที่แล้ว +1

    Very useful tips

  • @canal_interpolo
    @canal_interpolo ปีที่แล้ว +2

    Trefor, could you make a video showing how to incorporate Matlab code on LaTeX documents?

  • @kin_1997
    @kin_1997 ปีที่แล้ว

    oka you have got me hooked on LaTeX

  • @user-fh9rc3sy8c
    @user-fh9rc3sy8c ปีที่แล้ว

    Cleveref is worth is weight in gold thank you!

  • @FelipeBalbi
    @FelipeBalbi ปีที่แล้ว +3

    Cleveref seems to be super cool. I’ll start using it!
    If you’re looking for video ideas, I suggest a video focused on tikz graph drawing, perhaps also the fit library and tikz layers.
    To be honest, tikz is such a great package. It keeps impressing me over and over again even though I’ve used it for years 😅

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +1

      Great ideas! I've done a whole video on tikz, but truly that package is enormous with so many cool things.

  • @yash1152
    @yash1152 ปีที่แล้ว +1

    10:47 thanks a lot for showing concrete example for textit vs emph commands. nice :)

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +1

      You are welcome!

  • @gevillgar
    @gevillgar ปีที่แล้ว

    The \includeonly command was sooo useful to me while I was writing mi thesis

  • @hgfuhgvg
    @hgfuhgvg ปีที่แล้ว +2

    Overleaf is awesome

  • @matheusjahnke8643
    @matheusjahnke8643 ปีที่แล้ว +1

    Another comment about the "be semantic" topic: sometimes you don't have freedom to format.
    Sections must be centralized, enumerated with roman numerals, with specific size and all....
    If you were doing this "manually", It'd be quite the job. If you are lucky, the required format is available as a style or a class... so you just \section{stuff} and don't worry about it. (Frankly if you are doing it manually, just use a What-You See-Is-What-You-Get tool, there might even be a template with the format available).

  • @GeoffryGifari
    @GeoffryGifari ปีที่แล้ว +1

    Lol i wished i knew about all this when i first started writing in LaTeX. The kind of environment i'm in just let people dive in directly and learn on our own so inefficient writing is kind of normal, but i guess so far that's the best way to do it.
    Btw, on the "Be Semantic" section, it seems like there are these special commands that "understand" the intention of the writer (\emph,
    ewtheorem, etc) what other commands are there? do you happen to know a reference/keyword to search for this? and are there commands to be used outside the context of pure math (like physics)? Thanks!

  • @VitruvianSasquatch
    @VitruvianSasquatch ปีที่แล้ว +5

    Might seem odd, but I find the \qty command from the physics package a much cleaner way to do auto-sizing braces than the traditional \left(
    ight). Also comes with handy calculus commands.

    • @niuniujunwashere
      @niuniujunwashere ปีที่แล้ว +3

      indeed, \qty() would be a nice shorthand \left( and
      ight)! i would like to address one subtle detail about SPACING which might one day catch you by surprise (as it did me)...
      \qty creates an Ord atom (judging from the package source code) while \left ...
      ight creates an Inner atom, so in some cases you wouldn't get spaces for \qty where you normally would for \left ...
      ight. (for example, with "(2) \left(3
      ight)" you get a thin space between (2) and (3), but with "(2) \qty(3)" you have the two numbers glued together. same thing goes for \left(2
      ight) \left(3
      ight) and \qty(2) \qty(3). this EXTRA space is sometimes also undesirable-namely as the argument of a function-but i'll get into that shortly)
      likewise, \qty with a fixed size (like \qty\bigg) also creates an Ord atom (as it seems), unlike pairs like \biggl and \biggr which produce Open and Close atoms respectively (their definitions are essentially \mathopen\bigg and \mathclose\bigg). compare \gcd\qty\big(a, b) and \gcd\bigl(a, b\bigr) for instance (i intentionally picked an operator that is not overridden by physics). you'll see that a spurious thin space is added between \gcd and the parentheses produced by \qty, since TeX adds a thin space between Op and Ord atoms but doesn't between Op and Open atoms. (on a positive note, although \sin\qty(3) doesn't give the right spacing, \sin(3) does get the spacing right! though you would still need \bigl ...\bigr and the like for manual sizing since \sin simply doesn't see \bigl or (3) when you write \sin\bigl(3)...)
      i personally either use \bigl ...\bigr for a fixed-size argument or \mleft ...\mright defined by the mleftright package for a variable-size argument. in addition, as an alternative i STRONGLY recommend using \DeclarePairedDelimiter from the mathtools package since it takes care of spacing very VERY well. (i just learned while writing this that it ACTUALLY expands to \mathopen and \mathclose!! the implementation is hella complicated tho....) in this case you can write \DeclarePairedDelimiter\paren\lparen
      paren and replace \qty(...) with \paren*{...}, \qty\big(...) with \paren[\big]{...}, all while not getting ANY spurious space when writing stuff like \sin\paren{3} (even when a punctuation follows it!)
      spacing nuances are one of the reasons i don't use physics anymore, but whether or not you are going use it is completely up to you!

    • @VitruvianSasquatch
      @VitruvianSasquatch ปีที่แล้ว +3

      @@niuniujunwashere That's actually really good to know, thank you. I'll play with defining my own delimiters a bit.

    • @laufert7100
      @laufert7100 6 หลายเดือนก่อน

      Only problem is that I use the siunitx package that overwrites \qty. Is there a way to use both?

  • @davidvrba9
    @davidvrba9 ปีที่แล้ว +1

    Nice video, very helpful! While watching video question came up to my mind, can you ref. to equations in different .tex files that are included?

  • @captainchicky3744
    @captainchicky3744 10 หลายเดือนก่อน

    ngl exporting custum definitions to a .sty was a nice tip thanks lol

  • @xdevilwarrior
    @xdevilwarrior ปีที่แล้ว

    I can't wait for AI to finally erradicate Latex from the phase of the earth... but this is video is cool :3

  • @prabhjeetsingharora
    @prabhjeetsingharora ปีที่แล้ว

    Hello sir. If I want to use Eq. instead of eq. in my document using cleverref. Can you please shed help in this regard? Thank you for creating such videos.

  • @xrenynthemusicmage6422
    @xrenynthemusicmage6422 ปีที่แล้ว +1

    doesn't the autoref command from the hyperref package do the exact same thing as cleveref?

  • @matheusjahnke8643
    @matheusjahnke8643 ปีที่แล้ว

    About Cleveref... does it has an option to "link" to the equation?
    The
    ef{stuff} (the one not from Cleveref) makes the number clickable, if you do that, you can go to the equation, does Cleveref has something like that?

  • @markaustin3858
    @markaustin3858 ปีที่แล้ว +1

    Love the hoodie!! Where can I get one?

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +1

      I love that one too:D Beautifulequation.com!

  • @mikawatzel3272
    @mikawatzel3272 ปีที่แล้ว

    Hello Sir, thank you for these Tipps. Unfortunately cleveref doesn't load .... it promts me with "package not found". I've already tried different LaTex IED with the same error...
    Do you know something about that? Thank you very much.

  • @Adowrath
    @Adowrath 2 หลายเดือนก่อน

    Did you ever work with standalone, so the individual files can also be generated into a PDF on their own, not just as part of the whole document? Especially with subimport, I've found it quite useful to write multi-part documents/my thesis documentations.

  • @dominicellis1867
    @dominicellis1867 ปีที่แล้ว

    Do you have an intro video on latex, I’m a math teacher but I’ve never used it. I make all my assignments on paper or drawing apps and copy them. Apparently it takes for ever.

  • @noob_techie2475
    @noob_techie2475 ปีที่แล้ว

    Off topic but can you please recomment a good book to get a refresher learn more on euclidean geometry, and basic of all common shapes like ellipse, parabola etc.

  • @peterflom6878
    @peterflom6878 ปีที่แล้ว

    Is there a transcript available?

  • @amolrupakheti7828
    @amolrupakheti7828 10 หลายเดือนก่อน

    Is there some way to import a table from one .tex file to another .tex file

  • @bungaIowbill
    @bungaIowbill ปีที่แล้ว +1

    This is a great video. I have used LaTeX for over ten years now and actually didn't know about Cleveref, and while I knew about conditional formatting, I actually never bothered to learn how it works... And the fact that you don't need brackets around the name of
    ewcommands? My life has been a lie!
    Regarding Cleveref: my preference is to capitalize the cross-reference names, which can be done with \usepackage[capitalize]{cleveref}. However, I would also like it to behave as \eqref when referring to equations, i.e., not write out the word "equation" at all, but just its number in parentheses. Does anyone happen to know of a quick way to get this behavior?

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +1

      Ha! Probably better practice to include {
      ame} to be honest, but no you don't technically need it for a single parameter thing. Nice note about cleverref. I do believe it can be customized as you suggested but don't know exactly how off the top of my head.

  • @wjrasmussen666
    @wjrasmussen666 ปีที่แล้ว

    Dr Trefor Bazett have you deleted some playlists? I thought you had many more playlists....

  • @roberttelarket4934
    @roberttelarket4934 ปีที่แล้ว

    I love your sweat shirt with EAT SLEEP MVTH REPEAT

  • @realunderachiever
    @realunderachiever ปีที่แล้ว

    Question. Can you include a video file in your latex presentation, let's say that presentation is made using beamer? I' ve tried a lot of different stuff and it doesn't work.

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +1

      Not directly. The output traditionally is a pdf and video isn't part of the .pdf format. A beamer presentation is just a pdf. However, there are some things like I think one is called ximera that use latex to make say an html page that can include video.

  • @ademusmeal9058
    @ademusmeal9058 10 หลายเดือนก่อน

    How to get latex format? dr.

  • @Mr.AIFella
    @Mr.AIFella ปีที่แล้ว

    One thing I couldn't make it perfect, even with the help of ChatGPT. I was trying to have two figures (flowcharts) next to each other and the table set next to them. I spent whole night but I gave up😢. I did it easily in word by making the figures to set inside tables.

  • @lutherlessor4029
    @lutherlessor4029 ปีที่แล้ว +1

    "Squiggly Brackets">"Braces"

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +3

      haha, I intellectually know people call them braces but refuse to do so:D

  • @YousafAli-ge9ip
    @YousafAli-ge9ip 10 หลายเดือนก่อน

    😂😂😂

  • @airman122469
    @airman122469 ปีที่แล้ว

    Anyone else here not like Overleaf?
    I personally like having my files local, and not on someone else’s machine. I also like being able to craft my own LaTex environment. Am I alone in this?

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว

      I think this is also totally fine. I did my entire PhD locally, for instance. Especially if you are using things like GitHub for versioning/collaboration, but it depends a bit of personal preference and ease of doing things imo:/

  • @Argletrough
    @Argletrough 8 หลายเดือนก่อน

    you can omit the brackets in the first trick: \pd z x

  • @gateronblackinksv2173
    @gateronblackinksv2173 ปีที่แล้ว

    If you want to do it even faster, you have to switch away from overleaf to something like vim. Vim snippets are so nice and they save so so so much time

  • @floppy8568
    @floppy8568 ปีที่แล้ว

    mforallth