From 10181a2e7d17af7c3908cb47e9bd9deff5fe8c78 Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Fri, 27 Jun 2025 10:45:10 -0700 Subject: Add universal LaTeX notes template - Universal template.tex for any course - VSCode LaTeX Workshop configuration - LaTeX .gitignore for auxiliary files - Cursor.md for AI assistant context --- .gitignore | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++ .vscode/settings.json | 50 ++++++++++++++ cursor.md | 118 +++++++++++++++++++++++++++++++++ template.tex | 110 +++++++++++++++++++++++++++++++ 4 files changed, 457 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 cursor.md create mode 100644 template.tex diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bfe6b5b --- /dev/null +++ b/.gitignore @@ -0,0 +1,179 @@ +# LaTeX auxiliary files +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +# LaTeX intermediate files +*.dvi +*.xdv +*-converted-to.* + +# LaTeX biblatex +*.bcf +*.blg +*.bbl +*.run.xml + +# LaTeX build files +*.fdb_latexmk +*.synctex.gz +*.synctex(busy) +*.pdfsync + +# LaTeX index files +*.idx +*.ilg +*.ind +*.ist + +# LaTeX glossary files +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs +*.lzo +*.lzs + +# LaTeX beamer files +*.nav +*.pre +*.snm +*.vrb + +# LaTeX algorithm2e +*.alg +*.loa + +# LaTeX achemso +acs-*.bib + +# LaTeX amsthm +*.thm + +# LaTeX beamer +*.nav +*.pre +*.snm +*.vrb + +# LaTeX changes +*.soc + +# LaTeX cprotect +*.cpt + +# LaTeX endfloat +*.ttt +*.fff + +# LaTeX fancyhdr +*.fancyhdr + +# LaTeX hyperref +*.figlist +*.makefile +*.xref + +# LaTeX listings +*.lol + +# LaTeX minted +_minted* +*.pyg + +# LaTeX morewrites +*.mw + +# LaTeX nomencl +*.nlg +*.nlo +*.nls + +# LaTeX pax +*.pax + +# LaTeX pdfpages +*.pdf_tex + +# LaTeX sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# LaTeX scrwfile +*.wrt + +# LaTeX sympy +*.upa +*.upb + +# LaTeX TikZ & PGF +*.auxlock +*.figlist +*.makefile +*.xref + +# LaTeX todonotes +*.tdo + +# LaTeX xindy +*.xdy + +# LaTeX xypic +*.xyc + +# LaTeX latexmk +*.fdb_latexmk + +# LaTeX pythontex +*.pytxcode +pythontex-files-*/ + +# LaTeX thmtools +*.loe + +# LaTeX Asymptote +*.asy +*.pre + +# LaTeX WinEdt +*.bak +*.sav + +# LaTeX LyX +*.lyx~ + +# LaTeX Kile +*.kilepr + +# macOS specific +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Editor specific (keep .vscode/ for LaTeX Workshop config) +.idea/ +*.swp +*.swo +*~ + +# Backup files +*~ +*.backup +*.bak +*.orig \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7c5561d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,50 @@ +{ + "latex-workshop.latex.tools": [ + { + "name": "latexmk", + "command": "/Library/TeX/texbin/latexmk", + "args": [ + "-synctex=1", + "-interaction=nonstopmode", + "-file-line-error", + "-pdf", + "-outdir=%OUTDIR%", + "%DOC%" + ], + "env": { + "PATH": "/Library/TeX/texbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" + } + }, + { + "name": "pdflatex", + "command": "/Library/TeX/texbin/pdflatex", + "args": [ + "-synctex=1", + "-interaction=nonstopmode", + "-file-line-error", + "%DOC%" + ], + "env": { + "PATH": "/Library/TeX/texbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" + } + } + ], + "latex-workshop.latex.recipes": [ + { + "name": "latexmk 🔃", + "tools": [ + "latexmk" + ] + }, + { + "name": "pdflatex ➞ pdflatex", + "tools": [ + "pdflatex", + "pdflatex" + ] + } + ], + "latex-workshop.view.pdf.viewer": "tab", + "latex-workshop.latex.autoClean.run": "onBuilt", + "latex-workshop.latex.autoBuild.run": "onFileChange" +} \ No newline at end of file diff --git a/cursor.md b/cursor.md new file mode 100644 index 0000000..c01da85 --- /dev/null +++ b/cursor.md @@ -0,0 +1,118 @@ +# Cursor AI Project Context + +## 📚 Project Overview +This is a **Universal LaTeX Academic Notes Template** repository. This template provides an optimized LaTeX structure for creating academic notes across different courses and subjects. + +## 🎯 Purpose +- **Template-based**: Reusable LaTeX structure for consistent note-taking +- **Multi-course**: Adaptable for any academic subject +- **Math-friendly**: Pre-configured for mathematical formulas and algorithms +- **Optimized Layout**: Compact margins and spacing for maximum content density + +## 📁 File Structure +``` +course-notes/ +├── template.tex # Main LaTeX template file +├── .gitignore # LaTeX build files exclusions +├── .vscode/ +│ └── settings.json # VSCode LaTeX Workshop configuration +├── cursor.md # This file - AI context +├── README.md # Human-readable documentation +└── [date-folders]/ # Individual lecture notes (e.g., 2025-01-15/) + ├── [date]-notes.tex # Lecture-specific notes + ├── [date]-notes.pdf # Compiled PDF + └── images/ # Lecture images/diagrams +``` + +## 🔧 Technical Configuration + +### LaTeX Setup +- **Engine**: pdflatex (preferred) or latexmk +- **Packages**: amsmath, amsfonts, amssymb, graphicx, geometry, setspace +- **Page Layout**: 1.5cm margins, 0.9 line spacing for compactness +- **Math Mode**: Display equations `\[ \]`, inline math `$ $` + +### VSCode Integration +- **Extension**: LaTeX Workshop +- **Auto-build**: Enabled on file save +- **Auto-clean**: Removes auxiliary files after build +- **PDF Viewer**: Integrated tab viewer + +## 📝 Usage Patterns + +### Creating New Notes +1. Copy `template.tex` to `YYYY-MM-DD/YYYY-MM-DD-notes.tex` +2. Update title: `[Course Code] Notes - [Topic/Date]` +3. Replace placeholder content with lecture material +4. Build with pdflatex or use VSCode auto-build + +### Content Structure +- **Definitions**: Use `\textbf{Term:}` followed by explanation +- **Mathematical Formulas**: Display mode for key equations +- **Algorithms**: Numbered enumerate environment +- **Key Insights**: Bold formatting for important points +- **Examples**: Step-by-step calculations with intermediate steps + +### Common LaTeX Patterns +```latex +% Key definitions +\textbf{Definition:} Explanation here + +% Mathematical formulas +\[ +\text{Formula} = \sum_{i=1}^{n} x_i +\] + +% Algorithms +\begin{enumerate} + \item Step 1: Initialize... + \item Step 2: While condition... + \item Step 3: Return result +\end{enumerate} + +% Including images +\begin{figure}[h] +\centering +\includegraphics[width=0.8\textwidth]{image-name.png} +\caption{Description} +\end{figure} +``` + +## 🎓 Academic Contexts +This template works well for various subjects: +- **Mathematics**: Proofs, theorems, problem solutions +- **Computer Science**: Algorithms, data structures, complexity analysis +- **Physics**: Equations, derivations, experimental procedures +- **Engineering**: Technical specifications, design processes +- **Economics**: Models, formulas, statistical analysis + +## 🤖 AI Assistant Guidelines + +### When helping with this project: +1. **LaTeX Focus**: Prioritize LaTeX syntax and mathematical formatting +2. **Subject Agnostic**: Adapt to any academic discipline +3. **Template Consistency**: Maintain the established structure and style +4. **Compact Layout**: Favor dense, information-rich formatting +5. **Mathematical Precision**: Ensure correct mathematical notation +6. **Build Process**: Always test compilation after changes + +### Common Tasks: +- Converting handwritten/text notes to structured LaTeX +- Adding mathematical formulas and algorithms +- Including and formatting diagrams/images +- Organizing content into logical sections +- Optimizing layout for readability and compactness + +### File Organization: +- Each lecture/topic gets its own dated folder +- Images and diagrams in subfolder +- Maintain consistent naming: `YYYY-MM-DD-notes.tex` +- Git workflow: commit after each completed lecture + +## 🔄 Workflow Integration +- **Version Control**: Git with meaningful commit messages +- **Build System**: LaTeX Workshop with auto-compilation +- **PDF Generation**: Immediate feedback with integrated viewer +- **Template Updates**: Propagate improvements across all notes + +This template is optimized for academic efficiency and AI-assisted note-taking across all subjects! \ No newline at end of file diff --git a/template.tex b/template.tex new file mode 100644 index 0000000..284b635 --- /dev/null +++ b/template.tex @@ -0,0 +1,110 @@ +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage[margin=1.5cm, top=2cm, bottom=2cm]{geometry} +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{graphicx} +\usepackage{setspace} +\setstretch{0.9} + +\title{[Course Code] Notes - [Topic/Date]} +\author{Your Name} +\date{\today} + +\begin{document} + +\maketitle + +\section{Section Title} + +Brief introduction or overview of the topic. + +\subsection{Definitions} +\textbf{Key Term:} Definition here + +\textbf{Mathematical Definition:} +\[ +\text{Formula} = \mathbb{E}_{(x,y) \sim D}[L(h(x), y)] +\] + +\subsection{Important Concepts} +\begin{itemize} + \item \textbf{Point 1:} Description with math $\theta$ + \item \textbf{Point 2:} Another important concept + \item \textbf{Point 3:} Final key point +\end{itemize} + +\section{Mathematical Derivations} + +\subsection{Step-by-Step Process} +Starting from the basic equation: +\[ +f(x) = ax + b +\] + +Taking the derivative: +\[ +\frac{df}{dx} = a +\] + +\textbf{Result:} The derivative is constant. + +\subsection{Example Calculation} +Given data points $(x_1, y_1), (x_2, y_2), \ldots, (x_n, y_n)$: + +\textbf{Step 1:} Calculate the mean +\[ +\bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_i +\] + +\textbf{Step 2:} Expanding the sum: +\[ += \frac{1}{n}[x_1 + x_2 + \ldots + x_n] +\] + +\section{Algorithms} + +\subsection{Algorithm Name} +\textbf{Input:} Data, parameters, etc. + +\textbf{Algorithm:} +\begin{enumerate} + \item Initialize parameters $\theta = 0$ + \item While not converged: + \begin{itemize} + \item Update: $\theta := \theta - \alpha \nabla J(\theta)$ + \item Check convergence: $|J(\theta^{(t+1)}) - J(\theta^{(t)})| < \epsilon$ + \end{itemize} + \item Return $\hat{\theta}$ +\end{enumerate} + +\textbf{Output:} Optimized parameters + +\section{Visual Elements} + +\subsection{Including Figures} +% Uncomment and modify as needed: +% \begin{figure}[h] +% \centering +% \includegraphics[width=0.8\textwidth]{your-image.png} +% \caption{Your caption here} +% \end{figure} + +\subsection{Key Insights} +\textbf{Important Note:} Always remember that... + +\textbf{Practical Tip:} In practice, you should... + +\section{Summary} + +\textbf{Main Takeaways:} +\begin{itemize} + \item Summary point 1 + \item Summary point 2 + \item Summary point 3 +\end{itemize} + +\textbf{Next Steps:} What to study next... + +\end{document} \ No newline at end of file -- cgit v1.2.3