texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.74k stars 344 forks source link

Laggy typing in a specific paragraph of document, fine everywhere else #3388

Closed jan-niku closed 9 months ago

jan-niku commented 9 months ago

Environment

Expected behavior

Typing is equally responsive throughout the entire document.

Actual behavior

Typing is laggy in one specific paragraph, but fine everywhere else.

How to reproduce

I assume that just typing in this section (the current paragraph in cauchy riemann equations) should reproduce this behavior, hopefully!

`\documentclass{CSM}

% used for a gpt diagram, if ur reading this maybe can delete! \usepackage{pgfplots} \usetikzlibrary{arrows.meta}

\author{my name} \title{Something Witty Title}

\begin{document}

\maketitle

\textbf{Outline} This is not in order right now, but there some things that I think I'd want to mention. We can clean up this outline later. Let's get some stuff on the page.

I guess I should say, at least internally, that I think the motivation for this paper, to me, would be as a kind of self-contained intro to this asymptotic topic to someone who didn't research it. I'd assume that they've maybe seen complex integration, but also I'm looking at a lot of complex analysis stuff, so they almost don't even need that. My goal would be, let's say hypothetically there were integrals like this on the final. Then I'd be able to hand my paper to someone, they could understand loosely the motivation, where it comes from, and how to sort of use it, without having to use too much external sources.

\begin{enumerate} \item Method of Stationary Phase. It's good to include. First, it's kind of a degenerate case of method of stationary phase (only imaginary component in the exponent). Also, we are kind of using stationary phase. Remember that steepest descent works on $$I(x) = \int_a^b h(t) e^{x \rho (t)} \dd t$$ where $\rho (t) = \phi (t) + i \psi (t)$ is analytic \textbf{where? why?} Then, we take a contour $C$ in the imaginary plane where $\text{Im}(\rho) = \psi$ is constant (so $\psi ' \equiv 0$ along $C$). Then $$I(x) = \int _C he^{x\phi}e^{ix\psi} = e^{ix\psi} \int _C he^{x\phi}$$ This leaves an integral which can be hit with Laplace method, look for max of $phi$, $\dots$. \item Complex analysis stuff. This is going to include at least that the imaginary and real components of an analytic function will create orthogonal level curves in the complex plane. A "proof" here might not be so bad, it's fun to talk about, and its not in BO. So, something like \textbf{Show that curves of constant phane are the steepest curves}. You have a long-ass thing in your notes.

You will probably also need to talk about cauchys theorem, which lets you deform a contour, I think this is true. Probably double check this.

\item You could address why, given that the level curves are orthogonal, one doesn't simply choose to make the real part constant and apply the method of stationary phase, instead.

\item saddle points, but i still need to watch that lecture. I think it will be good fodder. That may just round out the paper.

\item Examples?

\pagebreak

On our way to Steepest descent, it is necessary to visit some topics about complex variables.

\section{Complex Review}

Do we want this? Do we need this? What goes here?

maybe nice would be something something f=x+iy. and that f'=x'+iy'. further diffn considerations. complex exponential derivative.

contour considerations. smoothness. smooth-enough-ness. connected-ness?

integration of a complex exponential? fears about i.

\subsection{Cauchy Riemann Equations}

In the world of real variables, it seems reasonable to require that in order for some limit $$\lim _{x \to x_0} f(x) = L$$ to exist, the limit must be equal if we come from the left $(x \to x_0 ^-)$ or right $(x \to x_0 ^+)$. For complex limits, where $z \to z_0$ typing is slow here snatoheusnatoheustnaoheustnahoeunstahoeunsthaoeusnthaoeusntahoeusntahoeushn

fine here snatoheunsatoheusnahtoeusnahtoeunsahtoeusnahtoeusnahtoe

\subsection{Complex Integration}

fine here! snatoheunstahoeusnthaoeunsthaoesunthaoesunthaoesnuht

We will discuss integrals of some function $f(z)$ along some contour $C$ in some complex domain $D$ $$\int _C f(z) \dd z$$ Just like with real-valued path integration, we might expect the value of the integral to depend on the choice of $C$, and we would expect to be able to split up $C$ into segmented pieces $C_1, C2, \dots$ and consider $\int {C1} + \int {C_2} + \dots$. As we might expect, we can approach these integrals by parameterizing $C$ using some $z(t) = x(t) + iy(t)$ giving $$\int _C f(z) \dd z = \int _a ^b f\qty( z(t) ) \dv{z}{t} \dd t$$

To give a quick example, consider $$\int _C z^2 \dd z$$ where $C$ is the upper half-circle centered at $z=1$ and traversed counter-clockwise.

\begin{tikzpicture} \draw[thick,->] (-1,0) -- (3,0) node[right] {$\text{Re}$}; \draw[thick,->] (0,-1) -- (0,2) node[right] {$\text{Im}$}; \draw[thick,red] (2,0) arc (0:180:1); \draw[thick,red,->] (1,0) ++(100:1) arc (100:130:1); \filldraw (2,0) circle (2pt) node[below] {$2$}; \filldraw (0,0) circle (2pt) node[below left] {$0$}; \filldraw (1,0) circle (2pt) node[below] {$1$}; \node at (1.5,1.2) {$C$}; \end{tikzpicture}

We can express $C$ as a complex exponential $z(t) = 1+e^{it}$ where $0 \leq t \leq \pi$, and $z'(t) = ie^{it}$. Substitution will give \begin{align} \int _C z^2 \dd z &= \int _0 ^\pi \qty(1 + e^{it})^2 \qty(i e^{it} ) \dd t \ &= \int _0 ^\pi \qty( ie^{it} + 2ie^{it} + ie^{3it} ) \dd t \ &= -\frac83 \end{align}

\subsection{Cauchy's Integral Theorem}

Cauchy's Integral Theorem states that, in some nice domain $D$, if a continuous function $f$ has an antiderivative $F$, then $\int _c f(z) \dd z = 0$ for some nice $C$ in $D$. This requires some unpacking.

First, exactly what we mean by 'nice' is a little extraneous. It's enough to consider for our purposes that our domain $D$ is the entire complex plane, without any strange holes. Our contour $C$ in $D$ is 'nice' if it doesn't cross itself, and has only finitely many sharp turns. It's enough to imagine a non-pathological, windy curve, which doesn't cross itself, ending up back where it started in the complex plane here.

% MAYBE HERE A NICE PICTURE. WITH WHAT? A CURVE INSIDE OF A D, WRITTEN 'NICE'.

\textbf{PROOF HERE? USING COMPLEX ANALYSIS NOTES? IS IT HELPFUL?}

\pagebreak

Blah blah the Method of Steepest Descent is for integrals of the form \begin{align} I(x) &= \int_a^b h(t) e^{x\rho(t)}\dd t && \text{as } x \to \infty \end{align} where $\rho(t) = \phi(t) + i\psi(t)$. This method can be seen as a generalization of Laplace's Method (applicable if $\psi \equiv 0$) and Method of Stationary Phase (applicable if $\phi \equiv 0$) to a complex-valued exponential. IN HERE NEED TO TALK ABOUT HOW STATIONARY PHASE ONLY GIVES LEADING TERM, WHILE LM GIVES FULL AE.

Ultimately, we'd like to think of $I$ as a contour integral, where $t=u+iv$ is thought of as a complex variable.

\end{enumerate}

\end{document}`

