LyX ⇒ No automatic line break in paragraph title
No automatic line break in paragraph title
I've been using LyX for quite a while now, but now i faced a problem i never had before:
in paragraph titles, there is no line break, so the title goes over the margin of the mage. same think with the title in the table of contents.
can somebody help me? thanks in advance.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
No automatic line break in paragraph title
paragraph
was a strangely chosen word for a sectional heading and it leads to confusion. In case you are putting whole paragraphs of text into
paragraphs
, don't. If not, and i think you don't, can you show us a very minimal lyx example? Even better would be the export to LaTeX.
No automatic line break in paragraph title
well, i sort of HAVE to use some pretty long titles. i tried it with "normal language", and the line breaks seem to work fine. but if it's names of chemicals, for example, lyx just doesn't know where to put the break.
on some names, it gets it right, on others it doesn't.
Code: Select all
%% LyX 2.1.4 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{0pt}
\usepackage{float}
\usepackage{textcomp}
\usepackage{setspace}
\usepackage{subscript}
\onehalfspacing
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\hyphenation{penta-methyl-cyclo-penta-dienyl}
\usepackage{caption}
\usepackage{tocloft}
\usepackage{overcite}
\usepackage{longtable}
\makeatletter
\renewcommand\@biblabel[1]{#1 }
\def\@citess#1{\textsuperscript{[#1]}}
\makeatother
\captionsetup{margin=15pt,font={small,rm},labelfont={small,sl, bf},format=plain,indention=0em,labelsep=colon,justification=centering,position=bottom}
\setcounter{page}{-4}
\addtolength{\cftparskip}{1pt}
\addtocontents{toc}{\protect\thispagestyle{empty}}
\tolerance=4000
\makeatletter
\@addtoreset{figure}{section}
\@addtoreset{figure}{subsection}
\@addtoreset{figure}{subsubsection}
\@addtoreset{figure}{paragraph}
\makeatother
%\renewcommand*{\figureformat}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\arabic{paragraph}.\arabic{figure}}
\renewcommand\thefigure{\thesection%
\ifnum\arabic{subsection} = 0 \relax\else .\arabic{subsection}\fi%
\ifnum\arabic{subsubsection} = 0 \relax\else .\arabic{subsubsection}\fi%
\ifnum\arabic{paragraph} = 0 \relax\else .\arabic{paragraph}\fi%
-\arabic{figure}%
}
\makeatother
\usepackage{babel}
\begin{document}
\tableofcontents{}
\section{(in,in-\{{[}RuII(trpy)(H\protect\textsubscript{2}O){]}\protect\textsubscript{2}(\textmu -bpp)\}\protect\textsuperscript{3+ }(2,2\textasciiacute :6\textasciiacute ,2\textasciiacute \textasciiacute -terpyridine,
bis(2-pyridyl)-3,5-pyrazolate))}
\subsection{(in,in-\{{[}RuII(trpy)(H\protect\textsubscript{2}O){]}\protect\textsubscript{2}(\textmu -bpp)\}\protect\textsuperscript{3+ }(2,2\textasciiacute :6\textasciiacute ,2\textasciiacute \textasciiacute -terpyridine,
bis(2-pyridyl)-3,5-pyrazolate))}
\subsubsection{(in,in-\{{[}RuII(trpy)(H\protect\textsubscript{2}O){]}\protect\textsubscript{2}(\textmu -bpp)\}\protect\textsuperscript{3+ }(2,2\textasciiacute :6\textasciiacute ,2\textasciiacute \textasciiacute -terpyridine,
bis(2-pyridyl)-3,5-pyrazolate))}
\paragraph{(in,in-\{{[}RuII(trpy)(H\protect\textsubscript{2}O){]}\protect\textsubscript{2}(\textmu -bpp)\}\protect\textsuperscript{3+ }(2,2\textasciiacute :6\textasciiacute ,2\textasciiacute \textasciiacute -terpyridine,
bis(2-pyridyl)-3,5-pyrazolate))}
$\;$
m
\end{document}
- Attachments
-
- sim0neLyxToc.png (183.72 KiB) Viewed 15191 times
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: No automatic line break in paragraph title
When i have more time, i add some explanation here as well.
Re: No automatic line break in paragraph title
i do speak german, and i see that it's quite the same problem as mine. still, i'm not THAT much into latex to understand what's going on. that's the reason why i'm using LyX

