You'll first need something that renders pdf files in Emacs and plays well with Latex such as pdf-tools. Then you'll need to setup AucTex. Here are my configurations for both of these. Note that there maybe other possible configurations that achieve the same end result but since I have gotten this to work for me, I am sharing this,
;; pdf-tools
(use-package pdf-tools
:ensure t
:init
(pdf-tools-install))
;; auctex
(use-package auctex
:ensure t
:after latex
:init
(setq tab-width 2
LaTeX-item-indent 0 latex "latex"
pdf-latex-command "xelatex"
TeX-view-program-selection '((output-pdf "PDF Tools"))
TeX-view-program-list
'(("PDF Tools" TeX-pdf-tools-sync-view)))
(setq-default TeX-engine 'xetex)
(add-hook
'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer)
:hook
;; (TeX-after-compilation-finished-functions
;; . TeX-revert-document-buffer)
(LaTeX-mode .
(lambda()
(add-to-list
'TeX-command-list
'("XeLaTeX" "%`xelatex --synctex=1%(mode)%' %t"
TeX-run-TeX nil t))
(setq TeX-command-default "XeLaTeX"
TeX-source-correlate-mode t)))
:bind (:map LaTeX-mode-map
("C-c C-c" .
(lambda (ARG)
(interactive "P")
(save-buffer)
(TeX-command-run-all ARG)))
("C-l <backspace>"
. (lambda ()
(interactive)
(TeX-clean)
(message "Cleaned!")))))
You may want to adjust these as per your need and then try C-c C-c
.