LaTeX forum ⇒ LyXadd citation in Part page Topic is solved

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Fed89
Posts: 18
Joined: Thu May 16, 2013 3:01 pm

add citation in Part page

Postby Fed89 » Mon Mar 20, 2017 4:14 pm

Hello everyone,
i am using Memoir to write my thesis. I divide it in 2 parts.
I would like to add a citation in the same Part page, but by default a clear-double-page is created after the Part section.
Do you know how can I trick lyx to let me add some free text in the same Part page?
Thanks in advance!
Federico

User avatar
Johannes_B
Site Moderator
Posts: 3348
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Mar 20, 2017 7:14 pm

No need to trick LyX, you just have to change the original LaTeX defintion of \part, or rather the underlying commands, to what you need.

You can click on Open in Overleaf to see the compiled result of the example below.
  1. \documentclass{memoir}
  2. \usepackage{blindtext}
  3. \newcommand{\partcite}{}
  4. \newcommand{\partcitation}[1]{\renewcommand\partcite{#1}}
  5. \renewcommand{\afterpartskip}{\vfill\begingroup\partcite\par\endgroup\vfill\newpage}
  6. \begin{document}
  7. \partcitation{\raggedleft Coolest animal of the world \par
  8. \itshape Not Einstein}
  9. \part{Wombat}
  10. \chapter{Wombats are cuddly}
  11. \blindtext[9]
  12. \partcitation{\raggedleft Cuddliest animal of the world \par
  13. \itshape Not Einstein}
  14. \part{Capybara }
  15. \chapter{Capybaras are cuddly}
  16. \blindtext[9]
  17. \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.

Fed89
Posts: 18
Joined: Thu May 16, 2013 3:01 pm

Postby Fed89 » Wed Mar 22, 2017 4:04 pm

Thanks Johannes_B!
It worked!
One more detail though. I guess that the vfill in command line
  1. \renewcommand{\afterpartskip}{\vfill\begingroup\partcite\par\endgroup\vfill\newpage}

push the Part title way up to the top of the page (it looks also like this in the example you sent me).
I would like to have the "Part 1: PartTitle" a bit more vertically centered.
I tried to add some vertical space before the PartTitle (both protected and not) in lyx, but it looks like this spacing is ignored and so the Part Title stays in the top of the page.
Any idea how to fix this?
Thanks again ;)

User avatar
Johannes_B
Site Moderator
Posts: 3348
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Mar 22, 2017 8:27 pm

Try the following. You can also try \vfil[\latex] (just one ell), or use [latex]\vspace everywhere to do the spacing completely by hand.
In this example, the citation is cleared so no accidental duplication happens. A non-existing cite is much easier to spot than a duplicate.

Using fil/fill, LaTeX stretches the spacing depending on the content, so very different (lengthwise) citations will lead to very different spacing, so i am in favour of handling the spaces by hand. On the other hand, having a really spacy part title, will now destry stuff. So you have to consider what might happen more often and adjust by hand from case to case.

  1. \documentclass{memoir}
  2. \usepackage{blindtext}
  3. \newcommand{\partcite}{}
  4. \newcommand{\partcitation}[1]{\renewcommand\partcite{#1}}
  5. \renewcommand{\beforepartskip}{\null\vfill}
  6. \renewcommand{\afterpartskip}{\vspace{4cm}\begingroup\partcite\par\endgroup\renewcommand{\partcite}{}\vfill\newpage}
  7. \begin{document}
  8. \partcitation{\raggedleft Coolest animal of the world \par
  9. \itshape Not Einstein}
  10. \part{Wombat}
  11. \chapter{Wombats are cuddly}
  12. \blindtext[9]
  13. \partcitation{\raggedleft Cuddliest animal of the world \par
  14. \itshape Not Einstein}
  15. \part{Capybara}
  16. \chapter{Capybaras are cuddly}
  17. \blindtext[9]
  18. \part{No citation given}
  19. \chapter{There was none}
  20. \blindtext[9]
  21. \partcitation{\raggedleft quote here
  22. \itshape Not Einstein}
  23. \part{\mdseries% bold would just be insane even in this example
  24. There once was a man from Nantucket\endgraf
  25. Who kept all his cash in a bucket.\endgraf
  26. But his daughter, named Nan,\endgraf
  27. Ran away with a man\endgraf
  28. And as for the bucket, Nantucket. \endgraf}
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. %Now spacing by hand
  36. \renewcommand{\beforepartskip}{\vspace*{.3\textheight}}
  37. \part{No citation given, spacing by hand}
  38. \chapter{There was none}
  39.  
  40. \partcitation{\raggedleft Dunkel war’s, der Mond schien helle,\par
  41. schneebedeckt die gr\"une Flur,\par
  42. als ein Wagen blitzesschnelle,\par
  43. langsam um die Ecke fuhr.\par
  44. \itshape Unknown Author}
  45. \part{No citation given, spacing by hand}
  46. \chapter{There was none}
  47. \partcitation{\raggedleft Dunkel war’s, der Mond schien helle,\par
  48. schneebedeckt die gr\"une Flur,\par
  49. als ein Wagen blitzesschnelle,\par
  50. langsam um die Ecke fuhr.\par
  51. \itshape Unknown Author}
  52. \part{\mdseries
  53. There once was a man from Nantucket\endgraf
  54. Who kept all his cash in a bucket.\endgraf
  55. But his daughter, named Nan,\endgraf
  56. Ran away with a man\endgraf
  57. And as for the bucket, Nantucket. \endgraf}
  58. \chapter{There was none}
  59. \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.

Fed89
Posts: 18
Joined: Thu May 16, 2013 3:01 pm

Postby Fed89 » Thu Mar 23, 2017 4:01 pm

Perfect! Thanks a lot!


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 5 guests