Guest User

Untitled

a guest
Oct 1st, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 12.82 KB | None | 0 0
  1. \ifx\DidDefsEnvironment\undefined
  2. \def\DidDefsEnvironment{}
  3.  
  4. %% ========================================
  5. %% Variables
  6. \newcommand{\booktitle}{Fallout: Equestria}
  7. \newcommand{\booksubtitle}{Versione italiana}
  8. \newcommand{\bookauthor}{Kkat}
  9. \newcommand{\bookpublisher}{TSEP}
  10. \newcommand{\bookpublished}{2011}
  11. \newcommand{\bookeditedyear}{2012}
  12. \newcommand{\bookedited}{\today}
  13.  
  14. \newcommand{\bookedition}{1}
  15. \newcommand{\bookrevision}{1}
  16.  
  17. \newcommand{\bookdedication}{}
  18.  
  19. \newcommand{\publicationnumber}{3}
  20.  
  21.  
  22. %% ========================================
  23. %% Encoding & language support
  24. \usepackage[utf8]{inputenc} % Windows OS encoding  
  25. \usepackage[T1]{fontenc}  
  26. \usepackage[italian, english]{babel} % package for multilingual support  
  27. \selectlanguage{italian}
  28. % set the font
  29. \usepackage[textlf]{Minion Pro}
  30. %\figureversion{tab}
  31.  
  32. \usepackage[hypertexnames=false]{hyperref}
  33. \urlstyle{same}
  34. \hypersetup{pdfborder = {0 0 0}}
  35.  
  36. % general packages
  37. \usepackage{fmtcount}
  38. \usepackage{xifthen}
  39.  
  40. % make ligatures searchable
  41. \input glyphtounicode
  42. \pdfgentounicode=1
  43.  
  44. \usepackage{xargs}
  45.  
  46. % for ordinals
  47. \usepackage[super]{nth}
  48.  
  49. % for customizing line spacing
  50. % \begin{spacing}{multiple-of-standard}
  51. \usepackage{setspace}
  52.  
  53. % for customizing margin width
  54. % \begin{adjustwidth}{left margin}{right margin}
  55. \usepackage{changepage}
  56.  
  57.  
  58. %% ========================================
  59. %% Geometry settings
  60. \usepackage[a5paper,includehead,ignorefoot,ignoremp,
  61. inner=0.51in,outer=0.72in,top=0.45in,bottom=0.8in]{geometry}
  62.  
  63. % remove headers from empty pages between chapters
  64. \let\origdoublepage\cleardoublepage
  65. \newcommand{\clearemptydoublepage}{%
  66.   \clearpage
  67.   {\pagestyle{empty}\origdoublepage}%
  68. }
  69. \let\cleardoublepage\clearemptydoublepage
  70.  
  71.  
  72. %% ========================================
  73. %% Basic typography (ellipsis, dashes, paragraph spacing…)
  74.  
  75. % use americal style for paragraphs = no indent and spacing between paragraphs
  76. \usepackage{parskip}
  77. \usepackage[xspace]{ellipsis} %xspace puts auto space after \dots
  78.  
  79. \setlength\parskip{10pt plus 3pt minus 3pt}
  80. \widowpenalty=5000
  81. \clubpenalty=5000
  82.  
  83. %% ========================================
  84. %% Kerning and Tracking
  85.  
  86. %\frenchspacing
  87.  
  88. \usepackage[activate={true,nocompatibility},final,
  89. tracking=true,kerning=true,spacing=true,
  90. factor=1100,stretch=10,shrink=10]{microtype}
  91. % activate={true,nocompatibility} - activate protrusion and expansion
  92. % final - enable microtype; use "draft" to disable
  93. % tracking=true, kerning=true, spacing=true - activate these techniques
  94. % factor=1100 - add 10% to the protrusion amount (default is 1000)
  95. % stretch=10, shrink=10 - reduce stretchability/shrinkability (default is 20/20)
  96.  
  97. % kerning
  98. \SetExtraKerning[unit=space]
  99.     {encoding={*}, family={*}, series={*}, size={footnotesize,small,normalsize}}
  100.    {\textemdash={300,300}, % en-dash, add more space around it
  101.     %\textendash={400,400}, % en-dash, add more space around it
  102.      "28={ ,150}, % left bracket, add space from right
  103.      "29={150, }, % right bracket, add space from left
  104.     %\textquoteright={150,},
  105.      \textquotedblleft={ ,50}, % left quotation mark, space from right
  106.      \textquotedblright={150, } % right quotation mark, space from left
  107. }
  108.  
  109. % tracking
  110. \SetTracking{encoding={*}, shape=sc, size={normalsize, small}}{75}
  111. \SetTracking{encoding={*}, shape=sc, size={huge, Huge}}{-50}
  112. \SetTracking{encoding={*}, shape=sc, size={large}}{-30}
  113.  
  114. % locally disable kerning
  115. \newcommand{\dk}[1]{%
  116. \microtypesetup{kerning=false}%
  117. #1%
  118. \microtypesetup{kerning=true}%
  119. }
  120.  
  121. % extra kerning for pairs y'd and e'd
  122. \newcommand{\ed}{e{\kern0.2pt}'{\kern-1.2pt}d\xspace}
  123. \newcommand{\yd}{y{\kern0.32pt}'{\kern-1.0pt}d\xspace}
  124.  
  125. % if we need to squeeze the line down a bit, we can temporarily adjust the word spacing.
  126. \newdimen\origiwspc% set up new dimension
  127. \origiwspc=\fontdimen2\font% save original spacing
  128.  
  129. % #1 size
  130. % #2 text
  131. \newcommand{\squeeze}[2]{%
  132. \fontdimen2\font=#1% inter word space
  133. #2%
  134. \fontdimen2\font=\origiwspc% (original) inter word space
  135. }
  136.  
  137. \newcommand{\sq}[1]{%
  138. \squeeze{0.45ex}{#1}%
  139. }
  140.  
  141. %% ========================================
  142. %% New enviroments
  143.  
  144. \newenvironment{simpleScreenplay}%
  145. {\begin{adjustwidth}{0.7in}{0.7in}\begin{center}\tt\ignorespaces}%
  146. {\end{center}\end{adjustwidth}\ignorespacesafterend}
  147.  
  148.  
  149. \newenvironment{letter}%
  150. {\begin{adjustwidth}{0.3in}{0.3in}\ignorespaces}%
  151. {\end{adjustwidth}\ignorespacesafterend}
  152.  
  153. \fi % \DidDefsEnvironment
  154.  
  155. %% ========================================
  156. %% customizing the sectioning elements
  157.  
  158. \usepackage[pagestyles,toctitles]{titlesec}
  159.  
  160. %% ========================================
  161. %% FRONT
  162.  
  163. \newcommand{\FrontStuff}{%
  164. \BookTitlePage
  165. \BookCopyrightPage
  166.  
  167. % Not every book carries a dedication but, for those that do, it follows the copyright page.
  168. \BookDedicationPage
  169.  
  170. \microtypesetup{protrusion=false}
  171. \PrintChapterfalse
  172. \begin{spacing}{0.96}
  173. \tableofcontents
  174. \end{spacing}
  175. \microtypesetup{protrusion=true}
  176. \clearpage
  177.  
  178. % Usually a short piece written by someone other than the author, the Foreword may provide a context for the main work. Remember that the Foreword is always signed, usually with its author's name, place, and date.
  179. \BookForewordPage
  180.  
  181. % Written by the author, the Preface often tells how the book came into being, and is often signed with the name, place and date, although this is not always the case.
  182. \BookPrefacePage
  183.  
  184. % The author expresses their gratitude for help in the creation of the book.
  185. \BookAcknowledgementsPage
  186.  
  187. % The author explains the purposes and the goals of the work, and may also place the work in a context, as well as spell out the organization and scope of the book.
  188. \BookIntroductionPage
  189.  
  190. }
  191.  
  192. \newcommand{\BookTitlePage}{%
  193.     \thispagestyle{empty}
  194.     \begin{center}
  195.         \phantom{a}
  196.         {\vskip 2em}
  197.         {\Huge\sc\booktitle}
  198.         {\vskip 0pt}
  199.         {\small\booksubtitle}
  200.         {\vskip 3em}
  201.         {\Large\bookauthor}
  202.         \par\vfill
  203.         {\bf\large\bookpublisher, \bookeditedyear}
  204.     \end{center}
  205.     \newpage
  206. }
  207.  
  208.  
  209. \newcommand{\BookCopyrightPage}{%
  210. \thispagestyle{empty}
  211.  
  212. \emph{This book is a work of fiction. Names, characters, places and incidents are products of the author’s imagination or are used fictitiously. Any resemblance to actual events or locales or persons, living or dead, is entirely coincidental.}
  213.  
  214. \par\vfill
  215.  
  216. Copyright \copyright\ \bookpublished\ by \bookauthor
  217.  
  218. ``My Little Pony: Friendship Is Magic'' is the property of Hasbro, Inc.
  219.  
  220. All other borrowed and referenced works are the property of their respective copyright holders.
  221.  
  222. Original characters and story belong to \bookauthor.
  223.  
  224. This work is of non-commercial character and for personal use only.
  225.  
  226. \par\vfill
  227.  
  228. Edited and typeset by ``TSEP'' in year 2012 as their \nth{\publicationnumber} work. Typeset using free system \LaTeX.
  229.  
  230. Supervising editor: Twilight Sparkle.
  231.  
  232. \selectlanguage{english}
  233. \nth{\bookedition} edition, \nth{\bookrevision} revision. \bookedited
  234. \selectlanguage{italian}
  235.  
  236. \newpage
  237. }
  238.  
  239.  
  240. \newcommand{\BookDedicationPage}{%
  241. \ifthenelse{\NOT\equal{\bookdedication}{}}{
  242.     \thispagestyle{empty}
  243.     \vspace*{\fill}
  244.     \begin{center}
  245.     \emph{\bookdedication}
  246.     \end{center}   
  247.     \vspace*{\fill}
  248.     \cleardoublepage
  249.     }
  250.     {}
  251. }
  252.  
  253.  
  254. \newcommand{\BookForewordPage}{%
  255. \thispagestyle{empty}
  256. }
  257.  
  258.  
  259. \newcommand{\BookPrefacePage}{%
  260. \thispagestyle{empty}
  261. }
  262.  
  263.  
  264. \newcommand{\BookAcknowledgementsPage}{%
  265. \thispagestyle{empty}
  266. {\LARGE Ringraziamenti}
  267. \vskip1em
  268.  
  269. Ecco l'elenco, in ordine cronologico, di chi ha contribuito alla traduzione anche solo per una pagina: belinde, Starshine, Kraff, Sidero, ThePreserver, Akay, Valid95, thefrecciablu, Rufus Loacker, HellDiver, Otaku220k
  270. }
  271.  
  272.  
  273. \newcommand{\BookIntroductionPage}{%
  274. \thispagestyle{empty}
  275. }
  276.  
  277.  
  278.  
  279. %% \newcommandx{\mypartest}[3][1=,2=]{
  280. %% \ifthenelse{\isempty{#1}}{One is empty}{One is set}
  281. %% \ifthenelse{\isempty{#2}}{Two is empty}{Two is set}
  282. %% {#3}
  283. %% }
  284.  
  285. %% ========================================
  286. %% BACK
  287.  
  288. \newcommand{\BackStuff}{%
  289. \newgeometry{ignorehead,ignorefoot,ignoremp,
  290. inner=0.55in,outer=0.74in,top=0.6in,bottom=0.8in}
  291. \BookEditorsNotePage
  292. }
  293.  
  294. \newcommand{\BookEditorsNotePage}{%
  295. \phantomsection
  296. \addcontentsline{toc}{chapter}{\protect\numberline{}Editor's notes}
  297. {\LARGE Editor's notes}
  298. \vskip1em
  299. {\Large On viewing on computer}
  300.  
  301. The book is set using the ``two-side'' mode. That means it recognizes odd (recto—right) and even (verso—left) pages. It is therefore recommended to turn on ``two-side mode'' in your favorite PDF viewer.
  302.  
  303. In Foxit Reader, version 3.3, this is done by: `View' $\rightarrow$ `Page Display' $\rightarrow$ `Show Cover Page During Facing' and then `View' $\rightarrow$ `Page Display' $\rightarrow$ `Continuous Facing'
  304.  
  305. If you use different software, use Internet search engine to find the information on how to turn these options on.
  306.  
  307. \vskip0.2em
  308.  
  309. {\Large On printing and page design}
  310.  
  311. Please note that the page layout of this book does not take into account the width of the paper needed for binding. Depending on the binding technique you would like to use, you might need to print on larger paper (i.e. wider), and offset the pages from the center to the sides. If you are not sure, contact some professional first.
  312.  
  313. The geometry of the pages is standard ``a5paper'' size from the \LaTeX\ package ``geometry''. That means you can print it on a regular home printer, 4 pages will fit on one ISO A4 paper. You might need to adjust the order first, depending on your printer brand. Do a test print first!
  314.  
  315. Geometry settings: includehead, ignorefoot, ignoremp, inner=0.51in, outer=0.72in, top=0.45in, bottom=0.8in.
  316.  
  317. \vskip0.2em
  318.  
  319. {\Large On errors and mistakes}
  320.  
  321. If you find \emph{any} errors or mistakes concerning \emph{style}, please let us know. We value any input, however small. We generally do not do proofreading, contact the author about that. We will not change any parts of the actual story without her permission.
  322. }
  323.  
  324. %% ========================================
  325. %% CHAPTERS
  326.  
  327. % set the chapter/nochapter toggle
  328. \newif\ifPrintChapter
  329. \newif\ifPrintSpecialChapter
  330. \PrintSpecialChapterfalse
  331. \PrintChapterfalse
  332.  
  333. % use words for chapter numbers
  334. \newcommand{\thechapternum}{\Numberstring{chapter}}
  335.  
  336. % #1: chapter quote/foreword
  337. % #2: chapter name
  338. \newcommand{\normalchapter}[2][]{%
  339.     \ifthenelse{\isempty{#1}}%
  340.     {\chapter{#2}}
  341.     {\chapter{#2}
  342.         \begin{center}
  343.             {\vskip-3.0em}
  344.             \emph{#1}
  345.             {\vskip1.2em}
  346.         \end{center}}
  347. }
  348.  
  349. % #1: full chapter name
  350. % #2: short chapter name
  351. \newcommand{\normalchapterx}[2]{%
  352.     {\chapter[#2]{#1}\vskip2em}
  353. }
  354.  
  355. % #1: “type” (prologue, epilogue, afterword…)
  356. % #2: chapter name
  357. \newcommand{\specialchapter}[2][]{%
  358.     \ifthenelse{\isempty{#1}}
  359.         {\phantomsection
  360.         \addcontentsline{toc}{chapter}{\protect\numberline{}#2}}
  361.         {\phantomsection
  362.         \addcontentsline{toc}{chapter}{\protect\numberline{}#1: #2}
  363.         \PrintChaptertrue
  364.         \PrintSpecialChaptertrue
  365.         \def\specialChapterName{#1}}
  366.     \chapter*{#2}
  367.     \PrintSpecialChapterfalse
  368.     %\markboth{\sc \booktitle---Part \thepart}{\sc #2}
  369.     \ifthenelse{\isempty{#1}}
  370.     {\chaptermark{\sc#2}}
  371.     {\chaptermark{\sc#1---#2}}
  372. }
  373.  
  374. \def\specialChapterName{asdasd}
  375. \def\cStyle {\large}
  376.  
  377. \titleformat{\chapter}[block]{
  378.     \centering\sc}{}{0em} %\usefont{T1}{Myriad-LF}{}{n}\selectfont
  379.     {\thispagestyle{chapterhead}
  380.     \ifPrintChapter    
  381.         \ifPrintSpecialChapter
  382.             \cStyle \specialChapterName %\\% image here
  383.         \else
  384.             \cStyle \chaptername\ \textls*[100]{\thechapternum} %\\% image here
  385.         \fi
  386.     \else
  387.         \cStyle \phantom{\chaptername}
  388.     \fi
  389.     {\vskip -0.2em}
  390.     \huge}
  391. \titlespacing{\chapter}{0pt}{*0}{*7}
  392.  
  393. %% ========================================
  394. %% SCENE BREAK
  395.  
  396. % scene break
  397. \makeatletter
  398. \newcommand{\Scene}{%
  399.   \par\nobreak\@afterheading
  400.   \vspace{\topsep}
  401.  \addvspace{\topsep\relax}
  402.     \noindent\hfil%
  403.     {{\fontsize{2\dimexpr\f@size}%
  404.       \z@{* * *}}}% \cleffont{𝄞}
  405.     \hfil\par%  
  406.   \vspace{\topsep}
  407. %  \addvspace{\topsep\relax}
  408.   \@afterindentfalse\@afterheading%
  409. }
  410. \makeatother
  411.  
  412. %% ========================================
  413. %% Headers & new chapter placing
  414. %% \usepackage{fancyhdr}
  415. %% \pagestyle{fancy}
  416.  
  417. %% % no rule under the header
  418. %% \renewcommand{\headrulewidth}{0pt}
  419.  
  420. % define the left/right mark style
  421. %% \renewcommand{\chaptermark}[1]{%
  422. %%   \markboth{\sc \booktitle---Part \thepart}{\sc \chaptername\ \thechapternum --- #1}}
  423.  
  424. %% % set the style for head/foot
  425. %% \fancyhf{}
  426. %% \fancyhead[CE]{\rightmark}
  427. %% \fancyhead[CO]{\leftmark}
  428. %% \fancyhead[LO]{\thepage}
  429. %% \fancyhead[RE]{\thepage}
  430.  
  431. \setmarks{part}{chapter}
  432.  
  433. \renewpagestyle{plain}{%
  434. \sethead{}{}{}
  435. \setfoot{}{}{}
  436. }
  437.  
  438. \newpagestyle{chapterhead}{%
  439. \sethead{}{}{}
  440. \setfoot{}{\thepage}{}
  441. }
  442.  
  443. \newpagestyle{main}{%
  444. \sethead
  445. [\thepage]
  446. %[\sc \booktitle\ifthepart{---Parte \thepart}{}]
  447. [\sc \booktitle\ifthenelse{\isempty{\thepart}}{}{---Parte \thepart}]
  448. []
  449. {}
  450. {\sc \ifthechapter{\chaptername\ \thechapternum ---}{}\chaptertitle}
  451. {\thepage}
  452. }
Advertisement
Add Comment
Please, Sign In to add comment