Latex,如何“避免”音节化或连字符

Latex,如何“避免”音节化或连字符

我遇到了一个 latex 问题(我是新手):它有连字符 :) :) 我正在写论文,我不想要连字符。奇怪的是,当我写 时\chapter没有连字符,而当我在同一章中写 或 时就会发生这种情况\section

我该如何解决这个问题?谢谢大家!

\documentclass[12pt, oneside, pdf, english]{toptesi}
\begin{document}
\chapter{What is Business Intelligence?}
\paragraph{}
Since the 1990s, the socio-economic context within which economic activities are carried out has generally been referred to as the information and knowledge society. 
The profound changes that have occurred in methods of production and in economic relations have led to a growth in the importance of the exchange of intangible goods, consisting for the most part of transfers of information.
\section{Definiton and Aims of Business Intelligence}Business intelligence methodologies are interdisciplinary and broad, spanning
several domains of application. Indeed, they are concerned with the
representation and organization of the decision-making process, and thus with
the field of decision theory; with collecting and storing the data intended to
facilitate the decision-making process, and thus with data warehousing technologies;
with mathematical models for optimization and data mining, and
thus with operations research and statistics; finally, with several application
domains, such as marketing, logistics, accounting and control, fi...
\end{document}

答案1

假设你这样做不是使用该babel包,你可以加载带有抑制连字符hyphenat选项的包none全球

\usepackage[none]{hyphenat} 

入口停止所有连字符TeX FAQ 中列出了全局抑制连字符的更多可能性。

另一方面,如果您想要实现的只是抑制分段标题中的连字符,则可以通过加载包sectsty并发出命令来实现目标

\allsectionsfont{\raggedright}

在序言中。

这个命令\raggedright可以抑制连字符,而且——正如它的名字所暗示的……——从完全对齐切换到左对齐/右不齐排版。

答案2

toptesi添加 raggedright 标题的选项可能是一个好主意,但是您可以很容易地添加它。

在示例中,我添加了一个模拟词以便看到连字符。

\documentclass[12pt, oneside, pdf, english]{toptesi}

\usepackage{xpatch}
\patchcmd{\section}{\normalfont}{\doraggedright\normalfont}{}{}
\patchcmd{\subsection}{\normalfont}{\doraggedright\normalfont}{}{}
\patchcmd{\subsubsection}{\normalfont}{\doraggedright\normalfont}{}{}
\patchcmd{\paragraph}{\normalfont}{\doraggedright\normalfont}{}{}
\patchcmd{\subparagraph}{\normalfont}{\doraggedright\normalfont}{}{}

\newcommand{\doraggedright}{\raggedright}
%\newcommand{\doraggedright}{}

\begin{document}
\selectlanguage{english}

\chapter{What is Business Intelligence?}

Since the 1990s, the socio-economic context within which economic activities 
are carried out has generally been referred to as the information and knowledge 
society. The profound changes that have occurred in methods of production and 
in economic relations have led to a growth in the importance of the exchange 
of intangible goods, consisting for the most part of transfers of information.

\section{Definition, Fooness and Aims of Business Intelligence}

Business intelligence methodologies are interdisciplinary and broad, spanning
several domains of application. Indeed, they are concerned with the
representation and organization of the decision-making process, and thus with
the field of decision theory; with collecting and storing the data intended to
facilitate the decision-making process, and thus with data warehousing technologies;
with mathematical models for optimization and data mining, and
thus with operations research and statistics; finally, with several application
domains, such as marketing, logistics, accounting and control, fi...

\end{document}

根据给定的定义,\doraggedright输出为

在此处输入图片描述

如果你切换注释字符,如

%\newcommand{\doraggedright}{\raggedright}
\newcommand{\doraggedright}{}

你得到了标准行为

在此处输入图片描述

笔记

  1. \paragraph{}命令是不必要的,而且实际上是错误的。段落之间用空行分隔

  2. 通过不在后面继续\section{...};您可以获得更好的源代码可读性,那里的空行有助于更好的阅读。

  3. 要获得“Chapter”, A\selectlanguage{english}是必需的,而不是“Capitolo”。

答案3

正如 Mico 所说,如果关闭连字符,您也应该关闭对齐。请注意,这也会将段落缩进设置为 0,因此您需要再次添加它。MWE:

\documentclass{article}
\raggedright % turn off hyphenation and justification
\setlength{\parindent}{1.5em} % set paragraph indentation
\usepackage{lipsum}
\begin{document}
\lipsum[1-10]
\end{document}

相关内容