What are the macros you guys use to speed up LaTeX-ing?

Click For Summary

Discussion Overview

The discussion revolves around suggestions for macros that can be used in LaTeX preambles to enhance efficiency when typesetting homework and reports. Participants share their experiences and techniques for speeding up the writing process, particularly when dealing with long equations and complex formatting.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • Some participants suggest creating a cheat sheet of common LaTeX symbols and phrases to facilitate quicker writing through copy and paste.
  • One participant mentions defining shortcuts for frequently used symbols and commands, such as using \lp for \left( and \w for wedge products.
  • Another participant shares an extensive list of custom macros for various mathematical symbols and operations, including definitions for common mathematical notations and operators.
  • There is a mention of using resources like arXiv to check the source of complex articles for inspiration on macros and formatting.
  • One participant expresses gratitude for the shared suggestions and notes that they have implemented some commands from another user's preamble while also creating their own.

Areas of Agreement / Disagreement

Participants generally agree on the usefulness of macros to speed up the LaTeX typesetting process, but there is no consensus on a single set of macros or methods, as different participants share varied approaches and preferences.

Contextual Notes

Some suggestions may depend on specific packages or configurations that are not universally applicable, and participants do not resolve which macros are most effective or necessary.

tesselate
Messages
7
Reaction score
0
Hello everyone!
I was wondering if you guys could suggest some macro-s that you use in your LaTeX preamble, to speed up typing up your homeworks/reports.
I think typesetting any report looks very professional, so I don't want to stop LaTeX-ing them. However, it does take a huge chunk of my day, to just type up long equations. I was wondering if you had any tips to share to speed up this process?
 
Physics news on Phys.org
You could make a one page cheat sheet of common latex symbols and phrases and then have both documents open when writing your report using copy and paste to compose your report.

This saves you a little time in looking up stuff or typing stuff.
 
tesselate said:
Hello everyone!
I was wondering if you guys could suggest some macro-s that you use in your LaTeX preamble, to speed up typing up your homeworks/reports.
I think typesetting any report looks very professional, so I don't want to stop LaTeX-ing them. However, it does take a huge chunk of my day, to just type up long equations. I was wondering if you had any tips to share to speed up this process?

You can check the source of some complex articles on arxiv to see how they go about long equations.

I sometimes define shortcuts like \lp to denote \left(, same for brackets and curly braces.
When I needed to write a lot of wedge products ##\wedge## I defined a shortcut \w.

Those are small things that can speed up your writing especially the macros for parentheses.
 
I use all of these:

Code:
\def\cA{{\cal A}}
\def\cB{{\cal B}}
\def\cC{{\cal C}}
% etc...

\def\CC{\mathbb{C}}
\def\RR{\mathbb{R}}
\def\PP{\mathbb{P}}
\def\ZZ{\mathbb{Z}}
\def\QQ{\mathbb{Q}}
\def\HH{\mathbb{H}}
\def\SS{\mathbb{S}}

\newcommand{\dd}{\mathrm{d}}                   % exterior d
\DeclareMathOperator*{\hodge}{\star}               % hodge star
\newcommand{\vol}{\mathrm{vol}}               % volume form
\DeclareMathOperator{\Lie}{\mathcal{L}}      % Lie derivative
\DeclareMathOperator*{\diag}{\mathrm{diag}}       % diagonal matrix
\DeclareMathOperator{\Span}{\mathrm{span}}       % span
\DeclareMathOperator{\ad}{\mathrm{ad}}           % Lie algebra adjoint
\DeclareMathOperator{\Ad}{\mathrm{Ad}}           % group adjoint
\DeclareMathOperator{\Ric}{\mathrm{Ric}}           % Ricci tensor
\DeclareMathOperator{\Rf}{\mathfrak{R}}           % Ricci form
\DeclareMathOperator{\into}{\raisebox{0.2ex}{\reflectbox{\rotatebox[origin=c]{180}{$\neg$}}}}
                                           % interior product
\DeclareMathOperator{\ins}{\iota}                   % insertion operator
\newcommand{\norm}[1]{{\lVert {#1} \rVert}}           % norm
\newcommand{\abs}[1]{{\lvert {#1} \rvert}}           % absolute value
\newcommand{\inprod}[2]{\langle {#1}, {#2} \rangle}
\newcommand{\binprod}[2]{\big \langle {#1}, \, {#2} \big \rangle}
\DeclareMathOperator{\codim}{codim}           % codimension
\DeclareMathOperator{\sign}{sign}               % signum
\DeclareMathOperator{\id}{\mathrm{id}}   % identity
\DeclareMathOperator{\lcm}{\mathrm{lcm}}       % least common multiple

% better overlines
\newcommand*\widebar[1]{%
   \mkern2.2mu%
   \overline{%
       \mkern-2.2mu%
       %\rule{0pt}{6pt}%
       {#1}%
       \mkern-1.8mu%
   }%
   \mkern1.8mu%
}

\usepackage{forloop}
\newcounter{ct}

% (-+++...) Minkowski signature
\newcommand{\mink}[1]{(\mathord{-} \forloop[-1]{ct}{#1}{\value{ct} > 1}{\, \mathord{+}})}

% (+++...) Euclidean signature
\newcommand{\eucl}[1]{(%
   \ifthenelse{#1 > 0}{%
       \mathord{+} \forloop[-1]{ct}{#1}{\value{ct} > 1}{\, \mathord{+}}%
   }{}%
)}

% generic (---...+++...) signature
\newcommand{\sig}[2]{(%
   \ifthenelse{#2 > 0}{%
       \mathord{-}  \forloop[-1]{ct}{#2}{\value{ct} > 1}{\, \mathord{-}}%
       \ifthenelse{#1 > 0}{\,}{}%
   }{}%
   \ifthenelse{#1 > 0}{%
       \mathord{+} \forloop[-1]{ct}{#1}{\value{ct} > 1}{\, \mathord{+}}%
   }{}%
)}

You're on your own for figuring out what packages might be required to access various symbols.
 
  • Like
Likes   Reactions: JorisL
Thank you for your suggestions! This will definitely cut down on time. I have implemented some of the commands from Ben Niehoff's preamble, and created some on my own. Also, looking at arxiv sources is my go-to place now if I come across something new.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 23 ·
Replies
23
Views
6K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 3 ·
Replies
3
Views
11K
  • · Replies 3 ·
Replies
3
Views
13K