https://github.com/texstudio-org/texstudio/assets/83898733/f9033858-cd72-4ab9-96a5-8730b26bc6dd

in case it is needed, here is the CSM.cls file:

`% This is intended to be a large container for all school-related commands to live. % it is built according to suggestion from the following: % https://tex.stackexchange.com/questions/77/how-to-make-a-standard-preamble-into-a-package?rq=1 % and further suggestions from % https://www.overleaf.com/learn/latex/Writing_your_own_class % it is used by % % \documentclass{CSM} %

% NOTES:

% Declare that this style file requires at least LaTeX version 2e. \NeedsTeXFormat{LaTeX2e}

% Provide the name of your page, the date it was last updated, and a comment about what it's used for \ProvidesClass{CSM}[2020/09/03 class for school]

%% Class-overriding options, or argument passers, go before LoadClass so they are not ignored

\LoadClass[12pt]{article}

%% packs \RequirePackage{enumitem} % better numbering \RequirePackage{physics} % shortcuts \RequirePackage{amssymb} % symbols \RequirePackage{amsthm} % environments \RequirePackage{empheq} % boxes, I think \RequirePackage{xfrac} % fancy fractions \RequirePackage{graphicx} % better handling of images \RequirePackage{float} % allows for [H] and more override on placement of images \graphicspath{ {./} } % look for graphics in the same directory \RequirePackage{listings} % provides multiline literal, but use \lit (below) \RequirePackage[margin=1in]{geometry} % make pages bigger \RequirePackage{mdframed} % for boxes \RequirePackage{xcolor} % for colors for boxes, see 'lit' env below \RequirePackage{todonotes} % gives todo notes \RequirePackage{mathrsfs} % gives script letters, for things like FFT

%% command renaming \newcommand\bR{\mathbb{R}} % set shortcuts \newcommand\bC{\mathbb{C}} \newcommand\bZ{\mathbb{Z}} \newcommand\bK{\mathbb{K}} \newcommand\bN{\mathbb{N}} \newcommand\bI{\mathbb{I}} \newcommand\cO{\mathcal{O}} % big O %\newcommand{\mat}[3][R]{\mathbb{#1} ^{#2 \cross #3}} % not sure which is better to default here \newcommand{\rmat}[2]{\mathbb{R} ^{#1 \cross #2}} \newcommand{\cmat}[2]{\mathbb{C} ^{#1 \cross #2}} % vector space shortcuts, see 2 lines up \newcommand{\inv}{^{-1}} % inverses \newcommand{\col}[1]{\text{Col} (#1)} % column space \newcommand{\row}[1]{\text{Row} (#1)} % row space \newcommand{\nul}{\text{Nul}} % null space \newcommand{\nl}{\phantom{={}}} % allows for multi-line inside align % usage: where you want to split, add \ % then, &\nl on the next line \newcommand{\nn}{\nonumber} % shortcut for clearing numbered lines when we have to use aligned \newcommand{\lev}[3]{\epsilon _{ #1 #2 #3}} % levi civita % we want to default to ijk % but be able to change to another order % you can do this with command relaying % https://texfaq.org/FAQ-twooptarg \newcommand{\checkme}{\todo[color=green!40]{Check me.}} % creates a check todo with a green color % relies on todonotes \newcommand{\pt}[2]{$(#1,#2)$} % an extremely lazy point macro, for writing a lot of coordinates \newcommand{\nm}[1]{\norm{#1}} % faster p norms \newcommand\circled[1]{\tikz[baseline=(char.base)]{ % creates circled numbers \node[shape=circle,draw,inner sep=2pt] (char) {#1};}} % that look not bad \newcommand{\ipr}[2]{\langle #1, #2 \rangle} % an inner product command for cleaning up long derivations \newcommand{\Span}{\text{span}} % testing to see if i can overwrite the native span command \newcommand{\fft}[1]{\mathscr F \left{ #1 \right}} \newcommand{\ifft}[1]{\mathscr F ^{-1} \left{ #1 \right}}

%% environments \lstnewenvironment{lit} % add grey-boxed literal for code {\lstset{backgroundcolor=\color{black!09}}} {}

\newenvironment{image}[3][1] % accepts optional [] argument for width 0<w<1 % and mandatory #2 argument for filename % and mandatory #3 argument for caption {\begin{figure}[H] % change [H] to your preferred option \centering \includegraphics[width=#1\textwidth]{#2} \caption{#3} \end{figure} }

%% numbering and styles % Lemma environment \setcounter{section}{-1} % start at section 0 \newtheoremstyle{lem}% name {\topsep}% space above {\topsep}% space below {}% body font {}% indent amount {}% theorem head font {}% punctuation after theorem head {.5em}% space after theorem head {\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}% theorem head spec \theoremstyle{lem} \newtheorem{lem}{Lemma.}

% Remark environment \setcounter{section}{-1} % start at section 0 \newtheoremstyle{rmk}% name {\topsep}% space above {\topsep}% space below {}% body font {}% indent amount {}% theorem head font {}% punctuation after theorem head {.5em}% space after theorem head {\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}% theorem head spec \theoremstyle{rmk} \newtheorem{rmk}{\textbf{Remark.}}

% Remark environment \setcounter{section}{-1} % start at section 0 \newtheoremstyle{prop}% name {\topsep}% space above {\topsep}% space below {}% body font {}% indent amount {}% theorem head font {}% punctuation after theorem head {.5em}% space after theorem head {\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}% theorem head spec \theoremstyle{prop} \newtheorem*{prop}{\textbf{Proposition.}}

\renewcommand{\normalsize}{\fontsize{12}{16}\selectfont} % set reasonable font sizes %\setlength{\textwidth}{17.5cm} % can we delete these? %\setlength{\textheight}{22cm} \setcounter{secnumdepth}{0}

\endinput % stop reading this file and go ahead`

sunderme commented 9 months ago

I can reproduce it with 4.6.3 on linux

sunderme commented 9 months ago

can you try current release candidate, it seems to be gone there. https://github.com/texstudio-org/texstudio/releases/tag/4.7.0rc3

jan-niku commented 9 months ago

can you try current release candidate, it seems to be gone there. https://github.com/texstudio-org/texstudio/releases/tag/4.7.0rc3

Yes, the issue appears resolved here. Thank you for your help.