Debian Codegraph @

texmf-dist/doc/lualatex/fancymag/fancymag-doc.tex

raw
1 %% -------------------------------------------------------------------
2 %% Author : Ashadul Halder; Soumik Ghosh
3 %%
4 %% To use the package fancymag, compilation must be done with lualatex 
5 %% and a few required folders (as outlined in the documentation) must be present
6 %% in the working directory. These folders contain necessary font and style
7 %% resources that the package depends on.
8 %% -------------------------------------------------------------------
9
10 \documentclass[10pt,twoside]{article}
11 \usepackage{xcolor}
12 \usepackage{lipsum}
13 \usepackage{fancymag} % Load the custom package
14 \usepackage[colorlinks=true, linkcolor=blue, urlcolor=cyan, citecolor=red]{hyperref}
15 \usepackage[most]{tcolorbox}
16 \usepackage{multicol}
17 \usepackage{enumitem}
18 \usepackage{float}
19 \usepackage{array}
20 \definecolor{accent}{HTML}{0080EE}
21 \begin{document}
22 \sloppy
23
24 %%%%%%%%%%%%%%%%%%%%% Cover page %%%%%%%%%%%%%%%%%%%%%%%%%
25 \begin{fistpg}
26 \begin{tikzpicture}[remember picture, overlay]
27 \node[anchor=south west, inner sep=0] at (current page.south west) {
28 \includegraphics[width=\paperwidth, height=\paperheight]{img/fancymag-front.jpg}
29 };
30 \end{tikzpicture}
31 \cleardoublepage
32 \end{fistpg}
33
34 %%%%%%%%%%%%%%%%%%%%% Inner page 1 %%%%%%%%%%%%%%%%%%%%%%%%%
35 \begin{fistpg}
36 \begin{tikzpicture}[remember picture, overlay]
37 \node[anchor=south west, inner sep=0] at (current page.south west) {
38 \includegraphics[width=\paperwidth, height=\paperheight]{img/fancymag-about_bg_1.jpg}
39 };
40 \end{tikzpicture}
41 \begin{minipage}[l][\textheight]{0.65\textwidth}
42 \begin{center}
43 {\fontsize{20}{20} \selectfont \customfontone{\textcolor{cyan}{Title}}}\\
44 {\fontsize{13}{13} \selectfont \customfontfour{\textcolor{white}{VOLUME XVII\\ (2025)}}}\\
45 \vspace{0.5cm}
46 \end{center}
47
48 \begin{tcolorbox}[colback=blue!20!white, width=\textwidth, opacityfill=0.2]
49 \textcolor{white}{\textbf{\lettrine{L}{}\lipsum[1-2]}}
50 \end{tcolorbox}
51 \end{minipage}
52 \end{fistpg}
53
54 %%%%%%%%%%%%%%%%%%%%% Inner page 2 %%%%%%%%%%%%%%%%%%%%%%%%%
55 \begin{fistpg}
56 \begin{tikzpicture}[remember picture, overlay]
57 \node[anchor=south west, inner sep=0] at (current page.south west) {
58 \includegraphics[width=\paperwidth, height=\paperheight]{img/fancymag-about_bg_2.jpg}
59 };
60 \end{tikzpicture}
61 \begin{center}
62 \vskip 3cm
63 \begin{center}
64 {\includegraphics[height=3.5cm]{img/fancymag-logo.png}}\\
65 \vspace{1cm}
66 {\fontsize{60}{60} \selectfont \customfontone{\textcolor{white}{FANCYMAG}}}\\
67 \vspace{1cm}
68 {\fontsize{20}{20} \selectfont \customfontthree{\textcolor{cyan}{VERSION\\ (1.0)}}}\\
69 \vspace{0.5cm}
70 \end{center}
71 \end{center}
72 \end{fistpg}
73
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75 {\bgchange{img/fancymag-bg_all.jpg}
76 \newpage
77 \begin{fistpg}
78 \vskip 1cm
79 \cleardoublepage
80 \end{fistpg}
81 \bgchange{img/fancymag-bg_all.jpg}
82 \setcounter{page}{1}
83
84 %%%%%%%%%%%%%%%%%%%%% Messege %%%%%%%%%%%%%%%%%%%%%%%%%
85 \msg{Someone}{Designation}{Message from that person}{Affiliation}{img/fancymag-msg.png}{img/fancymag-m_sig.png}{3.5cm}{
86 \lettrine{T}{}he \texttt{\textbackslash msg} command is a custom LaTeX macro defined in the \texttt{mag.sty} package. It is designed to format and display figures in a structured manner, placing them either to the left or right depending on the page type. This command helps maintain consistency in figure placement throughout a document.\\
87 The \texttt{\textbackslash msg} command takes eight arguments and follows the syntax:\\
88 \texttt{\textbackslash msg\{arg1\}\{arg2\}\{arg3\}\{arg4\}\{arg5\}\{arg6\}\{arg7\}\{arg8\}}\\
89 Here, \texttt{arg1} and \texttt{arg2} typically define the figure source and description, while \texttt{arg4} through \texttt{arg7} control its size, alignment, and labeling. Arguments \texttt{arg3} and \texttt{arg8} may have specific uses depending on the document's requirements.\\
90 One key feature of \texttt{\textbackslash msg} is its ability to adjust figure placement based on whether the current page is odd or even. Internally, the command calls \texttt{\textbackslash msgfigurer} for odd-numbered pages, aligning figures to the right, and \texttt{\textbackslash msgfigurel} for even-numbered pages, aligning figures to the left. This ensures that figures always appear near the outer margin, enhancing readability in two-sided documents.\\
91 A sample implementation using the \texttt{\textbackslash msg} command might look like this:\\
92 \texttt{\textbackslash msg\{Figure1\}\{Description\}\{Unused\}\{0.5\}\{Center\}\{Scale\}\{Label\}\{Extra\}}\\
93 This structure allows the document to dynamically format figures based on the page number, making it a useful tool for professional reports and books.\\
94 To use \texttt{\textbackslash msg}, ensure that \texttt{mag.sty} is included in your LaTeX project. Since some arguments may be ignored depending on the internal logic, refer to additional package documentation for precise customization. The ability to vary figure placement with page parity makes this command particularly useful for creating well-structured, visually appealing documents.}
95
96 \msg{Someone else}{Designation}{Message from another person}{Affiliation}{img/fancymag-msg1.png}{img/fancymag-m_sig.png}{3.5cm}{
97 \lettrine{H}{}ere \texttt{\textbackslash msg} is used to show the change of design with page number (odd to even or vice-versa)}
98
99 %%%%%%%%%%%%%%%%%%%%% Other Detail %%%%%%%%%%%%%%%%%%%%%%%%%
100 \newpage
101 \fancyhead[LO]{\textcolor{accent}{\large\textbf{Fancymag}}}
102 \fancyhead[RE]{\textcolor{accent}{\large\textbf{Fancymag}}}
103 \fancyhead[RO]{\textcolor{accent}{\large\textbf{\thepage}}}
104 \fancyhead[LE]{\textcolor{accent}{\large\textbf{\thepage}}}
105
106 {\fontsize{15}{15}\selectfont \textbf{\textcolor{accent}{\textsf{{Font Availability Note}}}}}\\
107 \begin{tikzpicture}
108 \draw[fill={rgb,1:red,0;green,0;blue,0.7}, draw=none] (0, 0) rectangle (5cm, 0.15cm);
109 \end{tikzpicture}
110 \vskip 0.4cm
111 \albumphoto{Font Availability Note}{2024}{img/fancymag-di.png}
112 \section*{Font Availability Note}
113 This package requires LuaLaTeX and uses fonts bundled locally in the \texttt{fonts/} folder. These fonts are not installed system-wide and TeX distributions like TeX Live or MiKTeX may not provide them automatically. Users must compile their documents in the same directory as the \texttt{fonts/} folder.
114 \\
115 \begin{tcolorbox}[colback=blue!5!white, width=\textwidth, opacityfill=0.1]
116 {\fontsize{14}{14}\selectfont {Custom fonts}}\\
117 \begin{tabular}{l m{10cm}}
118 \textbf{Command Name} & \textbf{Example Output} \\
119 \hline\\
120 \textbackslash customfontone & {\customfontone The quick brown fox jumps over the lazy dog.} \\
121 \textbackslash customfonttwo & {\customfonttwo The quick brown fox jumps over the lazy dog.} \\
122 \textbackslash customfontthree & {\customfontthree The quick brown fox jumps over the lazy dog.} \\
123 \textbackslash customfontfour & {\customfontfour The quick brown fox jumps over the lazy dog.} \\
124 \textbackslash headrf & {\headrf The quick brown fox jumps over the lazy dog.} \\
125 \end{tabular}
126
127 \end{tcolorbox}
128 % ________________________
129 \newpage
130 {\fontsize{15}{15}\selectfont \textbf{\textcolor{accent}{\textsf{{Important notes}}}}}\\
131 \bullet Don't remove the `fancymag-msg\_bg.jpg' and `fancymag-blank.png' from the \texttt{img} folder.\\
132 \bullet Don't remove any font from the \texttt{font} folder.\\
133 \bullet Use LuaLaTeX to compile.\\
134 \bullet The \texttt{fancymag.sty} file, along with the \texttt{img/} and \texttt{fonts/} folders, must be placed in the same directory as the main \texttt{.tex} file that uses this package. This ensures that all local resources — such as custom fonts and profile images — are correctly located by the package using relative paths via \texttt{fontspec} and \texttt{graphicx}.
135
136 The recommended directory structure is as follows:
137
138 \begin{verbatim}
139 project/
140 ├── mainfile.tex % Your main document
141 ├── fancymag.sty % The package file
142 ├── mainfile.pdf % Compiled documentation (optional)
143 ├── fonts/ % Folder containing .ttf font files
144 │ ├── Audiowide-Regular.ttf
145 │ └── ...
146 ├── img/ % Folder containing image assets
147 │ ├── msg1.png
148 │ └── ...
149 \end{verbatim}
150
151
152 %%%%%%%%%%%%%%%%%%%%% Interview %%%%%%%%%%%%%%%%%%%%%%%%%
153 \titlepg{Interview}
154
155 \interview{Dr. A}{Designation} {From:}{Institute}{Alumnus}{Department}{Institute}{img/fancymag-msg1.png}{
156 The \texttt{\textbackslash interview} command provides a structured and visually appealing layout for typesetting interviews in academic or editorial publications. It displays the interviewee's name, designation, affiliations and an image, followed by the interview content.\\
157 the syntax is \\
158 \texttt{\textbackslash interview{<Name>}{<Designation>}{<Label1:>}{<Affiliation1>}{<Label2:>}{<Affiliation2>}\\{<ImagePath>}{<Interview Content>}}\\
159 $\bullet$ \textbf{Name} - Name of the interviewee (e.g., \texttt{Dr. A})\\
160 $\bullet$ \textbf{Designation} - Title or position (e.g., \texttt{Senior Scientist})\\
161 $\bullet$ \textbf{Label1} - Label for first affiliation\\
162 $\bullet$ \textbf{Affiliation1} - First institution or organization\\
163 $\bullet$ \textbf{Label2} - Second label\\
164 $\bullet$ \textbf{Affiliation2} - Second institution or department\\
165 $\bullet$ \textbf{ImagePath} - Path to the interviewee's photo (e.g., \texttt{fancymag-msg1.png})\\
166 $\bullet$ \textbf{Interview Content} - The body of the interview, which can include paragraphs, formatting and styled text.\\
167 \noindent This command is designed for use with \textbf{LuaLaTeX}. Ensure that the image path is correct relative to your `.tex' file and that the required fonts and colors (e.g., \texttt{mt}) are defined in your document or the package.
168
169 \begin{flushright}
170 \large{\textbf{Someone}}\\
171 \textcolor{mt}{\textit{Some text}}
172 \end{flushright}
173 }
174
175
176 %%%%%%%%%%%%%%%%%%%%% Article Type 1 %%%%%%%%%%%%%%%%%%%%%%%%%
177 \titlepg{Article Type 1}
178
179 \begin{particle1}{Particle 1}{detail 1}{Name}{detail 2}{detail 3}{detail 4}{img/fancymag-msg.png}
180 {It is Abstract}
181 {\lettrine{T}{}he \texttt{particle1} environment is a custom LaTeX construct used to create a stylized profile or informational block. It accepts nine arguments, which include textual information, an image path, an abstract and a main body of content. This environment is suitable for formatting personal profiles, author introductions, interview or structured descriptions in a visually engaging format.\\
182 The syntax is as follows:\\
183 \texttt{\textbackslash begin\{particle1\}\{Title\}\{Detail 1\}\{Name\}\\\{Detail 2\}\{Detail 3\}\{Detail 4\}\{img.png\}\\\{Abstract\}\{Main Text\}\\\textbackslash end\{particle1\}}\\
184 \bullet \textbf{The first argument}, \texttt{Title}, is used as the main heading or role, such as ``Professor" or ``Lead Scientist".\\
185 \bullet \textbf{The second argument}, \texttt{Detail 1}, typically describes a category or department, such as ``Astrophysics Division".\\
186 \bullet \textbf{The third argument}, \texttt{Name}, is the full name of the person being described.\\
187 \bullet \textbf{ The fourth, fifth, and sixth arguments} - \texttt{Detail 2}, \texttt{Detail 3}, and \texttt{Detail 4} — are additional attributes or information related to the subject, such as degrees, research areas, affiliations, achievements, or roles.\\
188 \bullet \textbf{The seventh argument} is the image path, such as \texttt{img/fancymag-author.png}, pointing to a profile picture or representative image that will be displayed alongside the text.\\
189 \bullet \textbf{The eighth argument} is an abstract or summary sentence that concisely describes the subject's main role, focus, or expertise. It serves as a short introduction or tagline.\\
190 \bullet \textbf{The ninth and final argument} is the main body text. This is a longer paragraph or content block that provides a detailed explanation or narrative about the subject.}
191 \end{particle1}
192
193 \begin{particle1}{Particle 1}{detail 1}{Name}{detail 2}{detail 3}{detail 4}{img/fancymag-msg1.png}
194 {It is Abstract}
195 {\textbf{Note:} The visual layout of the \texttt{particle1} environment may depend on whether it appears on an \textbf{odd} or \textbf{even} page. In many designs, the placement of the image and text is reversed or mirrored to maintain symmetry in double-sided documents. This behavior is typically implemented using conditional checks within the environment's definition. As a result, the final appearance may vary depending on the page number where the environment is placed.}
196 \end{particle1}
197
198 %%%%%%%%%%%%%%%%%%%%% Article Type 2 %%%%%%%%%%%%%%%%%%%%%%%%%
199 \titlepg{Article Type 2}
200
201 \begin{particle2}{Title}{Author}{Detail 1}{Detail 2} {img/fancymag-msg.png}{img/fancymag-side.jpeg}
202
203 The \texttt{particle2} environment is a custom LaTeX, which is well-suited for article-style entries, research summaries, or section headers that include detailed narrative text and embedded visuals.
204
205 The syntax is as follows:
206
207 \texttt{\textbackslash begin\{particle2\}\{Title\}\{Author\}\{Detail 1\}\{Detail 2\}\{author.png\}\{side.jpeg\}}\\
208 \texttt{Body text (including paragraphs, figures, etc.)}\\
209 \texttt{\textbackslash end\{particle2\}}
210
211 This environment takes six arguments before the body content begins. These arguments are used to build a structured header or banner area before rendering the main text.
212
213 The arguments are:
214
215 \bullet \textbf{Title} – The title or heading of the section, often representing a topic or article name.
216
217 \bullet \textbf{Author} – The name of the author or contributor for this content block.
218
219 \bullet \textbf{Detail 1} – A short detail such as a role, subtitle, or classification label.
220
221 \bullet \textbf{Detail 2} – Another short descriptor, for example, affiliation or focus area.
222
223 \bullet \textbf{msg.png} – The primary image, typically used as a profile photo or symbolic image, placed near the title and author.
224
225 \bullet \textbf{side.jpeg} – A secondary image which appears as sidebar background for the first page only.
226
227 \end{particle2}
228
229 \begin{particle2}{Title}{Author}{Detail 1}{Detail 2} {img/fancymag-msg.png}{img/fancymag-di1.png}
230
231 \textbf{Note:} The visual layout of the \texttt{particle2} environment may depend on whether it appears on an \textbf{odd} or \textbf{even} page. In many designs, the placement of the image and text is reversed or mirrored to maintain symmetry in double-sided documents. This behavior is typically implemented using conditional checks within the environment's definition. As a result, the final appearance may vary depending on the page number where the environment is placed.
232
233 \end{particle2}
234
235
236 %%%%%%%%%%%%%%%%%%%%% Photographs and Paintings %%%%%%%%%%%%%%%%%%%%%%%%%
237 \titlepg{Paintings}
238
239 \fancyhf{}
240 \fancyhead[LO]{\textcolor{accent}{\large\textbf{Paintings}}}
241 \fancyhead[RE]{\textcolor{accent}{\large\textbf{Paintings}}}
242 \fancyhead[RO]{\textcolor{accent}{\large\textbf{\thepage}}}
243 \fancyhead[LE]{\textcolor{accent}{\large\textbf{\thepage}}}
244
245 \photograph{Person 1}{Portrait, Left aligned}{Detail 2}{Detail 2}{img/fancymag-di1.png}{portrait}{left}
246
247 \photograph{Person 2}{Portrait, Right aligned}{Detail 2}{Detail 2}{img/fancymag-di1.png}{portrait}{right}
248
249 \photograph{Person 3}{Landscape, Right aligned}{Detail 2}{Detail 2}{img/fancymag-di.png}{landscape}{right}
250
251 \photograph{Person 4}{Landscape, Left aligned}{Detail 2}{Detail 2}{img/fancymag-di.png}{landscape}{left}
252
253 %%%%%%%%%%%%%%%%%%%%% Last page %%%%%%%%%%%%%%%%%%%%%%%%%
254 \newpage
255 \begin{fistpg}
256 \begin{tikzpicture}[remember picture, overlay]
257 \node[anchor=south west, inner sep=0] at (current page.south west) {
258 \includegraphics[width=\paperwidth, height=\paperheight]{img/fancymag-back.jpg}
259 };
260 \end{tikzpicture}
261 \clearpage
262 \end{fistpg}
263 \end{document}