Document Classespdf ignoring customised class

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
philST
Posts: 2
Joined: Sat Nov 21, 2015 3:07 pm

pdf ignoring customised class

Post by philST »

Hi,

I have searched the forum but can't seem to find a solution for this.

I am using LyX 2.1 and KOMA book class. I have modified the scrclass.inc in my user folder.

I have changed the chapter* style to be roman and centered. It looks perfect on the screen but when I view in PDF it is back to the standard of Sans and Left justified.

I have even amended the scrclass in the standard layouts folder but still same problem.

For information I am running this in Windows and am new to LyX.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

pdf ignoring customised class

Post by Stefan Kottwitz »

Hi,

welcome to the forum!
philST wrote:I have modified the scrclass.inc in my user folder.
Hm, I don't know about this .inc file, but one should never change class files. Author changes belong to the document preamble or in a separate file.
philST wrote:I have changed the chapter* style to be roman and centered
.

How did you do this? As there's a problem and you ask for the cause, we should see what you did to tell you what's wrong or to suggest another way.
philST wrote:It looks perfect on the screen but when I view in PDF it is back to the standard of Sans and Left justified.
The PDF is on screen too, right? Or do you mean the LyX preview?
philST wrote:I have even amended the scrclass in the standard layouts folder but still same problem.
Never change that! An update would destroy your changes.

Btw. you can post .lyx files as attachment here, even better would be LaTeX export file so LaTeX experts can see it too.

Stefan
LaTeX.org admin
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: pdf ignoring customised class

Post by Johannes_B »

It seems to me that that inc file is just the layout LyX gives to your document in the previewer. None of these changes have any effect to the pdf output created by LaTeX.
You have succesfully changed the extra layer that LyX puts on top but didn't do any changes to the real deal, that would be so much easier without using LyX.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
philST
Posts: 2
Joined: Sat Nov 21, 2015 3:07 pm

Re: pdf ignoring customised class

Post by philST »

Thanks for the replies.

I have attached the lyx test file.

I have reset the class back to the standard with modifications. What I want to do is change to Roman and Centred. I was hoping to use something like the following:

Style Chapter
LabelType Static
LabelSep xxx
Margin Dynamic
Align Center
Font
Family Roman
Size Large
EndFont
End

I can put this in the Document - settings - local layout but it doesn't seem to do anything.
Attachments
example.lyx
(1.95 KiB) Downloaded 345 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

pdf ignoring customised class

Post by Johannes_B »

You cannot change this using LyX buttons or menus.

Code: Select all

%% LyX 2.0.8.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[oneside,english,
chapterprefix=true%JB: Added
]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{babel}
%begin added
\renewcommand{\raggedchapter}{\centering}
\RedeclareSectionCommand[
	font=\rmfamily\Large
]{chapter}
%end added
\begin{document}

\chapter{Test Chapter}
%starred versions are for unnumbered chapters

This is the document

Some more lines
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply