The URL referenced in Latex is too long and automatic line wrapping is implemented.

Have you ever encountered such a problem: the URL links cited in the paper exceed the normal page and cannot be automatically wrapped.

The solution is to insert the following code in the preamble:

\usepackage{xurl}
\def\UrlBreaks{%
    \do\/%
    \do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l%
    \do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z%
    \do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L%
    \do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X\do\Y\do\Z%
    \do0\do1\do2\do3\do4\do5\do6\do7\do8\do9\do=\do/\do.\do:%
    \do\*\do\-\do\~\do\'\do\"\do\-}

After running this, you will get the following effect. It is obvious that the font of the URL is inconsistent with the font of other text.

Therefore, in order to keep the font consistent, you need to add a line of code below the above code:

\urlstyle{same}

This will give you a beautiful reference format

Note that when using the line wrapping method in this article, you must ensure that your URL link is entered using the \url{ } command.

\url{http://dl.z-thz.com/eBook/zomega\_/eBook/zomega\_/eBook/zomega\_ebook\_pdf\_1206\_sr.pdf}

If you are using the \underline{} command, you need to change \underline to \url.

Of course, whether it can be changed depends on the needs of the journal or conference.

​
\underline{http://dl.z-thz.com/eBook/zomega\_/eBook/zomega\_/eBook/zomega\_ebook\_pdf\_1206\_sr.pdf}

Guess you like

Origin blog.csdn.net/m0_53786448/article/details/132873134