LyXExported TOC in LyX centers Part headings

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
JacobYoung
Posts: 14
Joined: Thu Sep 19, 2013 1:24 pm

Exported TOC in LyX centers Part headings

Post by JacobYoung »

I have two matching documents with notes for two different classes. The document class, preamble, etc. are all the same. In one file, when I export it, the TOC centers the Part headings, in the other, the Part headings are Left justified. I want them to be Left justified, but do not understand what coding I may have unintentionally inserted into LyX that would cause the Part headings to center-justify in the TOC. Can somebody help me with this? How do I keep my file from center-justifying the Part headings in the TOC?

I'm using LyX 2.0.6. on Mac OS X Yosemite 10.10.3. I can post screen shots should this be helpful.

Here is the coding for the file that's centering the Part headings in the TOC up to the first heading:

Code: Select all

\documentclass[10pt,english]{article}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Gentium Basic}
\setsansfont[Mapping=tex-text]{Linux Libertine}
\usepackage[letterpaper]{geometry}
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\usepackage{array}
\usepackage{float}
\usepackage{makeidx}
\makeindex
\usepackage{graphicx}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}
\usepackage[unicode=true,pdfusetitle,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
 {hyperref}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{bibleref}
\usepackage{makeidx}
\makeindex
\renewcommand{\bvidxpgformat}{textit}
\usepackage[bottom]{footmisc}

\AtBeginDocument{
  \def\labelitemiii{\(\triangleright\)}
  \def\labelitemiv{\(\rightarrow\)}
}

\makeatother

\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\begin{document}

\title{___}


\author{___}


\date{February 11-14; May 5-9, 2014\pagebreak{}\tableofcontents{}\pagebreak{}}

\maketitle

\part{Introductory Matters}


\section{Introduction}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Exported TOC in LyX centers Part headings

Post by rais »

JacobYoung wrote:

Code: Select all

\date{February 11-14; May 5-9, 2014\pagebreak{}\tableofcontents{}\pagebreak{}}

\maketitle
this puts the TOC into the argument of \date.
Move \tableofcontents and the \pagebreak commands after \maketitle.
KR
Rainer
JacobYoung
Posts: 14
Joined: Thu Sep 19, 2013 1:24 pm

Exported TOC in LyX centers Part headings

Post by JacobYoung »

rais wrote:
JacobYoung wrote:

Code: Select all

\date{February 11-14; May 5-9, 2014\pagebreak{}\tableofcontents{}\pagebreak{}}

\maketitle
this puts the TOC into the argument of \date.
Move \tableofcontents and the \pagebreak commands after \maketitle.
KR
Rainer
Ok, that's really helpful! How do I make that change in the LyX document? Sorry to ask - I'm new to the coding side of this. Thanks for your help!
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Exported TOC in LyX centers Part headings

Post by rais »

JacobYoung wrote: How do I make that change in the LyX document?
sorry, I can't even tell how you managed to get the TOC inside the \date's argument in the first place. With LaTeX code I can help; with LyX, I cannot---someone else might be able to point you in the right direction.

KR
Rainer
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: Exported TOC in LyX centers Part headings

Post by scottkosty »

It would probably help us if you posted a LyX minimal example (a .lyx file is just plain text). For more information, see wiki.lyx.org/FAQ/MinimalExample.
JacobYoung
Posts: 14
Joined: Thu Sep 19, 2013 1:24 pm

Re: Exported TOC in LyX centers Part headings

Post by JacobYoung »

Thanks. Here's the minimum file for this issue. Does this help?
Attachments
Minimum_File_0415.pdf
(40.28 KiB) Downloaded 433 times
Minimum_File_0415.lyx
TOC centering of Part
(2.43 KiB) Downloaded 444 times
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Exported TOC in LyX centers Part headings

Post by scottkosty »

JacobYoung wrote:Thanks. Here's the minimum file for this issue. Does this help?
Very nice minimal example, Jacob. My only picky comment is that it would have been nice to uncheck "use non-TeX fonts" because I got an error because I did not have one of the fonts. But thank you for taking the time to make an otherwise clean and well-formed minimal example. It definitely makes it more fun to help you!

As for your question, the problem is that page breaks and table of contents have the "date" layout. You can see this if you look up to the upper left box (the layout box where you choose "date" or "part", etc). The fix is simple. Put your cursor to the right of "2014". Then press "enter". Then select the two page breaks and the table of contents and change the layout to "Standard". Verify that you did not accidentally change the date to "Standard" also (this is why we added the line break).

Does that work?
JacobYoung
Posts: 14
Joined: Thu Sep 19, 2013 1:24 pm

Exported TOC in LyX centers Part headings

Post by JacobYoung »

scottkosty wrote:
JacobYoung wrote:Thanks. Here's the minimum file for this issue. Does this help?
Very nice minimal example, Jacob. My only picky comment is that it would have been nice to uncheck "use non-TeX fonts" because I got an error because I did not have one of the fonts. But thank you for taking the time to make an otherwise clean and well-formed minimal example. It definitely makes it more fun to help you!

As for your question, the problem is that page breaks and table of contents have the "date" layout. You can see this if you look up to the upper left box (the layout box where you choose "date" or "part", etc). The fix is simple. Put your cursor to the right of "2014". Then press "enter". Then select the two page breaks and the table of contents and change the layout to "Standard". Verify that you did not accidentally change the date to "Standard" also (this is why we added the line break).

Does that work?
Excellent! Fixed the exact issue! Thank you. I can see now how the formatting aligned with the "date" issue and thus adding a break and "Standard" format fixed the issue. Thanks so much!

This helps out immensely! I'm working to print up my notes for some major credential studying I'm doing, and while this wasn't a show stopper, it was a major annoyance.

Also - Thanks for the point about the standard fonts. I'll be sure to do that in the future - I'd forgotten about using non-Tex fonts.

Thanks!
~Jacob
Post Reply