2

Today I encount a problem, some words did not start a new line and out of the docs like this:

enter image description here

what should I do to make it start a new line automatic? This is my text:

结果发现有2条已经读取但是未处理的消息。起始ID是1620709698075-0和1620710703039-0。消费Stream消息时,提示错误Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: io.lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute。
1
  • there has to be space between the words otherwise how will the program know where to break the line
    – js bibra
    May 12, 2021 at 2:42

1 Answer 1

4

I can think of two possible solutions:

  • disable justification for the paragraph in question
  • load the xurl package and encase the overly long strings in \url{...} statements.

enter image description here

\documentclass{article}
\usepackage{xeCJK}
\usepackage{xcolor}   % for \textcolor command
\usepackage{ragged2e} % for \RaggedRight command
\usepackage{xurl}     % for \url and \urlstyle commands
\urlstyle{same}
\begin{document}

\textcolor{red}{Problem:}

结果发现有2条已经读取但是未处理的消息。起始ID是1620709698075-0和1620710703039-0。
消费Stream消息时,提示错误Redis command timed out; nested exception is 
io.lettuce.core.RedisCommandTimeoutException: 
io.lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute。

\bigskip
\textcolor{red}{Solution 1: \texttt{\string\raggedright} or \texttt{\string\RaggedRight} within a TeX group}

\begingroup\raggedright\hspace{12pt}
结果发现有2条已经读取但是未处理的消息。起始ID是1620709698075-0和1620710703039-0。
消费Stream消息时,提示错误Redis command timed out; nested exception is 
io.lettuce.core.RedisCommandTimeoutException: 
io.lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute。
\par\endgroup

\bigskip
\textcolor{red}{Solution 2: Selectively encase long strings in \texttt{\string\url} directives}

结果发现有2条已经读取但是未处理的消息。起始ID是1620709698075-0和1620710703039-0。
消费Stream消息时,提示错误Redis command timed out; nested exception is 
io.lettuce.core.RedisCommandTimeoutException: 
\url{io.lettuce.core.RedisCommandTimeoutException:} Command timed out after 1 minute。

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .