URL 超出页边距

URL 超出页边距

我是 LaTeX 的新手,并且渴望学习,因为我正在攻读博士学位,并且有人告诉我 LaTeX 是编写科学文献的绝佳平台。

因此,我在 TeXstudio 中写了一篇简短的纯英文文章,但遇到了一些问题:

\documentclass[a4paper,10pt]{article}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{gensymb}
\usepackage{url}
\usepackage{wrapfig}

\bibliographystyle{plainnat}

\begin{document}

\begin{figure}[h!]
    \centering
    \includegraphics[width=1\textwidth]{withstupid}
    \caption{I'm with stupid \citep{adcock2018}}
\end{figure}

{\LARGE Save our planet and our species, now!?} \\

The human species faces the most important crossroads in our history, we have two choices; [1] to continue down our existing path, ignoring the impact our actions are having on the environment or [2] to take immediate action and reduce our carbon dioxide emissions, in an attempt to manage the rate of global warming and save not just the very planet we depend on to survive but also to secure a future for our own species. I believe our species is currently facing an existential risk of our own making. \\

Analysis of air bubbles from ice in the poles has shown that for thousands of years, the $CO_2$ levels in the atmosphere was stable at around 280 PPM, until 1800, when the $CO_2$ concentrations begin to exponentially increase. The start of the industrial revolution circa 1900 marked an unprecedented rate of increase in measured $CO_2$ levels in the atmosphere.\\

We burn fossil fuels to generate electricity, fuel vehicles and power industry. When we burn fossil fuel or biomaterial it produces $CO_2$ among other things. Laboratory analysis allows us to trace the sources of $CO_2$ in the atmosphere and there is no doubt that the increase in $CO_2$ is a result of human activity.\\

Fast forward to 2018 and the current levels of carbon dioxide in the atmosphere are 408PPM and rising every day. These are the highest levels measured in over 800,000 possibly even the last 20 million years.\\

\begin{figure}[h!]
    \centering
    \includegraphics[width=0.5\textwidth]{co2variation}
    \caption{$CO_2$ variation \citep{Wikipedia17122018}}
\end{figure}

$CO_2$ is a greenhouse gas and excess levels of this gas in the atmosphere are increasing the greenhouse effect, trapping more heat in the atmosphere and raising the temperature of the Earth. Increasing global temperatures will cause irreversible damage to the environment and ecosystems around the planet.\\

International recognition of this risk resulted in a landmark agreement between Parties to the United Nations Framework Convention on Climate Change (UNFCCC) in Paris on 12th December 2015. It was agreed to combat climate change by maintaining a global temperature rise below 2\degree C above pre-industrial levels and to pursue actions to further limit the global temperature rise to 1.5\degree C. To date: 195 Parties have signed the Agreement, 179 Parties ratified. The Parties include industrialized (developed) countries and developing countries alike. \\

\begin{figure}[h!]
    \centering
    \includegraphics[width=0.5\textwidth]{parties}
    \caption{Countries signed Paris agreement \citep{ratified}}
\end{figure}

To date temperatures have increased by around 1\degree C and we have witnessed significant climate events around the planet – extreme weather events, flooding, fires, coral bleaching, drought and heat waves.
On the 8th October 2018, the Intergovernmental Panel on Climate Change (IPCC) published a Special Report on Global Warming of 1.5\degree C. This report was called for by the IPCC in December 2015. This report was compiled by the worlds leading scientists comprising 91 authors from 40 countries. This report considers evidence and arguments from over 6,000 scientific sources. \\

\begin{figure}[h!]
    \centering
    \includegraphics[width=1\textwidth]{riskrisingtemp}
    \caption{Risk of rising temperatures \citep{indep2014}}
\end{figure}

The IPCC report states that we could see the 1.5\degree C temperature rise between 12 and 34 years if it continues to increase at the current rate.\\

The report provides several possible pathways to achieve 1.5\degree C, all of which require fossil-fuel use to half in less than 15 years and completely eliminate their use within 30 years. This means no gas, oil, diesel, or coal use in our homes, transport or industry unless the $CO_2$ is captured and stored. We will need to increase bioenergy crop production for energy and additional forestation for natural carbon dioxide absorption. A shift towards renewable energy production and large scale carbon capture and storage will be nessecary. Widespread dietary shifts towards eating less meat and reduced material consumption, would have a significant impact on reducing $CO_2$ emissions. \\

“Without the full involvement and alignment of our technical, social, and political dimensions, 1.5\degree C and even 2\degree C won’t be possible” says Glen Peters, Research Director at Norway’s Center for International Climate Research. \\

Despite the cold hard facts, Donald Trump, ‘has his doubts about climate change’ and thinks that the climate could “change back again”. Trump has also stated that he wishes to withdraw the US from the Paris agreement. \\

\begin{figure}[h!]
    \centering
    \includegraphics[width=0.5\textwidth]{trumptweet}
    \caption{Tweet from Donald Trump \citep{Holden2018}}
\end{figure}

The science and evidence are clear…our species is entering unchartered territory in our existence on planet Earth. I feel we only have one sensible, logical and responsible path to follow at these crossroads – to take immediate action: reduce and eliminate our dependence on fossil fuels, reduce the rate of climate change, engineer a sustainable and renewable future and hopefully save the planet for the future of our species.\\
\\
\\
\\

{\Large Further Reading}\\

% IPCC (2018): SR15 Global Warming of 1.5\degree C. Headline Statements from the Summary for Policymakers. Available online at https://www.ipcc.ch/site/assets/uploads/sites/2/2018/07/sr15_headline_statements.pdf, checked on 12/17/2018.\\

National Geographic (2018): Climate change impacts worse than expected, global report warns. National Geographic. Available online at https://www.nationalgeographic.com/environment/2018/10/ipcc-report-climate-change-impacts-forests-emissions/, updated on 12/13/2018, checked on 12/17/2018.\\

unfccc.int (2018): What is the Paris Agreement? Available online at https://unfccc.int/process-and-meetings/the-paris-agreement/what-is-the-paris-agreement, checked on 12/17/2018.\\

Vitousek, Peter M; Mooney, Harold A; Lubchenco, Jane; Melillo, Jerry M (1997): Human Domination of Earths Ecosystems. In Science 277.\\

Wikipedia (2018): Special Report on Global Warming of 1.5\degree C - Wikipedia. Edited by Wikipedia. Available online at https://en.wikipedia.org/w/index.php?oldid=874073532, updated on 12/16/2018, checked on 12/17/2018.\\

WWF (2018): The Effects Of Climate Change. Available online at https://www.wwf.org.uk/effectsofclimatechange, updated on 12/17/2018, checked on 12/17/2018.\\

\bibliography{references}

\end{document}

问题

网页 URL 偏离页面 - 如何修复?

错误的网址

答案1

嗯,您的代码中有几个问题......

  1. 您没有添加软件包,graphicx导致所用命令出现错误消息\includegraphics。我在以下命令中添加了软件包...
  2. 例如,我使用了来自包 mwe 的图像example-image,该包必须安装但不能加载……
  3. 用命令包装您使用的网址\url{},然后您可以使用包url(如您所做的那样)或更好的包xurl来更好地换行网址...
  4. natbib因为您没有给我们 bib 文件,所以我在您的代码中评论了和的用法bibtex...顺便说一句:我建议您使用bibtexbib 条目,并且请注意在您的 bib 文件中应包含如下 url:

    url={https://en.wikipedia.org/w/index.php?oldid=874073532},
    

    \url然后它会使用命令和包的用法来打印url/ xurl...

  5. 不要使用\\来结束一个段落,而要使用空行。如果您想要更大的空间,您可以使用例如命令\vspace{1cm}(根据需要更改值...)。
  6. 不要使用\\{Large text}\\ \\ \\更好的章节或章节机制(对于课本)...

请参阅以下编译mwe

\documentclass[a4paper,10pt]{article}

%\usepackage{natbib}
\usepackage{graphicx} % <===============================================
\usepackage{gensymb}
\usepackage{xurl} % <===================================================

%\bibliographystyle{plainnat}


\begin{document}

\begin{figure}[h!]
    \centering
    \includegraphics[width=1\textwidth]{example-image-duck}
    \caption{I'm with stupid}%  \citep{adcock2018}
\end{figure}

{\LARGE Save our planet and our species, now!?} %\\ % never end paragraph with \\, use blank line instead!

The human species faces the most important crossroads in our history, we have two choices; [1] to continue down our existing path, ignoring the impact our actions are having on the environment or [2] to take immediate action and reduce our carbon dioxide emissions, in an attempt to manage the rate of global warming and save not just the very planet we depend on to survive but also to secure a future for our own species. I believe our species is currently facing an existential risk of our own making. 

Analysis of air bubbles from ice in the poles has shown that for thousands of years, the $CO_2$ levels in the atmosphere was stable at around 280 PPM, until 1800, when the $CO_2$ concentrations begin to exponentially increase. The start of the industrial revolution circa 1900 marked an unprecedented rate of increase in measured $CO_2$ levels in the atmosphere.

We burn fossil fuels to generate electricity, fuel vehicles and power industry. When we burn fossil fuel or biomaterial it produces $CO_2$ among other things. Laboratory analysis allows us to trace the sources of $CO_2$ in the atmosphere and there is no doubt that the increase in $CO_2$ is a result of human activity.

Fast forward to 2018 and the current levels of carbon dioxide in the atmosphere are 408PPM and rising every day. These are the highest levels measured in over 800,000 possibly even the last 20 million years.

\begin{figure}[h!]
    \centering
    \includegraphics[width=0.5\textwidth]{example-image-a}
    \caption{$CO_2$ variation}%  \citep{Wikipedia17122018}
\end{figure}

$CO_2$ is a greenhouse gas and excess levels of this gas in the atmosphere are increasing the greenhouse effect, trapping more heat in the atmosphere and raising the temperature of the Earth. Increasing global temperatures will cause irreversible damage to the environment and ecosystems around the planet.

International recognition of this risk resulted in a landmark agreement between Parties to the United Nations Framework Convention on Climate Change (UNFCCC) in Paris on 12th December 2015. It was agreed to combat climate change by maintaining a global temperature rise below 2\degree C above pre-industrial levels and to pursue actions to further limit the global temperature rise to 1.5\degree C. To date: 195 Parties have signed the Agreement, 179 Parties ratified. The Parties include industrialized (developed) countries and developing countries alike. 

\begin{figure}[h!]
    \centering
    \includegraphics[width=0.5\textwidth]{example-image-b}
    \caption{Countries signed Paris agreement}%  \citep{ratified}
\end{figure}

To date temperatures have increased by around 1\degree C and we have witnessed significant climate events around the planet – extreme weather events, flooding, fires, coral bleaching, drought and heat waves.
On the 8th October 2018, the Intergovernmental Panel on Climate Change (IPCC) published a Special Report on Global Warming of 1.5\degree C. This report was called for by the IPCC in December 2015. This report was compiled by the worlds leading scientists comprising 91 authors from 40 countries. This report considers evidence and arguments from over 6,000 scientific sources. 

\begin{figure}[h!]
    \centering
    \includegraphics[width=1\textwidth]{example-image-c}
    \caption{Risk of rising temperatures}%  \citep{indep2014}
\end{figure}

The IPCC report states that we could see the 1.5\degree C temperature rise between 12 and 34 years if it continues to increase at the current rate.

The report provides several possible pathways to achieve 1.5\degree C, all of which require fossil-fuel use to half in less than 15 years and completely eliminate their use within 30 years. This means no gas, oil, diesel, or coal use in our homes, transport or industry unless the $CO_2$ is captured and stored. We will need to increase bioenergy crop production for energy and additional forestation for natural carbon dioxide absorption. A shift towards renewable energy production and large scale carbon capture and storage will be nessecary. Widespread dietary shifts towards eating less meat and reduced material consumption, would have a significant impact on reducing $CO_2$ emissions. 

“Without the full involvement and alignment of our technical, social, and political dimensions, 1.5\degree C and even 2\degree C won’t be possible” says Glen Peters, Research Director at Norway’s Center for International Climate Research. 

Despite the cold hard facts, Donald Trump, ‘has his doubts about climate change’ and thinks that the climate could “change back again”. Trump has also stated that he wishes to withdraw the US from the Paris agreement. 

\begin{figure}[h!]
    \centering
    \includegraphics[width=0.5\textwidth]{example-image}
    \caption{Tweet from Donald Trump}% \citep{Holden2018}
\end{figure}

The science and evidence are clear…our species is entering unchartered territory in our existence on planet Earth. I feel we only have one sensible, logical and responsible path to follow at these crossroads – to take immediate action: reduce and eliminate our dependence on fossil fuels, reduce the rate of climate change, engineer a sustainable and renewable future and hopefully save the planet for the future of our species.

\vspace{2\baselineskip}
{\Large Further Reading}

% IPCC (2018): SR15 Global Warming of 1.5\degree C. Headline Statements from the Summary for Policymakers. Available online at https://www.ipcc.ch/site/assets/uploads/sites/2/2018/07/sr15_headline_statements.pdf, checked on 12/17/2018.

National Geographic (2018): Climate change impacts worse than expected, global report warns. National Geographic. Available online at \url{https://www.nationalgeographic.com/environment/2018/10/ipcc-report-climate-change-impacts-forests-emissions/}, updated on 12/13/2018, checked on 12/17/2018.

unfccc.int (2018): What is the Paris Agreement? Available online at \url{https://unfccc.int/process-and-meetings/the-paris-agreement/what-is-the-paris-agreement}, checked on 12/17/2018.

Vitousek, Peter M; Mooney, Harold A; Lubchenco, Jane; Melillo, Jerry M (1997): Human Domination of Earths Ecosystems. In Science 277.

Wikipedia (2018): Special Report on Global Warming of 1.5\degree C - Wikipedia. Edited by Wikipedia. Available online at \url{https://en.wikipedia.org/w/index.php?oldid=874073532}, updated on 12/16/2018, checked on 12/17/2018.

WWF (2018): The Effects Of Climate Change. Available online at \url{https://www.wwf.org.uk/effectsofclimatechange}, updated on 12/17/2018, checked on 12/17/2018.

%\bibliography{references}

Or better 

\section{Further Reading}

text

\end{document}

及其结果:

生成的 URL

最后,似乎您正在使用 bib 文件,因为您\cite{}在标题中使用了它...因为我没有您的 bib 文件,所以我无法帮助您,但我建议您提出一个新问题,在您的问题中显示给定代码的 bib 文件...真正的参考书目遵循您在代码中手动编写的参考资料。

更好的方法是使用bibtexbiblatex/biber...

相关内容