1

I am very new to LaTeX and I have been playing around with it by trying to transcribe my math notes into it. For some reasons when i wrote

\begin{math}\sqrt{2}\end{math} 

after

 \section

Overleaf gave me a warning. Here is the preamble:

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{hyperref}
\usepackage{amssymb}
\usepackage{bbding}
\usepackage{mdframed}
\usepackage{amsthm}

Here is the line of code

 \section{Proof of the Irrationality of\begin{math}\sqrt{2}\end{math}}

Here is the warning I was given:

Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing `math shift' on input line 59.

I've already seen the similar post but I believe that using

 \section{Proof of the Irrationality of \texorpdfstring{\begin{math}\sqrt{2}\end{math}{}}

does not work because this shows up

Your code has errors that need to be fixed before the auto-compile can run No PDF This compile didn’t produce a PDF. This can happen if: There is an unrecoverable LaTeX error. If there are LaTeX errors shown below or in the raw logs, please try to fix them and compile again. The document environment contains no content. If it’s empty, please add some content and compile again. This project contains a file called output.pdf. If that file exists, please rename it and compile again.

Nadia K
  • 11
  • 1
    Welcome to TeX.SE. – Mico Dec 05 '23 at 20:42
  • What are you intending the arguments of \texorpdfstring{\begin{math}\sqrt{2}\end{math}{}} to be? At the moment, the first argument is \begin{math}\sqrt{2}\end{math}{} and the second doesn't exist. Move the } so this works, and the second argument can be √2. – Teepeemm Dec 06 '23 at 00:29
  • Fixed it! Thank you. I also looked at another post clarifying how \texorpdfstring works. – Nadia K Dec 06 '23 at 00:41

0 Answers0