I got this "error missing $" in overleaf how can I solve it? - latex

I am using $\pi(x|D)=\exp(-\mathcal{U}(x))$ this expression in overleaf, but I got the error "missing $". The problem is using the symbol "|", when I delete this character it works perfectly. How can I solve this problem?

So, just did a quick check in my local MiKTeX installation. The line does indeed compile just fine. You may have some missing packages, or an error elsewhere in your document. Minimal working example:
\documentclass[a4paper,11pt]{article}
\begin{document}
$\pi(x|D)=\exp(-\mathcal{U}(x))$
\end{document}

Related

i´m trying to compile a pdf in mardown, but generate the next error

i´m working on rmardown, i´m trying to compile in pdf, but the console show me an error.
! Package inputenc Error: Unicode character ^^S (U+0013)
(inputenc) not set up for use with LaTeX.
Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. See https://bookdown.org/yihui/rmarkdown-cookbook/latex-unicode.html
Error: LaTeX failed to compile Modelos-de-volatilidad.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Modelos-de-volatilidad.log for more info.
Ejecución interrumpida
i have install MIKTEX.
Check for the error in the line where it is happening. There's surely one character that LaTeX is not processing. Comment or cut the line and run again. I have had a similar issue when copy pasting from a pdf into LaTeX.

Chinese fonts in English Document of Latex

I would like to ask how to write some Chinese characters (simplified) within an English Latex document? I followed some methods suggested online but none of them are working for me. I am using Texworks to compile my document (pdfLatex).
\usepackage{CJKutf8}
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{bsmi}
你好吗
\end{CJK}
\end{document}
another method is mentioned here,
\usepackage{CJKutf8}
\newcommand{\zh}[1]{\begin{CJK}{UTF8}{gbsn}#1\end{CJK}}
insert whatever Chinese characters you like into the document by typing
\zh{中文}
The error I receive is as following when using the method of CJKutf8 with pdfLaTeX mentioned here,
The log file hopefully contains the information to get MiKTeX going again:
C:\Users\muhd_\AppData\Local\MiKTeX\2.9\miktex\log\miktex-makepk.log
)
!pdfTeX error: miktex-pdftex.exe (file bsmiu30): Font bsmiu30 at 600 not found
==> Fatal error occurred, no output PDF file produced!
Log file is attached here.
The first error in the log file
The process terminated due to an access violation.
suggests that there are some problems with permissions while trying to create the necessary files to use the font for the Chinese letters.
Based on this answer https://tex.stackexchange.com/a/419809/36296 the problem can be fixed by either runing updmap from the command line or Refresh font map files from within the miktex console (in user mode).

LaTeX: Problem with the babel package in beamer class with TeXmaker

here is minimal example of my problem:
\documentclass[14pt,aspectratio=169,German,handout]{beamer}
\mode<presentation>
{\usetheme{Madrid}}
\usepackage[ngerman]{babel}
\begin{document}
Hello World
\end{document}
This compiles on overleaf fine, but on my Windows Workstation with TeXMaker, I get the following error:
Missing numer, treated as zero \l#German \ldf#fginish \CurrentOption
It compiles only if I remove the \usepackage{babel} line.
What can I do?
thx
The log file says: (removed because its too large)
My solution is:
\documentclass[14pt,aspectratio=169,handout]{beamer}

Error while generating make latexpdf with sphinx

I am currently using sphinx 1.4.9 for documents creation. While giving make latexpdf, I get the following error.
(/usr/share/texmf/tex/latex/upquote/upquote.sty)
(/usr/share/texmf/tex/latex/float/float.sty)
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/lib/texmf/tex/latex/config/graphics.cfg)))
(/usr/share/texmf/tex/plain/misc/pdfcolor.tex)
(/usr/share/texmf/tex/latex/hyperref/hyperref.sty
(/usr/share/texmf/tex/latex/hyperref/pd1enc.def)
(/usr/lib/texmf/tex/latex/config/hyperref.cfg)
(/usr/share/texmf/tex/latex/oberdiek/kvoptions.sty)
****! Package keyval Error: pdfencoding undefined.****
See the keyval package documentation for explanation.
I have searched for pdfencoding in the sphinx.egg, also it only appears in sphinx.sty.
but I don't know how to define this pdfencoding. whether to edit conf.py or how to do.
Your hyperref is outdated. Sphinx 1.4.x series was tested to work with Ubuntu Precise (Debian/TeXLive 2009). I can not try it but here is a hack which may help you out. However, perhaps other parts will fail as your TeX install is really old...
put
'passoptionstopackages' : """
\\let\\originalPassOptionsToPackage\\PassOptionsToPackage
\\makeatletter
\\def\\PassOptionsToPackage#1{%
\\def\\#tempa{#1}\\def\\#tempb{pdfencoding=unicode}%
\\ifx\\#tempa\\#tempb\\expandafter\\#gobbletwo
\\else\\expandafter\\originalPassOptionsToPackage\\fi {#1}}
\\makeatother
""",
inside the latex_elements configuration variable of conf.py. Could work ...

what are the influences after cancelling \hypersetup in org-mode?

I make pdf in org-mode with my own preamble, but the PDF or tex file generated always appear the information resulting from:
(format "\\hypersetup{\n pdfkeywords={%s},\n pdfsubject={%s},\n pdfcreator={%s}}\n"
(org-export-latex-fontify-headline keywords)
(org-export-latex-fontify-headline description)
(concat "Emacs Org-mode version " org-version))
those cods locate in ~/.emacs.d/org-7.8.11/lisp/org-latex.el
I cancelled it to prevent the useless information appearing at the first page of its PDF-file.
However is it OK to delete such codes without any function lost?
what influences will be caused by this action?
Thank you for your help.
Ok, I know how it is.
add the code into your preamble :
\usepackage{hyperref}
all are solved.
In that same file you mention, (lisp/org-latex.el), it suggests
org-latex-hyperref-template...
Set it to the empty string to ignore the command completely.
So the following should work
(setq org-latex-hyperref-template "")
Alas, I've reading downloaded source code not the same as my current org version, so this didn't work. apropos may be an easy fix, so
M-x apropos RET hyperref RET
leads me to the variable org-latex-with-hyperref, so now I try
(setq org-latex-with-hyperref nil)
This worked for me.

Resources