Veelo chapter style

259 views
Skip to first unread message

Ricardo Pérez López

unread,
Apr 16, 2018, 8:47:49 AM4/16/18
to sphinx-users
How can I get the "veelo" chapter style like I can found in "memoir" document class?

jfbu

unread,
Apr 17, 2018, 5:07:55 AM4/17/18
to sphinx...@googlegroups.com
Le 16/04/2018 à 11:36, Ricardo Pérez López a écrit :
> How can I get the "veelo" chapter style like I can found in "memoir" document class?


Hi,

do you mean, you want to achieve similar style without using memoir as document class ?
or you use memoir class?

in the latter case I (not tested) would expect that using latex_elements
'preamble' key to insert \chapterstyle{veelo} in preamble would work

in the former case, the code of the veelo style is in memoir.cls

\setlength{\afterchapskip}{40pt}
\renewcommand*{\chapterheadstart}{\vspace*{40pt}}
\renewcommand*{\afterchapternum}{\par\nobreak\vskip 25pt}
\renewcommand*{\chapnamefont}{\normalfont\LARGE\flushright}
\renewcommand*{\chapnumfont}{\normalfont\HUGE}
\renewcommand*{\chaptitlefont}{\normalfont\HUGE\bfseries\flushright}
\renewcommand*{\printchaptername}{%
\chapnamefont\MakeTextUppercase{\@chapapp}}
\renewcommand*{\chapternamenum}{}
\setlength{\beforechapskip}{18mm}% \numberheight
\setlength{\midchapskip}{\paperwidth}% \barlength
\addtolength{\midchapskip}{-\textwidth}
\addtolength{\midchapskip}{-\spinemargin}
\renewcommand*{\printchapternum}{%
\makebox[0pt][l]{%
\hspace{.8em}%
\resizebox{!}{\beforechapskip}{\chapnumfont \thechapter}%
\hspace{.8em}%
\rule{\midchapskip}{\beforechapskip}%
}%
}%
\makeoddfoot{plain}{}{}{\thepage}

however it uses various commands and lengths which are defined
by memoir class. Thus it is not immediately feasible to achieve
this with Sphinx 'howto' for example.

Thus I hope you are using memoir as docclass and then only
need to insert \chapterstyle{veelo} in premable.

For example you can use 'fncychap' key for that because
'fncychap' is a package for chapter styling that you don't
want to use in this memoir context


latex_elements = {
'fncychap': r'\chapterstyle{veelo}',
}

ok I have tested with

latex_documents = [
(master_doc, 'FOO.tex', 'FOO Documentation',
'JFB', 'memoir'),
]

and it works.

However the geometry package is set-up by Sphinx and overrules memoir choices.

Thus I would also use

latex_elements = {
'fncychap': r'\chapterstyle{veelo}',
'geometry': '',
}

to cancel usage of geometry

in my brief testing it works

Jean-François



Reply all
Reply to author
Forward
0 new messages