so if there is a WYSIWYG kind of solution to this problem, please let me know. if you can somehow explain it in german, i could translate it so you have less work to do putting it up here on the english forum as well.
No automatic line break in paragraph title
For one thing I'd use the microtype package and chemmacros in combination with chemformula. This should help in many cases already:
Code: Select all
\documentclass[12pt,ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry}
\geometry{
verbose,
tmargin=2.5cm,
bmargin=2.5cm,
lmargin=2.5cm,
rmargin=2.5cm
}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\usepackage{microtype}
\usepackage{babel}
\usepackage{chemmacros}
\chemsetup{
formula = chemformula ,
greek = upgreek
}
\newcommand*\chemprime{\ensuremath{^\prime}}
\NewChemIUPACShorthand'\chemprime
\begin{document}
\tableofcontents
\section{\ch{(in,in) "-" \{[RuII(trpy)(H2O)]2( "\m-bpp" )\}^3+}
(\iupac{2,2':6',2''-ter|pyridine, bis(2-pyridyl)-3,5-pyrazolate)})}
\subsection{\ch{(in,in) "-" \{[RuII(trpy)(H2O)]2( "\m-bpp" )\}^3+}
(\iupac{2,2':6',2''-ter|pyridine, bis(2-pyridyl)-3,5-pyrazolate)})}
\subsubsection{\ch{(in,in) "-" \{[RuII(trpy)(H2O)]2( "\m-bpp" )\}^3+}
(\iupac{2,2':6',2''-ter|pyridine, bis(2-pyridyl)-3,5-pyrazolate)})}
\paragraph{\ch{(in,in) "-" \{[RuII(trpy)(H2O)]2( "\m-bpp" )\}^3+}
(\iupac{2,2':6',2''-ter|pyridine, bis(2-pyridyl)-3,5-pyrazolate)})}
Hello
\end{document}
\sloppy
at appropriate places may cure the remaining problems:Code: Select all
\documentclass[12pt,ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry}
\geometry{
verbose,
tmargin=2.5cm,
bmargin=2.5cm,
lmargin=2.5cm,
rmargin=2.5cm
}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\usepackage{microtype}
\usepackage{babel}
\usepackage{chemmacros}
\chemsetup{
formula = chemformula ,
greek = upgreek
}
\newcommand*\chemprime{\ensuremath{^\prime}}
\NewChemIUPACShorthand'\chemprime
\begin{document}
\tableofcontents
\section{\ch{(in,in) "-" \{[RuII(trpy)(H2O)]2( "\m-bpp" )\}^3+}
(\iupac{2,2':6',2''-ter|pyridine, bis(2-pyridyl)-3,5-pyrazolate)})}
{\sloppy
\subsection{\ch{(in,in) "-" \{[RuII(trpy)(H2O)]2( "\m-bpp" )\}^3+}
(\iupac{2,2':6',2''-ter|pyridine, bis(2-pyridyl)-3,5-pyrazolate)})}
}
{\sloppy
\subsubsection{\ch{(in,in) "-" \{[RuII(trpy)(H2O)]2( "\m-bpp" )\}^3+}
(\iupac{2,2':6',2''-ter|pyridine, bis(2-pyridyl)-3,5-pyrazolate)})}
}
\paragraph{\ch{(in,in) "-" \{[RuII(trpy)(H2O)]2( "\m-bpp" )\}^3+}
(\iupac{2,2':6',2''-ter|pyridine, bis(2-pyridyl)-3,5-pyrazolate)})}
Hello
\end{document}
Re: No automatic line break in paragraph title
but still, the headlines are too long for the page number to show up. they should be even shorter. is that possible?
No automatic line break in paragraph title
What do you mean by headlines? The header?sim0ne wrote:but still, the headlines are too long for the page number to show up. they should be even shorter. is that possible?