<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>MOSAID Articles &amp; Tutorials - Latex</title><link href="https://mosaid.xyz/" rel="alternate"></link><link href="https://mosaid.xyz/feeds/latex.atom.xml" rel="self"></link><id>https://mosaid.xyz/</id><updated>2025-01-05T12:55:09+00:00</updated><entry><title>How to Set Up Multiple Arabic Fonts for LaTeX on Linux and Windows</title><link href="https://mosaid.xyz/articles/how-to-set-up-multiple-arabic-fonts-for-latex-on-linux-and-windows-272.html" rel="alternate"></link><published>2025-01-05T12:55:09+00:00</published><updated>2025-01-05T12:55:09+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2025-01-05:/articles/how-to-set-up-multiple-arabic-fonts-for-latex-on-linux-and-windows-272.html</id><summary type="html">&lt;p&gt;Learn how to download, install, and use Arabic fonts like DecoType Thuluth II, Amiri, and Noto Naskh Arabic in your LaTeX documents on both Linux and Windows systems.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;How to Set Up Arabic Fonts for LaTeX on Linux and Windows&lt;/h2&gt;

&lt;p&gt;When working with Arabic text in LaTeX documents, selecting the right font can make a significant difference in the appearance of your document. In this article, we will walk you through the steps to download specific Arabic fonts from &lt;a href="https://www.arfonts.net/all/downloads" target="_blank"&gt;arfonts.net&lt;/a&gt;, install them on both Linux and Windows systems, and demonstrate how to use these fonts in a LaTeX document.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Download the Fonts from arfonts.net&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To begin, you will need to download the Arabic fonts. Follow these steps:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;p&gt;Visit &lt;a href="https://www.arfonts.net/all/downloads" target="_blank"&gt;https://www.arfonts.net/all/downloads&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;Browse through the available fonts and download the desired Arabic fonts. You will typically find fonts in .zip or .rar formats.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;Extract the downloaded file, which will usually contain .ttf (TrueType Font) files.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fonts we will use for this demonstration are:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;p&gt;&lt;strong&gt;DecoType Thuluth II&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;&lt;strong&gt;Amiri&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;&lt;strong&gt;Noto Naskh Arabic&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Install the Fonts on Your System&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After downloading and extracting the .ttf font files, you need to install them on your system. Below are the installation steps for both Linux and Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Fonts on Linux&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;p&gt;&lt;strong&gt;Move the font files to the fonts directory:&lt;/strong&gt;
    &lt;p&gt;Copy the .ttf font files into the &lt;code&gt;~/.fonts&lt;/code&gt; directory (you may need to create the directory if it doesn't exist).&lt;/p&gt;

&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

mkdir -p ~/.fonts
cp /path/to/downloaded/fonts/*.ttf ~/.fonts/

&lt;/code&gt;
&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;p&gt;&lt;strong&gt;Update the font cache:&lt;/strong&gt;
    &lt;p&gt;After adding the fonts, you must update the font cache so that the system recognizes the new fonts. Run the following command in your terminal:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

fc-cache -fv

&lt;/code&gt;
&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Installing Fonts on Windows&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;p&gt;&lt;strong&gt;Move the font files to the Fonts directory:&lt;/strong&gt;
    &lt;p&gt;Navigate to the folder where the .ttf files were extracted. Right-click on each .ttf file and select &lt;em&gt;Install&lt;/em&gt; from the context menu. Alternatively, you can manually move the .ttf files to the &lt;code&gt;C:\Windows\Fonts&lt;/code&gt; directory.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;p&gt;&lt;strong&gt;Verify the installation:&lt;/strong&gt;
    &lt;p&gt;Open the &lt;em&gt;Fonts&lt;/em&gt; folder (&lt;code&gt;C:\Windows\Fonts&lt;/code&gt;) and ensure that the font files are listed.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Use the Fonts in LaTeX&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that you've installed the fonts, let's move on to how to use them in your LaTeX document. Below is an example LaTeX document that demonstrates how to use the &lt;strong&gt;DecoType Thuluth II&lt;/strong&gt;, &lt;strong&gt;Amiri&lt;/strong&gt;, and &lt;strong&gt;Noto Naskh Arabic&lt;/strong&gt; fonts for Arabic text. We will also define commands to make it easier to switch between fonts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LaTeX Example:&lt;/strong&gt;&lt;/p&gt;

&lt;pre class="language-latex"&gt;
    &lt;code class="language-latex"&gt;


\documentclass[12pt]{article}
\usepackage[french]{babel} % Main language is French
\usepackage{fontspec} % For custom fonts
\usepackage{bidi} % For bidirectional text in a non-Arabic document

% Define Arabic fonts
\newfontfamily\arabicThuluth[Script=Arabic]{DecoType Thuluth II} % Thuluth font
\newfontfamily\arabicAmiri[Script=Arabic]{Amiri} % Amiri font
\newfontfamily\arabicNaskh[Script=Arabic]{Noto Naskh Arabic} % Naskh font

% Define commands manually
\newcommand{\thuluth}[1]{%
    \begin{RTL}%
    \begin{flushright}%
    {\arabicThuluth #1}%
    \end{flushright}%
    \end{RTL}%
}
\newcommand{\amiri}[1]{%
    \begin{RTL}%
    \begin{flushright}%
    {\arabicAmiri #1}%
    \end{flushright}%
    \end{RTL}%
}
\newcommand{\naskh}[1]{%
    \begin{RTL}%
    \begin{flushright}%
    {\arabicNaskh #1}%
    \end{flushright}%
    \end{RTL}%
}

\begin{document}

\section*{Examen Final}
Voici le texte principal en français.

\vspace{1cm}

% Arabic text in different fonts
\thuluth{
  \Huge 123
  الحمد لله الذي بنعمته تتم الصالحات.}
\amiri{
  \Huge 123
  بسم الله الرحمن الرحيم.}
\naskh{
  \Huge 123
  إن مع العسر يسرا.}

\end{document}


&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Explanation of the LaTeX Code:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;p&gt;&lt;strong&gt;Font Definitions:&lt;/strong&gt; We define three different Arabic fonts using the &lt;code&gt;\newfontfamily&lt;/code&gt; command from the &lt;code&gt;fontspec&lt;/code&gt; package:
    &lt;ul&gt;
      &lt;li&gt;&lt;code&gt;\arabicThuluth&lt;/code&gt; for &lt;strong&gt;DecoType Thuluth II&lt;/strong&gt;.&lt;/li&gt;
      &lt;li&gt;&lt;code&gt;\arabicAmiri&lt;/code&gt; for &lt;strong&gt;Amiri&lt;/strong&gt;.&lt;/li&gt;
      &lt;li&gt;&lt;code&gt;\arabicNaskh&lt;/code&gt; for &lt;strong&gt;Noto Naskh Arabic&lt;/strong&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;p&gt;&lt;strong&gt;Creating Custom Commands:&lt;/strong&gt; We create custom commands (&lt;code&gt;\thuluth&lt;/code&gt;, &lt;code&gt;\amiri&lt;/code&gt;, and &lt;code&gt;\naskh&lt;/code&gt;) to simplify switching between fonts. Each command uses the corresponding Arabic font and ensures the text is displayed correctly with the &lt;code&gt;RTL&lt;/code&gt; (Right-To-Left) environment.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;&lt;strong&gt;Text Display:&lt;/strong&gt; The Arabic text is displayed using these custom commands to demonstrate the different fonts.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Compile the Document&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To compile your LaTeX document with these fonts, you should use either &lt;strong&gt;XeLaTeX&lt;/strong&gt; or &lt;strong&gt;LuaLaTeX&lt;/strong&gt;, as they are both compatible with custom fonts:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;p&gt;Run the following command to compile the document:

&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

xelatex yourfile.tex

&lt;/code&gt;
&lt;/pre&gt;
  &lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;This will produce a PDF with Arabic text formatted using the specified fonts like this:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/272-ar-fonte-tex.png" alt="Latex arabic fonts example" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Latex arabic fonts example&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By following these simple steps, you can easily download and install Arabic fonts, configure them in your LaTeX documents, and use them to display beautiful Arabic text. Whether you're working on an Arabic document or simply adding a quote in Arabic, these fonts will make your document stand out.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="Arabic fonts"></category><category term="latex"></category><category term="DecoType Thuluth II"></category><category term="Amiri"></category><category term="Noto Naskh Arabic"></category><category term="font installation"></category><category term="XeLaTeX"></category><category term="LuaLaTeX"></category><category term="Linux"></category><category term="Windows"></category><category term="RTL"></category><category term="LaTeX tutorial"></category></entry><entry><title>Creating Professional Exams with LaTeX: A Complete Guide</title><link href="https://mosaid.xyz/articles/creating-professional-exams-with-latex-a-complete-guide-264.html" rel="alternate"></link><published>2024-12-08T13:42:19+00:00</published><updated>2024-12-08T13:42:19+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-12-08:/articles/creating-professional-exams-with-latex-a-complete-guide-264.html</id><summary type="html">&lt;p&gt;Create professional exams with LaTeX using the &lt;code&gt;exam&lt;/code&gt; document class. Learn how to customize question types, include solutions, and toggle between student and correction views.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;If you're looking to create professional and structured exams using LaTeX, you're in the right place. Over the years, I’ve found the &lt;code&gt;exam&lt;/code&gt; document class to be an incredibly powerful tool for creating exams with questions, solutions, and even point-based grading. What I love most is the flexibility: you can include solutions for personal reference, but when you compile without the &lt;code&gt;answers&lt;/code&gt; parameter, they stay hidden—perfect for distributing to students. In this tutorial, I’ll guide you through some practical examples to help you get started.&lt;/p&gt;

&lt;h2&gt;Preamble and Exam Settings&lt;/h2&gt;
&lt;p&gt;The preamble in LaTeX is where you set up the structure and configurations for your document. For an exam, this includes defining the document class, setting up page geometry, and importing packages for additional functionality. In this case, we are using the &lt;code&gt;exam&lt;/code&gt; document class, which is specifically designed for creating exams with options for solutions, grading, and question formatting.&lt;/p&gt;

&lt;pre class="language-latex"&gt;
    &lt;code class="language-latex"&gt;

% Typeset exams with solutions in LaTeX
\documentclass[answers,addpoints,12pt,a4paper]{exam}
\usepackage[left=1.5cm,right=0.5cm,top=0cm,bottom=1cm]{geometry}   % Set page margins
% \usepackage[french]{babel}
\usepackage{calligra} % For calligraphy font
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb}
\usepackage{tikz} % For drawing the vertical line
\usepackage{xcolor}

\pointname{}
\pointformat{\textbf{\textit{(\thepoints)}}}

% Exam settings
\pointsinmargin
% \colorfillwithlines
% \definecolor{FillWithLinesColor}{gray}{0.8}
\colorfillwithdottedlines
\definecolor{FillWithDottedLinesColor}{gray}{0.7}
\unframedsolutions
\renewcommand{\solutiontitle}{\noindent\textbf{}\enspace}
\SolutionEmphasis{\itshape\small}
\SolutionEmphasis{\color{red}}

&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;The exam settings in the preamble customize the document's layout and functionality. For example, &lt;code&gt;\pointsinmargin&lt;/code&gt; places question point values in the margin for a cleaner look, while &lt;code&gt;\colorfillwithdottedlines&lt;/code&gt; fills answer spaces with dotted lines to guide students. Solution formatting is also fully customizable: &lt;code&gt;\unframedsolutions&lt;/code&gt; removes borders around solutions, and &lt;code&gt;\SolutionEmphasis{\color{red}}&lt;/code&gt; highlights them in red. These options allow you to tailor the exam to your preferences and needs.&lt;/p&gt;

&lt;h2&gt;Question Types&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;exam&lt;/code&gt; class provides various question types, making it highly versatile for creating exams. If compiled without the &lt;code&gt;answers&lt;/code&gt; parameter, you get a clean, professional exam. With the &lt;code&gt;answers&lt;/code&gt; parameter, the output includes solutions, perfect for creating a correction guide.&lt;/p&gt;

&lt;h3&gt;Check Options (Multiple Choice)&lt;/h3&gt;
&lt;pre class="language-latex"&gt;
    &lt;code class="language-latex"&gt;

\question[2]
This question has one correct answer. Mark it.
\begin{checkboxes}
    \choice The correct answer is after the second wrong answer.
    \choice The correct answer is after this answer.
    \choice This is the correct answer.
    \CorrectChoice Previous answers are false.
\end{checkboxes}

\question[1]
Which of the following is not a Greek philosopher?\\
\begin{oneparcheckboxes}
    \choice Socrates
    \choice Plato
    \choice Pythagoras
    \CorrectChoice You
\end{oneparcheckboxes}

&lt;/code&gt;
&lt;/pre&gt;

&lt;h3&gt;Fill in the Blank&lt;/h3&gt;
&lt;pre class="language-latex"&gt;
    &lt;code class="language-latex"&gt;

\question[2] Fill in the blank using the following words:\\
\parbox{0.9\textwidth}{%
  \colorbox{gray!30}{\parbox{\dimexpr\linewidth-2\fboxsep}{%
      \centering
      \textbf{\textit{Helium $-$ Sir Isaac Newton $-$ Alpha Centuri $-$ Einstein}}
  }}
}\\[1ex]
\fillin[Helium] is the second element of the periodic table.\\
\fillin[Sir Isaac Newton][2in] discovered the first gravitational law.\\
The answer to \fillin[life, the universe and everything][3in] is 42

&lt;/code&gt;
&lt;/pre&gt;

&lt;h3&gt;Direct Question with Space for Answers&lt;/h3&gt;
&lt;pre class="language-latex"&gt;
    &lt;code class="language-latex"&gt;

\question[5]
In no more than one paragraph, explain why the earth is round.
\begin{solutionordottedlines}[1.5in]
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis. Curabitur dictum gravida mauris.
\end{solutionordottedlines}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;These examples illustrate how to design and format exams with ease. By toggling the &lt;code&gt;answers&lt;/code&gt; parameter, you can switch between a student-ready exam and a solution-rich correction sheet.&lt;/p&gt;

&lt;h2&gt;The Exam&lt;/h2&gt;

&lt;pre class="language-latex"&gt;
&lt;code class="language-latex"&gt;


% Typeset exams with solutions in LaTeX
\documentclass[addpoints, 12pt, a4paper]{exam}
\usepackage[left=1.5cm,right=0.5cm,top=0cm,bottom=1cm]{geometry}   % Set page margins
%\usepackage[french]{babel}
\usepackage{calligra} % For calligraphy font
\usepackage[T1]{fontenc}
\usepackage{amsmath, amssymb}
\usepackage{tikz} % For drawing the vertical line
\usepackage{xcolor}

\pointname{}
\pointformat{\textbf{\textit{(\thepoints)}}}

% Exam settings
\pointsinmargin
%\colorfillwithlines
%\definecolor{FillWithLinesColor}{gray}{0.8}
\colorfillwithdottedlines
\definecolor{FillWithDottedLinesColor}{gray}{0.7}
\unframedsolutions
\renewcommand{\solutiontitle}{\noindent\textbf{}\enspace}
\SolutionEmphasis{\itshape\small}
\SolutionEmphasis{\color{red}}

% Redefine the points display format in margin
\newcommand{\borders}{%
  \tikz[remember picture, overlay, xshift=-0.5cm]{
    \draw[gray, thick] (0,-1.2) -- (0,-27);
    \draw[gray, thick] (0,-1.2) -- (\textwidth,-1.2);
    \node[] at (0.5,-0.25) {\textbf{1\textsuperscript{er} bac S.E}};
    \node[magenta] at (1.1,-0.6) {\textbf{www.mosaid.xyz}};
    \node[xshift=-2cm] at (\textwidth,-0.25) {\textbf{\today}};
    \node[xshift=-5.5cm] (A) at (\textwidth,-0.9)  {\textbf{Name :}};
    \node[xshift=-0.5cm] at (0.5\textwidth,-0.5) {\textbf{English Test n$^\circ$1 /2h}};
    \draw[gray, thick] (A.south west) -- ++(0,0.7) -- ++(6.4,0) ;
    \node[magenta] at (0.9\textwidth,-1.4) {\textbf{www.mosaid.xyz}};
  }%
}


% Redefine \exo command to avoid spacing issues
\newcommand{\exo}[1]{%
    \begin{tikzpicture}
        % Node for the text
        \node[] (text) at (0,0) {\textbf{#1}};
        % Shadow (calculated based on the text width)
        \fill[black] ([xshift=0.1cm, yshift=-0.1cm]text.south west)
                     rectangle ([xshift=0.1cm, yshift=-0.1cm]text.north east);
        % Main box (calculated based on the text width)
        \draw[fill=white] (text.south west) rectangle (text.north east);
        % Text inside the box
        \node[] at (text) {\textbf{#1}};
    \end{tikzpicture}%
}

\footer{}{Page \thepage\ of \numpages}{}

\begin{document}
\borders\\[1cm]

\noindent\hspace*{0.1cm}
\exo{Whatever Subjects English teachers teach \hspace{2mm} (10pts)}

\begin{questions}

\question[2]
This question has one correct answer. Mark it.
\begin{checkboxes}
    \choice The correct answer is after the second wrong answer.
    \choice The correct answer is after this answer.
    \choice This is the correct answer.
    \CorrectChoice Previous answers are false.
\end{checkboxes}

\question[1]
Which of the following is not a Greek philosopher?\\
\begin{oneparcheckboxes}
    \choice Socrates
    \choice Plato
    \choice Pythagoras
    \CorrectChoice You
\end{oneparcheckboxes}

\question[2] Fill in the blank using the following words:\\
\parbox{0.9\textwidth}{%
  \colorbox{gray!30}{\parbox{\dimexpr\linewidth-2\fboxsep}{%
      \centering
      \textbf{\textit{Helium ~$-$~ Sir Isaac Newton ~$-$~ Alpha Centuri ~$-$~ Einstein}}
  }}
}\\[1ex]
\fillin[Helium] is the second element of the periodic table.\\
\fillin[Sir Isaac Newton][2in] discovered the first gravitational law.\\
The answer to \fillin[life, the universe and everything][3in] is 42\\

\noindent \hspace*{-0.6cm}
\exo{Language, writing and other english stuff \hspace{2mm} (10pts)}
\setcounter{question}{0}
\question[5]
In no more than one paragraph, explain why the earth is round.
%\fillwithlines{1.5in}
%\fillwithdottedlines
\begin{solutionordottedlines}[1.5in]
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer
id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus
et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla
et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer
sapien est, iaculis in, pretium quis, viverra ac, nunc.
\end{solutionordottedlines}
\question
\begin{parts}
\part[2]
What changes to the van Allen radiation belt are needed to make
the earth into a regular icosahedron?
\begin{solutionordottedlines}[1in]
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer
id, vulputate a, magna. Donec vehicula augue eu neque.
\end{solutionordottedlines}
\part[3]
Where should the field generator be constructed if you want one of
the vertices to be located at the Royal Observatory at Greenwich?
\begin{solutionordottedlines}[1in]
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer
id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus
et netus et malesuada fames ac turpis egestas. Mauris ut leo.
\end{solutionordottedlines}
\end{parts}
\end{questions}

%\begin{center}
%\hsword{text}
%\gradetable[h][questions]
%\end{center}

\begin{center}
        {\scalebox{3}{\textbf{\textcolor{blue}{\calligra Good Luck!}}}}
\end{center}

\end{document}

&lt;/code&gt;&lt;/pre&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/264-exam-14-1_page1-no-sol.png" alt="Exam compiled with XeLatex without solutions" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Exam compiled with XeLatex without solutions&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;And to have your solutions document, all you have to do is compile it using the &lt;code&gt;parameter&lt;/code&gt; in the documentclass like this: &lt;/p&gt;

&lt;pre class="language-latex"&gt;
&lt;code class="language-latex"&gt;

\documentclass[answers,addpoints, 12pt, a4paper]{exam}

&lt;/code&gt;&lt;/pre&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/264-exam-14-1_page1.png" alt="Exam compiled with XeLatex with solutions" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Exam compiled with XeLatex with solutions&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;LaTeX is a powerful tool for creating professional exams, offering flexibility in formatting, question types, and solutions. With the &lt;code&gt;exam&lt;/code&gt; class, you can easily design multiple-choice, fill-in-the-blank, and direct-answer questions, all while maintaining a clean layout. By toggling the &lt;code&gt;answers&lt;/code&gt; parameter, you can switch between student-ready exams and detailed solution sheets for distribution after the test. Whether you're preparing an exam for your class or a correction guide, LaTeX provides the tools you need to create polished, customizable documents with ease.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="exam creation"></category><category term="LaTeX exam class"></category><category term="multiple choice questions"></category><category term="fill-in-the-blank"></category><category term="LaTeX solutions"></category><category term="LaTeX customization"></category><category term="LaTeX question types"></category><category term="LaTeX tutorial"></category><category term="exam formatting"></category><category term="student exam layout"></category><category term="correction sheet LaTeX"></category></entry><entry><title>Manual Order of References in LaTeX</title><link href="https://mosaid.xyz/articles/manual-order-of-references-in-latex-255.html" rel="alternate"></link><published>2024-06-06T17:48:46+00:00</published><updated>2024-06-06T17:48:46+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-06-06:/articles/manual-order-of-references-in-latex-255.html</id><summary type="html">&lt;p&gt;Learn how to manually order references in LaTeX without using BibTeX. Detailed examples provided for custom citation management&lt;/p&gt;</summary><content type="html">&lt;p&gt;In LaTeX, managing the order of references can be crucial for certain types of documents. While BibTeX automates citation management, there are situations where you might want to manually control the order of your references. This article will guide you on how to manually order references in LaTeX.&lt;/p&gt;

&lt;h2&gt;Why Manual Ordering?&lt;/h2&gt;
&lt;p&gt;Manual ordering of references might be necessary when:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;You have specific requirements from a publisher or institution.&lt;/li&gt;
    &lt;li&gt;You want to highlight certain references by placing them in a particular order.&lt;/li&gt;
    &lt;li&gt;You are preparing a simple document with only a few references.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Creating a Manually Ordered Bibliography&lt;/h2&gt;
&lt;p&gt;Instead of relying on BibTeX, you can manually list your references using the &lt;code&gt;thebibliography&lt;/code&gt; environment. Here’s how:&lt;/p&gt;

&lt;h3&gt;Example LaTeX File (`main.tex`)&lt;/h3&gt;
&lt;pre class="language-latex"&gt;
    &lt;code class="language-latex"&gt;

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}

\title{Sample Document with Manually Ordered References}
\author{Author Name}
\date{\today}

\maketitle

\section{Introduction}
This document cites multiple sources \cite{goossens97}, \cite{lamport94}, \cite{knuth84}, \cite{greenwade93}, \cite{patashnik88}.

\begin{thebibliography}{9}

\bibitem{goossens97}
Michel Goossens, Frank Mittelbach, and Alexander Samarin.
\textit{The \LaTeX\ Companion}.
Addison-Wesley, 1997.

\bibitem{lamport94}
Leslie Lamport.
\textit{\LaTeX: A Document Preparation System}.
Addison-Wesley, 1994.

\bibitem{knuth84}
Donald E. Knuth.
\textit{The \TeX book}.
Addison-Wesley, 1984.

\bibitem{greenwade93}
George D. Greenwade.
"The Comprehensive \TeX\ Archive Network (CTAN)."
\textit{TUGBoat}, 14(3):342--351, 1993.

\bibitem{patashnik88}
Oren Patashnik.
\textit{BibTeXing}.
Oren Patashnik, 1988.

\end{thebibliography}

\end{document}

&lt;/code&gt;
&lt;/pre&gt;

&lt;h2&gt;Steps to Compile&lt;/h2&gt;
&lt;p&gt;Since this method does not use BibTeX, compiling the document is straightforward:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Run &lt;code&gt;pdflatex main.tex&lt;/code&gt; to generate the PDF file directly.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Advantages and Disadvantages&lt;/h2&gt;
&lt;h3&gt;Advantages:&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Full control over the order of references.&lt;/li&gt;
    &lt;li&gt;No need to manage an additional BibTeX file.&lt;/li&gt;
    &lt;li&gt;Simpler for documents with few references.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Disadvantages:&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Less automation, which can lead to more manual work and errors.&lt;/li&gt;
    &lt;li&gt;Not suitable for documents with many references.&lt;/li&gt;
    &lt;li&gt;More difficult to maintain if references need to be added or removed frequently.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Manually ordering references in LaTeX is a straightforward process that provides precise control over how references appear in your document. While this method is less automated than using BibTeX, it is beneficial for specific use cases where order and simplicity are important.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="bibliography styles"></category><category term="plain"></category><category term="unsrt"></category><category term="BibTeX"></category><category term="citation order"></category><category term="LaTeX references"></category><category term="LaTeX document preparation"></category><category term="how to use plain style"></category><category term="how to use unsrt style"></category><category term="compiling LaTeX documents"></category><category term="manage LaTeX citations"></category><category term="BibTeX file"></category><category term="LaTeX example"></category><category term="LaTeX tutorial"></category><category term="LaTeX guide"></category><category term="academic writing"></category><category term="LaTeX tips and tricks"></category></entry><entry><title>How to Use plain and unsrt Bibliography Styles in LaTeX</title><link href="https://mosaid.xyz/articles/how-to-use-plain-and-unsrt-bibliography-styles-in-latex-254.html" rel="alternate"></link><published>2024-06-06T17:38:17+00:00</published><updated>2024-06-06T17:38:17+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-06-06:/articles/how-to-use-plain-and-unsrt-bibliography-styles-in-latex-254.html</id><summary type="html">&lt;p&gt;Learn how to use plain and unsrt bibliography styles in LaTeX with detailed examples. Discover the differences and see how to compile your documents for accurate citation orders.&lt;/p&gt;</summary><content type="html">&lt;p&gt;LaTeX provides a powerful way to manage bibliographies using BibTeX. Two common bibliography styles are `plain` and `unsrt`. This article will demonstrate how to use both styles in your LaTeX documents.&lt;/p&gt;

&lt;h2&gt;Using the `plain` Style&lt;/h2&gt;
&lt;p&gt;The `plain` style sorts the references alphabetically by the author's last name. Here's an example:&lt;/p&gt;

&lt;h3&gt;LaTeX File (`main.tex`)&lt;/h3&gt;
&lt;pre class="language-latex"&gt;
    &lt;code class="language-latex"&gt;

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{cite}

\begin{document}

\title{Sample Document}
\author{Author Name}
\date{\today}

\maketitle

\section{Introduction}
This document cites multiple sources \cite{goossens97, lamport94, knuth84, greenwade93, patashnik88}.

\bibliographystyle{plain}
\bibliography{references}

\end{document}

&lt;/code&gt;
&lt;/pre&gt;

&lt;h3&gt;BibTeX File (`references.bib`)&lt;/h3&gt;
&lt;pre class="language-latex"&gt;
    &lt;code class="language-latex"&gt;

@book{patashnik88,
  author    = "Oren Patashnik",
  title     = "BibTeXing",
  year      = "1988",
  publisher = "Oren Patashnik",
  address   = "Stanford, California"
}

@book{lamport94,
  author    = "Leslie Lamport",
  title     = "LaTeX: A Document Preparation System",
  year      = "1994",
  publisher = "Addison-Wesley",
  address   = "Reading, Massachusetts"
}

@book{knuth84,
  author    = "Donald E. Knuth",
  title     = "The TeXbook",
  year      = "1984",
  publisher = "Addison-Wesley",
  address   = "Reading, Massachusetts"
}

@book{goossens97,
  author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
  title     = "The LaTeX Companion",
  year      = "1997",
  publisher = "Addison-Wesley",
  address   = "Reading, Massachusetts"
}

@article{greenwade93,
  author    = "George D. Greenwade",
  title     = "The {C}omprehensive {T}e{X} {A}rchive {N}etwork ({CTAN})",
  year      = "1993",
  journal   = "TUGBoat",
  volume    = "14",
  number    = "3",
  pages     = "342--351"
}

&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;In the document above, the bibliography will be sorted alphabetically by the authors' last names.&lt;/p&gt;
&lt;figure&gt;
&lt;img src="/theme/images/articles/images/254-image1.jpg" alt="latex bibliography" style="max-width:100%;height:auto;" &gt;
&lt;figcaption&gt; Latex Bibliography ordered alphabetically &lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Using the `unsrt` Style&lt;/h2&gt;
&lt;p&gt;The `unsrt` style lists references in the order they are cited in the document. Here's how to use it:&lt;/p&gt;

&lt;h3&gt;LaTeX File (`main.tex`)&lt;/h3&gt;
&lt;pre class="language-latex"&gt;
    &lt;code class="language-latex"&gt;

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{cite}

\begin{document}

\title{Sample Document}
\author{Author Name}
\date{\today}

\maketitle

\section{Introduction}
This document cites multiple sources \cite{goossens97, lamport94, knuth84, greenwade93, patashnik88}.

\bibliographystyle{unsrt}
\bibliography{references}

\end{document}

&lt;/code&gt;
&lt;/pre&gt;

&lt;h3&gt;BibTeX File (`references.bib`)&lt;/h3&gt;
&lt;pre class="language-latex"&gt;
    &lt;code class="language-latex"&gt;

@book{patashnik88,
  author    = "Oren Patashnik",
  title     = "BibTeXing",
  year      = "1988",
  publisher = "Oren Patashnik",
  address   = "Stanford, California"
}

@book{lamport94,
  author    = "Leslie Lamport",
  title     = "LaTeX: A Document Preparation System",
  year      = "1994",
  publisher = "Addison-Wesley",
  address   = "Reading, Massachusetts"
}

@book{knuth84,
  author    = "Donald E. Knuth",
  title     = "The TeXbook",
  year      = "1984",
  publisher = "Addison-Wesley",
  address   = "Reading, Massachusetts"
}

@book{goossens97,
  author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
  title     = "The LaTeX Companion",
  year      = "1997",
  publisher = "Addison-Wesley",
  address   = "Reading, Massachusetts"
}

@article{greenwade93,
  author    = "George D. Greenwade",
  title     = "The {C}omprehensive {T}e{X} {A}rchive {N}etwork ({CTAN})",
  year      = "1993",
  journal   = "TUGBoat",
  volume    = "14",
  number    = "3",
  pages     = "342--351"
}

&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;In the document above, the bibliography will be listed in the order the references are cited in the text.&lt;/p&gt;
&lt;figure&gt;
&lt;img src="/theme/images/articles/images/254-image2.jpg" alt="latex bibliography" style="max-width:100%;height:auto;" &gt;
&lt;figcaption&gt; Latex Bibliography ordered from bib file&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;Compiling the Document&lt;/h2&gt;
&lt;p&gt;To compile your LaTeX document with BibTeX, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;pdflatex main.tex&lt;/code&gt; to generate an initial `.aux` file.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;bibtex main.aux&lt;/code&gt; to generate the bibliography.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;pdflatex main.tex&lt;/code&gt; twice more to update references and generate the final document.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By using these steps and styles, you can control the order of your bibliography entries in LaTeX documents. Choose `plain` for alphabetical order or `unsrt` for citation order.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="bibliography styles"></category><category term="plain"></category><category term="unsrt"></category><category term="BibTeX"></category><category term="citation order"></category><category term="LaTeX references"></category><category term="LaTeX document preparation"></category><category term="how to use plain style"></category><category term="how to use unsrt style"></category><category term="compiling LaTeX documents"></category><category term="manage LaTeX citations"></category><category term="BibTeX file"></category><category term="LaTeX example"></category><category term="LaTeX tutorial"></category><category term="LaTeX guide"></category><category term="academic writing"></category><category term="LaTeX tips and tricks"></category></entry><entry><title>Creating Visually Stunning Banners for Websites with LaTeX</title><link href="https://mosaid.xyz/articles/creating-visually-stunning-banners-for-websites-with-latex-237.html" rel="alternate"></link><published>2024-05-06T16:55:02+00:00</published><updated>2024-05-06T16:55:02+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-05-06:/articles/creating-visually-stunning-banners-for-websites-with-latex-237.html</id><summary type="html">&lt;p&gt;Learn how to create visually stunning banners for websites using LaTeX, AddToShipoutPictureBG, and TikZ. This article provides a step-by-step guide to leveraging LaTeX's power for banner design.&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the digital age, where websites compete for attention, visually appealing banners play a crucial role in capturing the interest of visitors. While graphic design software is commonly used for creating banners, LaTeX, a typesetting system primarily used for technical and scientific documents, offers a unique approach to banner design. In this article, we'll explore how to leverage LaTeX, along with the &lt;code&gt;AddToShipoutPictureBG&lt;/code&gt; command and the &lt;code&gt;tikz&lt;/code&gt; package, to craft visually stunning banners for websites.&lt;/p&gt;

&lt;h2&gt;The LaTeX Code:&lt;/h2&gt;

&lt;pre class="language-latex"&gt;&lt;code class="language-latex"&gt;

\documentclass[a4paper]{article}
\usepackage[landscape,margin=1cm]{geometry}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{xcolor}
\usetikzlibrary{calc}
\usepackage{eso-pic}

\AddToShipoutPictureBG{\includegraphics[width=0.5\textwidth]{student.png}}


\begin{document}

\pagecolor{purple!70!red!40}
\thispagestyle{empty}

\begin{tikzpicture}[remember picture,overlay]
    \fill[purple!20,line width=3pt] ($(current page.south east) + (-0.57\paperwidth,0)$) arc (180:0:0.52\paperwidth);
    \draw[blue!50!cyan,line width=3pt] ($(current page.south east) + (-0.56\paperwidth,0)$) arc (180:0:0.51\paperwidth);
    \draw[blue!50!cyan,line width=3pt] ($(current page.south east) + (-0.57\paperwidth,0)$) arc (180:0:0.52\paperwidth);
    \node[blue!45, font=\fontsize{18}{22}\selectfont\bfseries] at ($(current page.south)+(1,0.75)$) {mosaid.xyz};
    \draw[blue!45, line width=2.5pt] ($(current page.south)+(-1,0.5)$) -- ($(current page.south)+(3,0.5)$) ;
\end{tikzpicture}

\vspace*{6.5cm}
\fontsize{38}{48}\selectfont\bfseries
\hspace*{18cm} How To Use\\
\hspace*{16.3cm} \LaTeX~ To Create\\
\hspace*{15cm} Visually Stunning\\
\hspace*{13.8cm} Banners For your\\
\hspace*{13.4cm}Website\\
\end{document}


&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Overview of the Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The provided LaTeX code demonstrates the process of creating a banner. It utilizes the &lt;code&gt;article&lt;/code&gt; document class with specific options for paper size and landscape orientation. Essential packages such as &lt;code&gt;geometry&lt;/code&gt;, &lt;code&gt;tikz&lt;/code&gt;, &lt;code&gt;graphicx&lt;/code&gt;, and &lt;code&gt;xcolor&lt;/code&gt; are included to facilitate layout design, drawing, image handling, and color customization, respectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding AddToShipoutPictureBG&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;AddToShipoutPictureBG&lt;/code&gt; command, employed with the &lt;code&gt;eso-pic&lt;/code&gt; package, allows users to add a background image or graphic to every page of the document. In the context of banner creation, this command serves as the foundation for incorporating visual elements that span across the entire banner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using TikZ for Drawing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;TikZ, a powerful package for creating graphics within LaTeX documents, is utilized to draw the visual elements of the banner. Through TikZ commands, users can design custom shapes, lines, and text, enabling precise control over the banner's appearance. This flexibility empowers designers to unleash their creativity and craft unique banners tailored to their preferences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating the Banner&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The banner is constructed using a combination of TikZ commands within the &lt;code&gt;tikzpicture&lt;/code&gt; environment. Step-by-step, elements such as arcs, lines, and text are added to compose the banner's layout. Each TikZ command contributes to the overall design, with parameters adjusted to achieve desired sizes, positions, and styles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Visual Effects and Styling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The code incorporates visual effects and styling techniques to enhance the banner's appeal. The &lt;code&gt;pagecolor&lt;/code&gt; command is employed to set the background color of the page, while colors, line widths, and shapes are carefully chosen to create a visually engaging composition. By experimenting with different color schemes and design elements, users can customize the banner to suit various website themes and aesthetics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, LaTeX offers a unique and versatile platform for creating visually stunning banners for websites. By harnessing the power of the &lt;code&gt;AddToShipoutPictureBG&lt;/code&gt; command and the &lt;code&gt;tikz&lt;/code&gt; package, designers can unleash their creativity and produce banners that captivate audiences. Whether it's for personal blogs, professional portfolios, or corporate websites, LaTeX provides a compelling alternative for banner design that merges elegance with functionality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;TikZ and PGF Documentation: &lt;a href="https://www.ctan.org/pkg/pgf"&gt;https://www.ctan.org/pkg/pgf&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;LaTeX Graphics Companion: &lt;a href="https://www.ctan.org/pkg/latex-graphics-companion"&gt;https://www.ctan.org/pkg/latex-graphics-companion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="banner design"></category><category term="website banners"></category><category term="AddToShipoutPictureBG"></category><category term="tikz"></category><category term="visual appeal"></category><category term="banner creation"></category><category term="graphic design"></category><category term="LaTeX tutorials"></category><category term="web design"></category></entry><entry><title>How to Create Circular Profile Pictures in LaTeX: A Step-by-Step Guide</title><link href="https://mosaid.xyz/articles/how-to-create-circular-profile-pictures-in-latex-a-step-by-step-guide-235.html" rel="alternate"></link><published>2024-05-04T20:28:58+00:00</published><updated>2024-05-04T20:28:58+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-05-04:/articles/how-to-create-circular-profile-pictures-in-latex-a-step-by-step-guide-235.html</id><summary type="html">&lt;p&gt;Learn how to create circular profile pictures in LaTeX for professional documents like CVs and seminar posters. Follow our step-by-step guide to add elegance and professionalism to your presentations.&lt;/p&gt;</summary><content type="html">&lt;p&gt;In today's digital age, presenting oneself professionally is paramount, whether it's for a CV, seminar poster, or professional profile. A key element of this presentation is the profile picture. While rectangular images are common, circular profile pictures can add a touch of elegance and professionalism to your documents. In this tutorial, we'll explore how to create circular profile pictures in LaTeX, a powerful typesetting system widely used for academic and professional documents.&lt;/p&gt;

&lt;h2&gt;Step 1: Preparing the LaTeX Environment&lt;/h2&gt;

&lt;p&gt;To begin, ensure you have LaTeX installed on your system. LaTeX distributions such as TeX Live and MiKTeX are freely available and easy to install on most operating systems.&lt;/p&gt;

&lt;h2&gt;Step 2: Writing the LaTeX Code&lt;/h2&gt;

&lt;p&gt;Below is a sample LaTeX code that creates circular profile pictures:&lt;/p&gt;

&lt;pre class="language-latex" &gt;
&lt;code class="language-latex" &gt;

\documentclass{standalone}
\standaloneconfig{margin=2mm}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{ragged2e}

% Define the radius of the outer circle
\def\outerRadius{2.2cm}
% Define the radius of the inner circle
\def\innerRadius{2cm}

% Get the natural width of the image
\newlength{\imgwidth}

\newcommand\pic[2]{
    \begin{tikzpicture}
      \begin{scope}
        \draw[yellow] (0,0) circle (\outerRadius);
        \draw[yellow] (0,0) circle (\innerRadius);

        \fill[yellow] (0,0) circle (\outerRadius) -- (0,0) circle (\innerRadius);

        % Clip the image to the shape of the inner circle
        \clip (0,0) circle (\innerRadius);

        % Calculate the correct width to fit the image perfectly inside the inner circle
        \settowidth{\imgwidth}{\includegraphics{#1}}
        \pgfmathsetmacro{\scalefactor}{\innerRadius / (0.5 * \imgwidth)}

        % Include the image inside the inner circle with the calculated width
        \node at (0,0) {\includegraphics[scale=\scalefactor]{#1}};
      \end{scope}
      \node[blue,below, font=\Large\bfseries, align=center, inner sep=2pt, minimum width=2cm, minimum height=2cm, text width=3.5cm, text badly centered] at (0,-\outerRadius) {\Centering #2};
    \end{tikzpicture}
}


\begin{document}

\pic{outputimage.jpg}{Dr. Ethan Thompson}
\pic{female.png}{PhD. Sophia Rodriguez}
\pic{13mlw3.jpg}{Mia Anderson}
\pic{ef153.jpg}{Dr Mohamed Ali Soltan}

\end{document}


&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;It will give this figure:&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/236-graphicx-img-circle_banner.jpg" alt="Profile pictures with LaTeX" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Profile pictures with LaTeX&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Explanation&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;The LaTeX code utilizes the &lt;code&gt;standalone&lt;/code&gt; document class to generate standalone images.&lt;/li&gt;
  &lt;li&gt;It makes use of the &lt;code&gt;tikz&lt;/code&gt; package for drawing graphics and the &lt;code&gt;graphicx&lt;/code&gt; package for including images.&lt;/li&gt;
  &lt;li&gt;The &lt;code&gt;\pic&lt;/code&gt; command is defined to create circular profile pictures with names or titles below them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;In conclusion, by following the steps outlined in this tutorial, you can easily create circular profile pictures in LaTeX for use in CVs, seminar posters, and other professional documents. This simple yet effective technique adds a touch of professionalism to your presentations, helping you stand out in the competitive world of academia and beyond. Experiment with different styles and sizes to find the perfect look for your documents. Happy typesetting!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="circular profile pictures"></category><category term="CV"></category><category term="seminar posters"></category><category term="professional documents"></category><category term="typesetting"></category><category term="tutorial"></category><category term="design"></category><category term="presentation"></category><category term="elegance"></category><category term="professionalism"></category></entry><entry><title>Enhance LaTeX Efficiency: Divide and Conquer with input Command</title><link href="https://mosaid.xyz/articles/enhance-latex-efficiency-divide-and-conquer-with-input-command-225.html" rel="alternate"></link><published>2024-04-15T18:43:18+00:00</published><updated>2024-04-15T18:43:18+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-04-15:/articles/enhance-latex-efficiency-divide-and-conquer-with-input-command-225.html</id><summary type="html">&lt;p&gt;Streamline your LaTeX document organization with input commands. Learn how to create separate files for packages, definitions, and shortcuts, improving efficiency and consistency in your LaTeX workflow.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Writing in LaTeX offers unparalleled control and precision, but as projects grow in complexity, keeping everything organized becomes paramount. Breaking down your document into smaller, manageable files not only enhances clarity but also facilitates collaboration and maintenance. In this guide, we'll explore strategies for organizing LaTeX documents across multiple files and leveraging the &lt;code&gt;\input&lt;/code&gt; command to merge them seamlessly into a cohesive whole. Additionally, we'll delve into optimizing your workflow with separate files for packages, definitions, commands, and shortcuts, ensuring efficiency and consistency throughout your LaTeX endeavors.&lt;/p&gt;

&lt;h2&gt;1. Divide and Conquer: Organizing Your Project&lt;/h2&gt;

&lt;p&gt;When embarking on a LaTeX project, resist the temptation to cram everything into a single file. Instead, adopt a modular approach by breaking down your document into logical sections. For instance, a research paper could consist of separate files for the introduction, literature review, methodology, results, and conclusion. Similarly, a thesis might comprise chapters stored in individual files.&lt;/p&gt;

&lt;p&gt;Here's a basic project structure:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
&lt;code class="language-tex"&gt;

project/
│
├── main.tex
├── sections/
│   ├── introduction.tex
│   ├── literature.tex
│   ├── methodology.tex
│   ├── results.tex
│   └── conclusion.tex
├── packages.tex
├── definitions.tex
└── shortcuts.tex

&lt;/code&gt;
&lt;/pre&gt;

&lt;h2&gt;2. Using &lt;code&gt;\input&lt;/code&gt; command&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;\input&lt;/code&gt; command in LaTeX allows you to incorporate the contents of one file into another. This feature proves invaluable for assembling a coherent document from multiple components. To include a file, simply use the &lt;code&gt;\input&lt;/code&gt; command followed by the file's path relative to the main document.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;main.tex&lt;/code&gt;, you might have:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
&lt;code class="language-tex"&gt;

\documentclass{article}
\input{packages.tex}       % Include packages
\input{definitions.tex}    % Include definitions
\input{shortcuts.tex}      % Include shortcuts

\begin{document}
\input{sections/introduction.tex}   % Include sections
\input{sections/literature.tex}
\input{sections/methodology.tex}
\input{sections/results.tex}
\input{sections/conclusion.tex}
\end{document}

&lt;/code&gt;
&lt;/pre&gt;

&lt;h2&gt;3. Streamlining Your Workflow with Separate Files&lt;/h2&gt;

&lt;h3&gt;a. Packages:&lt;/h3&gt;

&lt;p&gt;Keep your document preamble clean by storing package imports in a separate file (&lt;code&gt;packages.tex&lt;/code&gt;). This file should contain all necessary &lt;code&gt;\usepackage&lt;/code&gt; commands.&lt;/p&gt;

&lt;h3&gt;b. Definitions:&lt;/h3&gt;

&lt;p&gt;Store custom commands and environments in &lt;code&gt;definitions.tex&lt;/code&gt;. This centralizes your document's key definitions, enhancing readability and maintainability.&lt;/p&gt;

&lt;h3&gt;c. Shortcuts:&lt;/h3&gt;

&lt;p&gt;For frequently used commands, such as mathematical symbols or formatting macros, maintain a comprehensive &lt;code&gt;shortcuts.tex&lt;/code&gt; file. This file should contain a collection of shortcuts tailored to your preferences and commonly used symbols. For example, you might define shortcuts like &lt;code&gt;\cA&lt;/code&gt; to &lt;code&gt;\cZ&lt;/code&gt; for &lt;code&gt;\mathcal{A}&lt;/code&gt; through &lt;code&gt;\mathcal{Z}&lt;/code&gt;, &lt;code&gt;\sA&lt;/code&gt; to &lt;code&gt;\sZ&lt;/code&gt; for &lt;code&gt;\mathscr{A}&lt;/code&gt; through &lt;code&gt;\mathscr{Z}&lt;/code&gt;, and so on.&lt;/p&gt;

&lt;p&gt;By centralizing your shortcuts in one file, you can easily incorporate them into any LaTeX document by simply including &lt;code&gt;\input{shortcuts.tex}&lt;/code&gt; in your preamble. This approach streamlines your workflow and ensures consistency across your documents.&lt;/p&gt;

&lt;h2&gt;4. Best Practices and Tips&lt;/h2&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Naming Conventions:&lt;/strong&gt; Adopt a consistent naming convention for your files and variables to avoid confusion.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Version Control:&lt;/strong&gt; Utilize version control systems like Git to track changes and collaborate effectively.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Documentation:&lt;/strong&gt; Include comments and documentation within your LaTeX files to aid understanding and future modifications.&lt;/p&gt;

&lt;h2&gt;5. Conclusion&lt;/h2&gt;

&lt;p&gt;Organizing LaTeX documents across multiple files offers numerous benefits, from improved clarity and maintainability to enhanced collaboration and efficiency. By dividing your project into modular components and leveraging the &lt;code&gt;\input&lt;/code&gt; command, you can streamline your workflow and create polished, professional documents with ease.&lt;/p&gt;

&lt;p&gt;Incorporate these strategies into your LaTeX workflow to unlock the full potential of this powerful typesetting system, and watch as your productivity soars.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="document organization"></category><category term="input command"></category><category term="packages"></category><category term="definitions"></category><category term="shortcuts"></category><category term="workflow optimization"></category><category term="LaTeX efficiency"></category><category term="LaTeX tips"></category></entry><entry><title>Get Started with LaTeX: A Step-by-Step Beginner's Tutorial</title><link href="https://mosaid.xyz/articles/get-started-with-latex-a-step-by-step-beginners-tutorial-216.html" rel="alternate"></link><published>2024-04-05T16:16:17+00:00</published><updated>2024-04-05T16:16:17+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-04-05:/articles/get-started-with-latex-a-step-by-step-beginners-tutorial-216.html</id><summary type="html">&lt;p&gt;Learn the basics of LaTeX with this beginner's guide. Discover how to create professional-quality documents using LaTeX's markup language, document structure, and formatting. Get started today!&lt;/p&gt;</summary><content type="html">&lt;h1&gt;Getting Started with LaTeX: A Beginner's Guide&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt; LaTeX is a powerful typesetting system commonly used for creating documents with professional quality typesetting. It's particularly popular among academics, scientists, and researchers for writing papers, theses, and technical documents. This beginner's guide aims to introduce you to the basics of LaTeX and help you get started on your journey to creating beautifully formatted documents.&lt;/p&gt;

&lt;h2&gt;What is LaTeX?&lt;/h2&gt;
&lt;p&gt;LaTeX, pronounced "lay-tech" or "lah-tech," is a typesetting system that allows users to create documents with high-quality typesetting. Unlike word processors such as Microsoft Word, LaTeX uses markup language to define document structure and formatting. This separation of content and presentation enables users to focus on the content while LaTeX takes care of the formatting.&lt;/p&gt;

&lt;h2&gt;Getting Started:&lt;/h2&gt;
&lt;p&gt;To start using LaTeX, you'll need to install a &lt;a href="https://www.latex-project.org/get/" target="_blank"&gt;LaTeX distribution such as TeX Live&lt;/a&gt; (available for Windows, macOS, and Linux) or MiKTeX (Windows). These distributions include all the necessary tools and packages to work with LaTeX.&lt;/p&gt;

&lt;p&gt;Once you have LaTeX installed, you'll typically use a text editor to write your LaTeX documents. Popular choices include TeXworks, TeXShop, and Overleaf (an online LaTeX editor). Simply open your chosen text editor and create a new file with a .tex extension.&lt;/p&gt;

&lt;h2&gt;Basic Structure:&lt;/h2&gt;
&lt;p&gt;A LaTeX document typically consists of two main parts: the preamble and the document body.&lt;/p&gt;

&lt;ol&gt;
    &lt;li&gt;&lt;p&gt; &lt;strong&gt;Preamble:&lt;/strong&gt; The preamble comes before the &lt;code&gt;\begin{document}&lt;/code&gt; command and is where you define the document class, load packages, and set document-wide formatting options.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; &lt;strong&gt;Document Body:&lt;/strong&gt; The document body is where you write the actual content of your document. This includes text, headings, lists, equations, tables, and more.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/216-216-latex-document.png" alt="A schematic view of a document" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;A schematic view of a document&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h3&gt;Example:&lt;/h3&gt;

&lt;pre class="language-latex" &gt;
    &lt;code class="language-latex" &gt;

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\title{My First LaTeX Document}
\author{Your Name}
\date{\today}

\begin{document}

\maketitle

\section{Introduction}
This is the introduction to my document.

\section{Main Content}
Here's some text in the main body of the document.

\subsection{Subsection}
This is a subsection.

\subsubsection{Subsubsection}
And this is a subsubsection.

\section{Conclusion}
Finally, we conclude our document.

\end{document}

&lt;/code&gt;
&lt;/pre&gt;

&lt;h2&gt;Compiling Your Document:&lt;/h2&gt;
&lt;p&gt;Once you've written your LaTeX document, you'll need to compile it to produce a PDF output. Most LaTeX editors provide a button or menu option to compile your document.&lt;/p&gt;

&lt;p&gt;During the compilation process, LaTeX will process your source code, generate the necessary auxiliary files, and produce the final PDF output.&lt;/p&gt;

&lt;h2&gt;Conclusion:&lt;/h2&gt;
&lt;p&gt;This beginner's guide has covered the basics of LaTeX, including document structure, formatting, and compilation. As you continue to work with LaTeX, you'll discover its many powerful features for creating professional-quality documents.&lt;/p&gt;

&lt;p&gt;To further enhance your LaTeX skills, consider exploring more advanced topics such as customizing document layouts, using additional packages for specialized formatting, and creating bibliographies and citations.&lt;/p&gt;

&lt;p&gt;With practice and patience, you'll become proficient in LaTeX and be able to produce beautifully formatted documents for your academic and professional needs.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="beginner's guide"></category><category term="document formatting"></category><category term="typesetting system"></category><category term="markup language"></category><category term="professional documents"></category><category term="academic writing"></category><category term="research papers"></category><category term="technical documents"></category><category term="LaTeX tutorial"></category></entry><entry><title>Create Stunning LaTeX Figures with GeoGebra: Step-by-Step Tutorial</title><link href="https://mosaid.xyz/articles/create-stunning-latex-figures-with-geogebra-step-by-step-tutorial-198.html" rel="alternate"></link><published>2024-02-24T20:53:20+00:00</published><updated>2024-02-24T20:53:20+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-02-24:/articles/create-stunning-latex-figures-with-geogebra-step-by-step-tutorial-198.html</id><summary type="html">&lt;p&gt;Learn how to create high-quality mathematical illustrations with GeoGebra and LaTeX TikZ. Explore tutorials, tips, and expert advice for seamless integration and dynamic visualization.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this article, I'll guide you through the process of using GeoGebra to generate LaTeX TikZ figures, empowering you to create high-quality mathematical illustrations for your documents and presentations. GeoGebra is a versatile tool widely used by educators, researchers, and professionals for its intuitive interface and powerful features in geometry, algebra, calculus, and more. LaTeX TikZ, on the other hand, is a popular package for generating vector graphics directly within LaTeX documents, offering precise control over figure design and layout.&lt;/p&gt;
&lt;p&gt;By harnessing the capabilities of GeoGebra and seamlessly integrating them with LaTeX TikZ, you can produce visually appealing mathematical figures that enhance the clarity and impact of your work. Whether you're a student writing a report, a researcher preparing a paper, or a teacher creating educational materials, mastering this combination of tools will significantly elevate the quality of your mathematical illustrations.&lt;/p&gt;

&lt;h2&gt;Exporting Figures to LaTeX TikZ&lt;/h2&gt;
&lt;p&gt;To incorporate your GeoGebra figures into LaTeX documents, you can export them to TikZ format following these steps:&lt;/p&gt;
&lt;h3&gt;1. Exporting from GeoGebra:&lt;/h3&gt;
&lt;p&gt;In GeoGebra, select the figure you want to export and navigate to the "&lt;strong style="color: #000000;"&gt;File&lt;/strong&gt;" menu. Choose the "&lt;strong style="color: #000000;"&gt;Download as&lt;/strong&gt;" option, then select "&lt;strong style="color: #000000;"&gt;PGF/TikZ.&lt;/strong&gt;" Save the exported TikZ code to a file with a .tex extension.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/198-export-to-tikz.png" alt="Export to tikz" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Export GeoGebra figure to LaTeX TikZ&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3&gt;2. Integrating into LaTeX Documents:&lt;/h3&gt;
&lt;p&gt;In your LaTeX document, use the &lt;code&gt;\begin{tikzpicture}&lt;/code&gt;...&lt;code&gt;\end{tikzpicture}&lt;/code&gt; environment to embed the &lt;code&gt;TikZ&lt;/code&gt; code. You may need to adjust the code or add additional LaTeX packages depending on your document's requirements.&lt;/p&gt;
&lt;p&gt;By exporting figures from GeoGebra to &lt;strong style="color: #000000;"&gt;LaTeX&lt;/strong&gt; &lt;strong style="color: #000000;"&gt;TikZ&lt;/strong&gt;, you can seamlessly integrate dynamic mathematical illustrations into your LaTeX documents.&lt;/p&gt;

&lt;p&gt;the above figure rsults in the following LaTeX TikZ code:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
    &lt;code class="language-tex" &gt;

\documentclass[10pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{qqqqff}{rgb}{0,0,1}
\begin{tikzpicture}[line cap=round,line join=round,&gt;=triangle 45,x=1cm,y=1cm]
\begin{axis}[
x=1cm,y=1cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-9.740000000000004,
xmax=9.74,
ymin=-6.62,
ymax=6.62,
xtick={-9,-8,...,9},
ytick={-6,-5,...,6},]
\clip(-9.74,-6.62) rectangle (9.74,6.62);
\draw[line width=2pt,dash pattern=on 1pt off 1pt,fill=black,fill opacity=0.25](-9.74,6.62)--(-9.74,-6.62)--(9.74,-6.62)--(9.74,-5.16)--(-7.93,6.62);
\draw [rotate around={0:(-1,0.5)},line width=2pt,dash pattern=on 1pt off 1pt,fill=black,fill opacity=0.25] (-1,0.5) ellipse (4.153311931459037cm and 4.153311931459037cm);
\draw[line width=2pt,dash pattern=on 1pt off 1pt,color=qqqqff,fill=qqqqff,fill opacity=0.25](9.74,0.82)--(-9.74,-1.9628571428571444)--(-9.74,-1.9628571428571444)--(-9.74,-6.62)--(9.74,-6.62)--(9.74,0.82);
\end{axis}
\end{tikzpicture}
\end{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/199-geogebra-export-1_banner.jpg" alt="GeoGebra exported figure" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;The standalone tikzpicture&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Advantages of Using GeoGebra for LaTeX Figures&lt;/h2&gt;
&lt;p&gt;GeoGebra offers several advantages for generating figures in LaTeX documents:&lt;/p&gt;
&lt;h3&gt;1. Interactive Visualization:&lt;/h3&gt;
&lt;p&gt;GeoGebra allows users to create dynamic and interactive mathematical constructions, enabling readers to explore concepts and relationships directly within the document.&lt;/p&gt;
&lt;h3&gt;2. Ease of Use:&lt;/h3&gt;
&lt;p&gt;With its intuitive interface and user-friendly tools, GeoGebra makes it easy for users of all levels to create complex mathematical figures efficiently.&lt;/p&gt;
&lt;h3&gt;3. Versatility:&lt;/h3&gt;
&lt;p&gt;GeoGebra supports a wide range of mathematical topics, including geometry, algebra, calculus, statistics, and 3D modeling, making it suitable for various types of figures and illustrations.&lt;/p&gt;
&lt;h3&gt;4. Export Options:&lt;/h3&gt;
&lt;p&gt;GeoGebra provides seamless integration with LaTeX through its export feature, allowing users to export figures in TikZ format for direct inclusion in LaTeX documents.&lt;/p&gt;
&lt;h3&gt;5. Consistency:&lt;/h3&gt;
&lt;p&gt;By generating figures directly from GeoGebra, users can ensure consistency in style and formatting throughout their LaTeX documents, enhancing the overall coherence of the presentation.&lt;/p&gt;
&lt;p&gt;Overall, leveraging GeoGebra for LaTeX figures enhances the quality, interactivity, and coherence of mathematical illustrations in academic and technical writing.&lt;/p&gt;

&lt;h2&gt;Advanced Techniques and Tips&lt;/h2&gt;
&lt;p&gt;Explore advanced techniques and tips to enhance your GeoGebra-generated LaTeX TikZ figures:&lt;/p&gt;
&lt;h3&gt;1. Animating Figures:&lt;/h3&gt;
&lt;p&gt;GeoGebra allows for the creation of animated figures. Incorporate animations into your LaTeX presentations or documents for dynamic and engaging mathematical illustrations.&lt;/p&gt;
&lt;h3&gt;2. Optimizing TikZ Code:&lt;/h3&gt;
&lt;p&gt;Optimize the TikZ code generated by GeoGebra for efficiency. Consider reducing file size and improving rendering speed by refining the exported code as needed.&lt;/p&gt;
&lt;p&gt;By mastering these advanced techniques, you can elevate the visual impact of your mathematical illustrations in LaTeX documents.&lt;/p&gt;

&lt;h3&gt;Animating Figures&lt;/h3&gt;
&lt;p&gt;Animating figures in GeoGebra adds an interactive dimension to your mathematical illustrations. Below is an example of how to animate a simple geometric construction:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;p&gt; Create a triangle ABC using GeoGebra's drawing tools.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Construct the perpendicular bisectors of each side of the triangle to find the circumcenter.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; As you animate the vertices of the triangle, observe how the circumcenter moves accordingly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Export the animated figure to LaTeX TikZ format to seamlessly integrate it into your documents or presentations. Animations like this can enhance understanding and engagement with mathematical concepts.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Integrating GeoGebra with LaTeX TikZ provides a powerful solution for creating high-quality mathematical illustrations. By following the steps outlined in this guide, you can harness the dynamic capabilities of GeoGebra to generate precise figures and seamlessly incorporate them into your LaTeX documents.&lt;/p&gt;
&lt;p&gt;From basic geometry constructions to advanced animations, GeoGebra offers a versatile toolkit for visualizing mathematical concepts. By exporting figures to LaTeX TikZ format, you ensure compatibility with LaTeX documents while maintaining the flexibility and interactivity of GeoGebra.&lt;/p&gt;
&lt;p&gt;Empower your academic and technical writing with clear and compelling mathematical illustrations generated through GeoGebra and LaTeX TikZ, enhancing the clarity and impact of your work.&lt;/p&gt;

&lt;p&gt;As you delve into the world of GeoGebra and LaTeX TikZ, I encourage you to continue exploring and experimenting with advanced features:&lt;/p&gt;
&lt;p&gt;Explore more advanced features and techniques offered by GeoGebra, such as 3D modeling, scripting, and custom app development, to take your mathematical illustrations to the next level.&lt;/p&gt;
&lt;p&gt;Connect with the GeoGebra and LaTeX communities to exchange ideas, seek advice, and share your own creations. Collaboration can provide valuable insights and inspiration for your projects.&lt;/p&gt;
&lt;p&gt;Keep an open mind and embrace creativity as you experiment with different approaches to mathematical visualization. Don't be afraid to think outside the box and push the boundaries of traditional illustration methods.&lt;/p&gt;
&lt;p&gt;By embracing curiosity and creativity, you'll unlock endless possibilities for creating captivating and informative mathematical illustrations with GeoGebra and LaTeX TikZ.&lt;/p&gt;

&lt;h2&gt;Additional Resources&lt;/h2&gt;
&lt;p&gt;Explore these additional resources to further enhance your skills in using GeoGebra and LaTeX TikZ:&lt;/p&gt;
&lt;h3&gt;1. GeoGebra Tutorials and Documentation:&lt;/h3&gt;
&lt;p&gt;Visit the &lt;a href="https://www.geogebra.org" target="_blank"&gt;official GeoGebra website&lt;/a&gt; for tutorials, documentation, and user guides to help you master the various features and functionalities of GeoGebra.&lt;/p&gt;
&lt;h3&gt;2. LaTeX Documentation and Forums:&lt;/h3&gt;
&lt;p&gt;Refer to &lt;a href="https://www.latex-project.org/help/documentation/" target="_blank"&gt;LaTeX documentation&lt;/a&gt; and online forums such as &lt;a href="https://tex.stackexchange.com/" target="_blank"&gt;Stack Exchange for LaTeX&lt;/a&gt; to find answers to specific questions, troubleshoot issues, and learn advanced LaTeX techniques.&lt;/p&gt;
&lt;h3&gt;3. Online Communities and Forums:&lt;/h3&gt;
&lt;p&gt;Join online communities and forums dedicated to GeoGebra and LaTeX to connect with other users, share tips and tricks, and stay updated on the latest developments in mathematical illustration.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="GeoGebra"></category><category term="LaTeX TikZ"></category><category term="mathematical illustrations"></category><category term="dynamic visualization"></category><category term="academic writing"></category><category term="technical documents"></category><category term="mathematical figures"></category><category term="interactive diagrams"></category><category term="latex"></category><category term="integration"></category><category term="GeoGebra tutorials integration"></category><category term="tutorials"></category></entry><entry><title>Creating GIF Animations from LaTeX Figures: A Comprehensive Tutorial</title><link href="https://mosaid.xyz/articles/creating-gif-animations-from-latex-figures-a-comprehensive-tutorial-191.html" rel="alternate"></link><published>2024-02-13T20:50:44+00:00</published><updated>2024-02-13T20:50:44+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-02-13:/articles/creating-gif-animations-from-latex-figures-a-comprehensive-tutorial-191.html</id><summary type="html">&lt;p&gt;Learn how to convert LaTeX figures into animated GIFs using ImageMagick. Follow our step-by-step guide to create dynamic visual content for your documents.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction:&lt;/h2&gt;

&lt;p&gt;Welcome to this tutorial on creating animated mathematical plots using LaTeX and TikZ. LaTeX offers powerful tools for generating dynamic documents, and in this tutorial, we'll explore how to create animated GIFs illustrating mathematical functions. Specifically, we'll generate a series of PDF pages depicting the sine function graph alongside the unit circle, which we'll then convert into a GIF animation.&lt;/p&gt;

&lt;h2&gt;Purpose of the Script:&lt;/h2&gt;

&lt;p&gt;The LaTeX script I'll share &lt;strong style="color: #000000;"&gt;produces&lt;/strong&gt; a sequence of PDF pages showing the graph of the sine function  and its relationship with the unit circle. By converting these PDF pages into a GIF animation, we can visually demonstrate the behavior of the function and its connection to the unit circle.&lt;/p&gt;

&lt;h2&gt;Breakdown of the Script:&lt;/h2&gt;
&lt;h3&gt;1. Setting up the environment&lt;/h3&gt;

&lt;pre class="language-latex" &gt;
    &lt;code class="language-latex" &gt;

\documentclass[tikz]{standalone}
\usepackage{amsmath,amssymb}
\usepackage{pgfplots}

\pgfplotsset{compat=1.13}
\usepgfplotslibrary{fillbetween}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
    set layers,
    x=1.5cm,y=1.5cm,
    xmin=-3.7, xmax=8.2,
    ymin=-1.5, ymax=1.5,
    axis lines=center,
    axis on top,
    xtick={2,4,6,8},
    ytick={-1,-.5,.5,1},
    xticklabels={$90^{\circ} (\pi/2)$, $180^{\circ} (\pi)$, $270^{\circ} (3\pi/2)$,$360^{\circ} (2\pi)$},
    xticklabel style={font=\tiny},
    yticklabels={-1,-0.5,0.5,1},
    ylabel={$\sin(x)$}, y label style={anchor=west},
    xlabel={$x$}, x label style={anchor=south},
]
\end{axis}
\end{tikzpicture}
\end{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;We'll start by setting up the environment for our plot. We begin by defining the &lt;strong style="color: #000000;"&gt;axis&lt;/strong&gt; environment using the &lt;strong style="color: #000000;"&gt;axis&lt;/strong&gt; environment provided by the &lt;strong style="color: #000000;"&gt;pgfplots&lt;/strong&gt; package. Within this environment, we specify various properties such as the size of the plot (&lt;strong style="color: #000000;"&gt;x=1.5cm, y=1.5cm&lt;/strong&gt;), the range of values for the x and y axes (&lt;strong style="color: #000000;"&gt;xmin=-3.7, xmax=8.2, ymin=-1.5, ymax=1.5&lt;/strong&gt;), and the appearance of the axis lines (&lt;strong style="color: #000000;"&gt;axis lines=center&lt;/strong&gt;). Additionally, we customize the appearance of the tick marks and labels on both axes using the &lt;strong style="color: #000000;"&gt;xtick&lt;/strong&gt;, &lt;strong style="color: #000000;"&gt;ytick&lt;/strong&gt;, &lt;strong style="color: #000000;"&gt;xticklabels&lt;/strong&gt;, and &lt;strong style="color: #000000;"&gt;yticklabels&lt;/strong&gt; options.&lt;/p&gt;

&lt;p&gt;To enhance readability, we format the x-axis tick labels to display angles in degrees along with their corresponding radians. This is achieved using the &lt;strong style="color: #000000;"&gt;xticklabels&lt;/strong&gt; option combined with LaTeX formatting commands. Furthermore, we specify labels for the x and y axes using the &lt;strong style="color: #000000;"&gt;xlabel&lt;/strong&gt; and &lt;strong style="color: #000000;"&gt;ylabel&lt;/strong&gt; options, along with their respective styles to control their placement (&lt;strong style="color: #000000;"&gt;anchor=west&lt;/strong&gt; for the y-axis label and &lt;strong style="color: #000000;"&gt;anchor=south&lt;/strong&gt; for the x-axis label).&lt;/p&gt;

&lt;p&gt;By setting up the environment in this manner, we ensure that our plot is properly configured with appropriate axis limits, tick marks, and labels, providing a solid foundation for visualizing the sine function and its relationship with the unit circle.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/191-axes-1.jpg" alt="the axis" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;The axis figure&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h3&gt;2. The canvas and x-axis&lt;/h3&gt;

&lt;pre class="language-latex" &gt;
    &lt;code class="language-latex" &gt;

\pgfonlayer{pre main}
\addplot [fill=white] coordinates {(-4,-2) (8.5,-2) (8.5,2) (-4,2)} \closedcycle;
\endpgfonlayer

\path[name path=xaxis] (axis cs:-4,0) -- (axis cs:8,0);
\coordinate (O) at (axis cs:0,0);

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Next, we utilize the &lt;code&gt;\pgfonlayer{pre main}&lt;/code&gt; command to specify a new layer for drawing elements prior to the main plot. Within this layer, we use the &lt;code&gt;\addplot&lt;/code&gt; command to draw a filled shape. The &lt;code&gt;coordinates&lt;/code&gt; keyword specifies the vertices of the shape, which form a rectangle with corners at (-4,-2), (8.5,-2), (8.5,2), and (-4,2). The &lt;code&gt;\closedcycle&lt;/code&gt; command ensures that the shape is closed, creating a closed region. Finally, the &lt;code&gt;\endpgfonlayer&lt;/code&gt; command closes the pre-main layer, completing the setup for this portion of the plot. This code segment is crucial as it defines a background rectangle that serves as the backdrop for the main plot, enhancing its visual clarity and providing a reference frame for the subsequent graphical elements.&lt;/p&gt;
&lt;p&gt;Next, we define the x-axis for later reference by using the &lt;code&gt;\path&lt;/code&gt; command to create a path named &lt;code&gt;name path=xaxis&lt;/code&gt;. This path spans from the point (-4,0) to (8,0) within the axis coordinate system. Additionally, we define a coordinate named &lt;code&gt;(O)&lt;/code&gt; at the origin of the axis, denoted as (0,0) in the axis coordinate system. These steps are crucial for subsequent calculations and graphical elements, as they establish a reference line for the x-axis and a reference point at the origin.&lt;/p&gt;

&lt;h3&gt;3. plot and circle&lt;/h3&gt;

&lt;pre class="language-latex" &gt;
    &lt;code class="language-latex" &gt;

% plot and circle
\addplot [samples=100,domain=0:8, name path=myplot](\x,{3 * sin(\x*45)/pi});
\draw[name path=circle] (axis cs:-2.5,0) circle (1.5cm);

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Next, we proceed to plot the sine function and draw the unit circle. The &lt;code&gt;\addplot&lt;/code&gt; command is used to plot the sine function, specifying 100 samples over the domain [0,8] using the &lt;code&gt;samples&lt;/code&gt; and &lt;code&gt;domain&lt;/code&gt; options. The mathematical expression for the sine function is provided as &lt;code&gt;{3 * sin(\x*45)/pi}&lt;/code&gt;, where &lt;code&gt;\x&lt;/code&gt; represents the variable of the function. Additionally, we name the path of this plot as &lt;code&gt;myplot&lt;/code&gt; using the &lt;code&gt;name path=myplot&lt;/code&gt; option.&lt;/p&gt;

&lt;p&gt;For the unit circle, we use the &lt;code&gt;\draw&lt;/code&gt; command to draw a circle centered at (-2.5,0) with a radius of 1.5cm. This is achieved by specifying the center coordinates and the radius within parentheses. The resulting circle is named &lt;code&gt;circle&lt;/code&gt; using the &lt;code&gt;name path=circle&lt;/code&gt; option. These elements form the basis for visualizing the sine function alongside the unit circle, providing valuable insights into their relationship.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/191-plot-circle.jpg" alt="plot and circle" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Plot and trigonometric circle&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h3&gt;4. fill in circle and plot&lt;/h3&gt;

&lt;pre class="language-latex" &gt;
    &lt;code class="language-latex" &gt;

% fill in circle
\draw[black,fill=blue!40] (axis cs:-2.5,0) -- (axis cs:-1.5,0) arc (0:45:1.5cm) coordinate (cc) -- cycle;
% fill in plot
\addplot[blue!30] fill between[of=xaxis and myplot, soft clip={domain=-1:1.5}];

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Here, we fill the area inside the unit circle and plot a segment of the sine function. The shape is drawn with a blue fill color, starting at (-2.5,0), moving to (-1.5,0), and tracing an arc from 0 to 45 degrees along the unit circle (We'll generate figures for other angle values using a variable \mainangle later). The coordinate (cc) is defined at the end of the arc, and the shape is closed to form a closed region. &lt;/p&gt;
&lt;p&gt;We also fill a part of the plot between the x-axis (defined as 'xaxis') and the sine function plot (defined as 'myplot'). The 'soft clip' option restricts the filling to the specified domain, which will later be represented by the variable &lt;code&gt;\mark&lt;/code&gt;. This variable will be dynamically adjusted to fill different parts of the plot based on its value, all the different figures will be making the gif animation.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/191-fill.jpg" alt="fill in the circle and plot" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Fill in the plot and circle&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;&lt;code&gt;\path[name path=mark] (axis cs:\mark,-1) -- (axis cs:\mark,1);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Here, we define a path named 'mark' using the &lt;code&gt;\path&lt;/code&gt; command. This path spans from the point with x-coordinate equal to the value of &lt;code&gt;\mark&lt;/code&gt; and y-coordinates -1 and 1 within the axis coordinate system. This path will be used later to find the intersection with the sine function plot.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;\path[name intersections={of=mark and myplot,by=cp}];&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This command finds the intersection point between the 'mark' path and the sine function plot ('myplot'). The intersection point is named 'cp' and will be used for further calculations.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;% small circles
\draw (cc) circle (3pt);
\draw (cp) circle (3pt);
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;These commands draw small circles at the coordinates 'cc' and 'cp', which represent the end point of the arc and the intersection point, respectively.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;\draw (cc) -- (cp) -- (cp|-O);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This command draws lines connecting the points 'cc' and 'cp', as well as 'cp' and the x-axis ('O'). The notation 'cp|-O' specifies the point where the vertical line from 'cp' intersects the x-axis, ensuring the line extends to the x-axis.  Basically &lt;code&gt;(cp|-O)&lt;/code&gt; creates a new coordinate with the x-coordinate from cp and the y-coordinate from O. This effectively creates a vertical line from the point cp down to the x-axis, intersecting it at the same x-coordinate as cp.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/191-the-whole-figure.jpg" alt="the whole figure" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;The whole figure&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h3&gt;5. Generating multiple figures&lt;/h3&gt;

&lt;pre class="language-latex" &gt;
    &lt;code class="language-latex" &gt;

\foreach \mainangle [count=\xx, evaluate=\mainangle as \mark using (\mainangle/45)] in {0,5,...,355,360}{
\begin{tikzpicture}
.....

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;We're using a for loop to generate figures for different values of angles, In this for loop, &lt;code&gt;\mainangle&lt;/code&gt; iterates over angles from 0 to 360 degrees with a step size of 5 degrees. For each iteration, &lt;code&gt;\mark&lt;/code&gt; is calculated as &lt;code&gt;\mainangle&lt;/code&gt; divided by 45. The generated figures will display different segments of the sine function along with the corresponding unit circle arcs for each value of&lt;code&gt; \mainangle&lt;/code&gt; and &lt;code&gt;\mark&lt;/code&gt;. The conditional statement ensures that the fill between the x-axis and the sine function plot is applied only when \mainangle exceeds 5 degrees.&lt;/p&gt;

&lt;h2&gt;The full latex code&lt;/h2&gt;

&lt;pre class="language-latex" &gt;
    &lt;code class="language-latex" &gt;


\documentclass[tikz]{standalone}
\usepackage{amsmath,amssymb}
\usepackage{pgfplots}

\pgfplotsset{compat=1.13}
\usepgfplotslibrary{fillbetween}

\begin{document}
\foreach \mainangle [count=\xx, evaluate=\mainangle as \mark using (\mainangle/45)] in {0,5,...,355,360}{
\begin{tikzpicture}
\begin{axis}[
    set layers,
    x=1.5cm,y=1.5cm,
    xmin=-3.7, xmax=8.2,
    ymin=-1.5, ymax=1.5,
    axis lines=center,
    axis on top,
    xtick={2,4,6,8},
    ytick={-1,-.5,.5,1},
    xticklabels={$90^{\circ} (\pi/2)$, $180^{\circ} (\pi)$, $270^{\circ} (3\pi/2)$,$360^{\circ} (2\pi)$},
    xticklabel style={font=\tiny},
    yticklabels={-1,-0.5,0.5,1},
    ylabel={$\sin(x)$}, y label style={anchor=west},
    xlabel={$x$}, x label style={anchor=south},
]
\pgfonlayer{pre main}
\addplot [fill=white] coordinates {(-4,-2) (8.5,-2) (8.5,2) (-4,2)} \closedcycle;
\endpgfonlayer

\path[name path=xaxis] (axis cs:-4,0) -- (axis cs:8,0);
\coordinate (O) at (axis cs:0,0);

% plot and circle
\addplot [samples=100,domain=0:8, name path=myplot](\x,{3 * sin(\x*45)/pi});
\draw[name path=circle] (axis cs:-2.5,0) circle (1.5cm);

% fill in circle and plot
\draw[black,fill=blue!40] (axis cs:-2.5,0) -- (axis cs:-1.5,0) arc (0:\mainangle:1.5cm) coordinate (cc) -- cycle;
\ifnum\mainangle&amp;gt;5
\addplot[blue!30] fill between[of=xaxis and myplot, soft clip={domain=-1:\mark}];
\fi

\path[name path=mark] (axis cs:\mark,-1) -- (axis cs:\mark,1);
\path[name intersections={of=mark and myplot,by=cp}];
% small circles
\draw (cc) circle (3pt);
\draw (cp) circle (3pt);
\draw (cc) -- (cp) -- (cp|-O);

\end{axis}
\end{tikzpicture}}
\end{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Convert PDF to GIF using ImageMagick&lt;/h2&gt;

&lt;p&gt;Finally, we use ImageMagick's &lt;code&gt;convert&lt;/code&gt; command to create a GIF from all the figures generated. We specify the following parameters:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

convert -density 160 -delay 8 -loop 0 -background white -alpha remove sinus-gif.pdf test.gif

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Explanation of parameters:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;lt;ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;-density 160&lt;/code&gt;: Specifies the density of the input PDF file. Higher density results in better image quality.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-delay 8&lt;/code&gt;: Specifies the delay between frames in the resulting GIF, in hundredths of a second.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-loop 0&lt;/code&gt;: Specifies that the GIF should loop indefinitely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-background white&lt;/code&gt;: Specifies the background color for the GIF.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-alpha remove&lt;/code&gt;: Removes any alpha channel from the images.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;sinus-gif.pdf&lt;/code&gt;: Specifies the input PDF file containing all the figures generated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;test.gif&lt;/code&gt;: Specifies the output GIF file to be created.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Running this command will convert the PDF file containing all the figures into a GIF animation named &lt;code&gt;test.gif&lt;/code&gt;, which will loop indefinitely with a delay of 0.08 seconds between frames. Adjust the parameters as needed for your specific requirements.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/191-sin-plot.gif" alt="the final animation" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;The final animation&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Feel free to experiment with the provided script and modify it to create different types of animated plots. Additionally, I recommend exploring additional resources and tutorials on LaTeX, TikZ, and pgfplots for further learning.&lt;/p&gt;

&lt;h2&gt;Conclusion:&lt;/h2&gt;

&lt;p&gt;Creating animated mathematical plots with LaTeX and TikZ opens up exciting possibilities for visualizing mathematical concepts. By mastering the techniques demonstrated in this tutorial, you can create dynamic and engaging visualizations for your LaTeX documents and presentations. I hope this tutorial inspires you to explore the world of animated plots in LaTeX. Let's get started and bring our mathematical functions to life!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="GIF"></category><category term="ImageMagick"></category><category term="animation"></category><category term="PDF"></category><category term="figures"></category><category term="graphics"></category><category term="tutorial"></category><category term="conversion"></category><category term="LaTeX tips"></category><category term="LaTeX tricks"></category><category term="LaTeX tutorial"></category><category term="LaTeX graphics"></category><category term="LaTeX animations"></category><category term="GIF creation"></category><category term="document enhancement"></category><category term="dynamic content"></category></entry><entry><title>How to Create Beautiful Atomic Structures with TikZ and LaTeX</title><link href="https://mosaid.xyz/articles/how-to-create-beautiful-atomic-structures-with-tikz-and-latex-151.html" rel="alternate"></link><published>2023-04-11T18:00:30+00:00</published><updated>2023-04-11T18:00:30+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-04-11:/articles/how-to-create-beautiful-atomic-structures-with-tikz-and-latex-151.html</id><summary type="html">&lt;p&gt;This article provides a beginner's guide to creating random atomic nuclei using TikZ library in LaTeX. Learn how to use TikZ code to generate colorful atomic nuclei with protons and neutrons.&lt;/p&gt;</summary><content type="html">&lt;p&gt;In this article, I’m going to show you how to draw atomic nuclei and visualize protons and neutrons using the powerful TikZ package in LaTeX. Let’s get started!&lt;/p&gt;

&lt;h2&gt;It All Starts with Protons and Neutrons&lt;/h2&gt;

&lt;p&gt;We’ll begin by defining the protons and neutrons using the following commands:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
    &lt;code class="language-tex" &gt;
pics/proton/.style={code={\shade[ball color=red] circle (3pt);}},
pics/neutron/.style={code={\shade[ball color=white] circle (3pt);}},
&lt;/code&gt;
&lt;/pre&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/div&gt;

&lt;p&gt;These commands allow us to draw small red and white balls whenever we call &lt;code&gt;\pic (x,y) {proton};&lt;/code&gt;. Next, we’ll add this code to generate the nucleus:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
    &lt;code class="language-tex" &gt;
\pgfmathsetseed{#1+1}
\foreach \A/\R in {8/0.2, 5/0.13, 1/0}{
    \pgfmathsetmacro{\S}{360/\A}
    \foreach \B in {0,\S,...,360}{
        \pgfmathrandomitem{\C}{nucleon}
        \pic at ($(\B+2*\A+5*rnd:\R)$) {\C};
    }
}
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;This defines another &lt;code&gt;pic&lt;/code&gt; command called &lt;code&gt;nucleussmall&lt;/code&gt;. In this macro, we declare a random list using &lt;code&gt;\pgfmathdeclarerandomlist&lt;/code&gt; which contains two protons and three neutrons. When called, this list will randomly generate protons and neutrons with probabilities of 2/5 and 3/5, respectively.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Random Seed Initialization:&lt;/strong&gt; &lt;code&gt;\pgfmathsetseed{#1+1}&lt;/code&gt;&lt;br&gt;This sets the random number generator’s seed based on the parameter &lt;code&gt;#1&lt;/code&gt; to ensure different arrangements for each nucleus.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Ring Creation:&lt;/strong&gt; &lt;code&gt;\foreach \A/\R in {8/0.2, 5/0.13, 1/0}&lt;/code&gt;&lt;br&gt;This creates three rings of nucleons with decreasing radii. &lt;code&gt;\A&lt;/code&gt; defines the number of nucleons per ring, and &lt;code&gt;\R&lt;/code&gt; defines the ring radius.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Angle Calculation:&lt;/strong&gt; &lt;code&gt;\pgfmathsetmacro{\S}{360/\A}&lt;/code&gt;&lt;br&gt;Calculates the angular spacing between nucleons in each ring.&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Random Nucleon Placement:&lt;/strong&gt; 
&lt;code&gt;\pic at ($(\B+2*\A+5*rnd:\R)$) {\C};&lt;/code&gt;&lt;br&gt;This places a nucleon at a position determined by the current angle, random offsets, and the ring’s radius using the TikZ &lt;code&gt;calc&lt;/code&gt; library’s coordinate calculation syntax &lt;code&gt;($...$)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That’s essentially the core logic. We use the same approach to define larger nuclei. Here’s the complete document:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
    &lt;code class="language-tex" &gt;
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}
\tikzset{
    pics/proton/.style={code={\shade[ball color=red] circle (3pt);}},
    pics/neutron/.style={code={\shade[ball color=white] circle (3pt);}},
    pics/nucleussmall/.style={code={%
        \pgfmathdeclarerandomlist{nucleon}{{proton}{proton}{neutron}{neutron}{neutron}}
        \pgfmathsetseed{#1+1}
        \foreach \A/\R in {8/0.2, 5/0.13, 1/0}{
            \pgfmathsetmacro{\S}{360/\A}
            \foreach \B in {0,\S,...,360}{
                \pgfmathrandomitem{\C}{nucleon}
                \pic at ($(\B+2*\A+5*rnd:\R)$) {\C};
            }
        }
    }},
    pics/nucleusbig/.style={code={%
        \pgfmathdeclarerandomlist{nucleon}{{proton}{proton}{neutron}{neutron}{neutron}}
        \pgfmathsetseed{#1+1}
        \foreach \A/\R in {24/0.4, 24/0.3, 24/0.2, 13/0.35, 11/0.27, 6/0.15, 1/0}{
            \pgfmathsetmacro{\S}{360/\A}
            \foreach \B in {0,\S,...,360}{
                \pgfmathrandomitem{\C}{nucleon}
                \pic at ($(\B+2*\A+5*rnd:\R)$) {\C};
            }
        }
    }},
    pics/nucleusbiggest/.style={code={%
        \pgfmathdeclarerandomlist{nucleon}{{proton}{proton}{neutron}{neutron}{neutron}}
        \pgfmathsetseed{#1+1}
        \foreach \A/\R in {24/0.5, 24/0.4, 24/0.3, 24/0.2, 13/0.47, 15/0.44, 13/0.37, 11/0.27, 6/0.15, 1/0}{
            \pgfmathsetmacro{\S}{360/\A}
            \foreach \B in {0,\S,...,360}{
                \pgfmathrandomitem{\C}{nucleon}
                \pic at ($(\B+2*\A+5*rnd:\R)$) {\C};
            }
        }
    }},
}
\pic at (0,0) {nucleussmall};
\pic at (2,0) {nucleusbig=1};
\pic at (4,0) {nucleusbiggest=1};
\end{tikzpicture}

\end{document}
&lt;/code&gt;
&lt;/pre&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/div&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/151-tikz-nuclei_banner.jpg" alt="Atomic nuclei using LaTeX and TikZ" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Atomic nuclei using LaTeX and TikZ&lt;/figcaption&gt;
&lt;/figure&gt;</content><category term="Latex"></category><category term="tikz"></category><category term="latex"></category><category term="atomic nuclei"></category><category term="protons"></category><category term="neutrons"></category><category term="random"></category><category term="beginner's guide"></category><category term="tutorial"></category></entry><entry><title>How to Create a Database Illustration with Tikz in Latex</title><link href="https://mosaid.xyz/articles/how-to-create-a-database-illustration-with-tikz-in-latex-150.html" rel="alternate"></link><published>2023-04-10T17:30:39+00:00</published><updated>2023-04-10T17:30:39+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-04-10:/articles/how-to-create-a-database-illustration-with-tikz-in-latex-150.html</id><summary type="html">&lt;p&gt;Learn how to create stunning database illustrations with ease using LaTeX and Tikz package. This tutorial covers step-by-step instructions to create a database schema diagram.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Latex is a versatile typesetting language, with it you can create stunning documents and illustrations with ease. In this article, I will show you just how easy it is to create a database illustration showing the tables and their relationships using the Tikz package.&lt;/p&gt;

&lt;p&gt;As always, if you're a regular reader of this corner of my website, you'll know that I start by presenting the Latex document preamble. So let's get started by opening a new Latex document and adding the necessary packages and configuration settings:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\documentclass{standalone}
\standaloneconfig{border=2mm}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes}

\begin{document}

\begin{tikzpicture}[node distance=3cm, every node/.style={font=\sffamily}]


&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;In this tutorial, we will create a database diagram using Tikz package. Tikz is a powerful tool that allows you to create high-quality graphics and illustrations. It is widely used for creating technical and scientific illustrations, flowcharts, and diagrams.&lt;/p&gt;

&lt;p&gt;A relational database is a group of tables with relationships between them. Each table represents an entity or object, and the relationships between the tables define how the objects are related to each other. We will use Tikz to create a visual representation of a database that shows the tables and their relationships.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;To start, let's define the tables that we will be using in our database. For this tutorial, we will be using six tables: "&lt;code&gt;customer&lt;/code&gt;", "&lt;code&gt;order&lt;/code&gt;", "&lt;code&gt;orderitem&lt;/code&gt;", "&lt;code&gt;product&lt;/code&gt;", "&lt;code&gt;category&lt;/code&gt;", and "&lt;code&gt;subcategory&lt;/code&gt;".&lt;/p&gt;

&lt;p&gt;Now that we have defined our tables, we can start creating our database diagram. We will use Tikz to create the tables and the relationships between them. Tikz allows us to position elements precisely on the page and create complex diagrams with ease. Each one of these tables is a \node defined using the following syntax: `&lt;code&gt;\node[positioning and other styles] (name) { body of the node }&lt;/code&gt;` like this:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

% Draw the Customer table node
  \node[rectangle, draw] (customer) {
    \begin{tabular}{|l|l|}
      \hline
      \multicolumn{2}{|c|}{\textbf{Customer}} \\
      \hline
      id &amp; INT \\
      name &amp; VARCHAR \\
      email &amp; VARCHAR \\
      \hline
    \end{tabular}
  };
  % Draw the category table node
  \node[rectangle, draw, below=2cm of customer] (category) {
    \begin{tabular}{|l|l|}
      \hline
      \multicolumn{2}{|c|}{\textbf{Category}} \\
      \hline
      id &amp; INT \\
      name &amp; VARCHAR \\
      \hline
    \end{tabular}
  };

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;We will position the tables using the "positioning" Tikz library, which allows us to position nodes relative to other nodes. with any combination of the anchors : &lt;code&gt;above&lt;/code&gt;, &lt;code&gt;below&lt;/code&gt;, &lt;code&gt;left&lt;/code&gt; and &lt;code&gt;right&lt;/code&gt;. even complex combinations like: &lt;code&gt;`below=5cm of order, right=4cm of category`&lt;/code&gt; or &lt;code&gt;`below right=2cm and 2cm of category`&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next we draw the relationships (lines) between the tables:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

% Draw the relationships between the tables
\draw[-latex] (customer) -- node[above]{one-to-many} (order);
\draw[-latex] (order) -- node[above]{one-to-many} (orderitem);
\draw[-latex] (product) -- node[above right,sloped,pos=0.15]{many-to-many} (orderitem);
\draw[-latex] (customer) -- node[above left,sloped,pos=0.7]{many-to-many} (product);
\draw[-latex] (category) -- node[above left,sloped,pos=0.7]{one-to-many} (subcategory);
\draw[-latex] (subcategory) -- node[right]{one-to-many} (product);

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/150-db-tables_banner.jpg" alt="Relational database schema using latex" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Relational database schema using latex&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;Stay tuned for the next tutorial. Until then happy Latexing.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="tikz"></category><category term="database illustration"></category><category term="database schema"></category><category term="tutorial"></category><category term="step-by-step"></category><category term="typesetting"></category><category term="document"></category><category term="relationships"></category><category term="tables"></category></entry><entry><title>How to Draw Venn Diagrams in LaTeX with TikZ</title><link href="https://mosaid.xyz/articles/how-to-draw-venn-diagrams-in-latex-with-tikz-149.html" rel="alternate"></link><published>2023-04-09T17:51:07+00:00</published><updated>2023-04-09T17:51:07+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-04-09:/articles/how-to-draw-venn-diagrams-in-latex-with-tikz-149.html</id><summary type="html">&lt;p&gt;Learn how to create Venn diagrams in LaTeX with TikZ, a powerful graphics package for producing high-quality diagrams. This step-by-step tutorial guides you through the process of drawing Venn diagrams, adding labels, colors, and transparency to create a professional-looking diagram.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Venn diagrams are an effective way of representing sets and their relationships. They are often used in mathematics, statistics, and computer science to visually depict the overlapping areas of different sets. If you are working on a project that requires a Venn diagram, LaTeX with TikZ is an excellent tool to use.&lt;/p&gt;

&lt;p&gt;In this tutorial, I will walk you through the process of creating a Venn diagram using LaTeX with TikZ. TikZ is a powerful package for creating graphics in LaTeX, and it is perfect for creating complex figures like Venn diagrams.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;Before we get started, make sure that you have a basic understanding of LaTeX and TikZ. I will assume that you know how to create a LaTeX document and how to use basic TikZ commands.&lt;/p&gt;

&lt;h2&gt;Step 1: Load the TikZ Package&lt;/h2&gt;

&lt;p&gt;The first step is to load the TikZ package. Add the following code to your LaTeX document’s preamble:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\documentclass{standalone}
\standaloneconfig{border=2mm 2mm 2mm 2mm}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Step 2: Define the Sets&lt;/h2&gt;

&lt;p&gt;The next step is to define the sets that will be used in the Venn diagram. In this example, I will use three sets: A, B, and C. Add the following code to your document:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\begin{tikzpicture}
    % Define the circles
    \def\firstcircle{(0,0) circle (2cm)}
    \def\secondcircle{(60:2cm) circle (2cm)}
    \def\thirdcircle{(0:2cm) circle (2cm)}
    % Draw the circles
    \draw \firstcircle;
    \draw \secondcircle;
    \draw \thirdcircle;
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This code defines three circles, each with a radius of 2cm. The \def command defines a macro that can be used later in the code to draw the circles. The circles are named \firstcircle, \secondcircle, and \thirdcircle, and they are drawn using the \draw command.&lt;/p&gt;

&lt;p&gt;Then we draw the nodes. The node command is used to add text to the Venn diagram. The text is added inside curly braces, and the location of the node is specified in square brackets by combining the parameters &lt;code&gt;above&lt;/code&gt;, &lt;code&gt;below&lt;/code&gt;, &lt;code&gt;left&lt;/code&gt; and &lt;code&gt;right&lt;/code&gt;, you can also use &lt;code&gt;at (x,y)&lt;/code&gt; to draw the node at the exact coordinates.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

% Add the labels
\draw (-2.5,0) node at (-1,-1) {$A$};
\draw (1,2.5) node[above] {$B$};
\draw (1,-2.5) node at (2.5,-1) {$C$};
\draw (-0.1,1.4) node[rotate=20] {$A \cap B \setminus C$};
\draw (1.3,1.5) node[rotate=20] {$B \cap C$};
\draw (0.6,-0.3) node[rotate=45] {$A \cap C$};
\draw (1,0.5) node {$A \cap B \cap C$};

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Step 3: Add the Overlapping Areas&lt;/h2&gt;

&lt;p&gt;The next step is to add the overlapping areas between the sets. To do this, we will use the &lt;code&gt;scope&lt;/code&gt; and &lt;code&gt;\clip&lt;/code&gt; commands to define the area that will be filled with color. The \fill command is used to fill the area with the specified color. Like so:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

% Fill the intersections
\begin{scope}
  \clip \firstcircle;
  \fill[red,opacity=0.5] \secondcircle;
\end{scope}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;The whole thing put together :&lt;/h2&gt;
&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\documentclass{standalone}
\standaloneconfig{border=2mm 2mm 2mm 2mm}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}
\begin{tikzpicture}

% Define the circles
\def\firstcircle{(0,0) circle (2cm)}
\def\secondcircle{(60:2cm) circle (2cm)}
\def\thirdcircle{(0:2cm) circle (2cm)}

% Draw the rectangle
\draw[dashed] (-3,-2.5) rectangle (4.5,4.5) node at (-2.5,4) {$E$};

% Draw the circles
\draw \firstcircle;
\draw \secondcircle;
\draw \thirdcircle;

% Fill the intersections
\begin{scope}
  \clip \firstcircle;
  \fill[red,opacity=0.5] \secondcircle;
\end{scope}

\begin{scope}
  \clip \firstcircle;
  \fill[green,opacity=0.5] \thirdcircle;
\end{scope}

\begin{scope}
  \clip \secondcircle;
  \fill[blue,opacity=0.5] \thirdcircle;
\end{scope}


% Add the labels
\draw (-2.5,0) node at (-1,-1) {$A$};
\draw (1,2.5) node[above] {$B$};
\draw (1,-2.5) node at (2.5,-1) {$C$};
\draw (-0.1,1.4) node[rotate=20] {$A \cap B \setminus C$};
\draw (1.3,1.5) node[rotate=20] {$B \cap C$};
\draw (0.6,-0.3) node[rotate=45] {$A \cap C$};
\draw (1,0.5) node {$A \cap B \cap C$};

\end{tikzpicture}

\end{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/149-venn-diagram.jpg " alt="Venn Diagram using Latex" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Venn Diagram using Latex&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;And there you are, you can start making Venn Diagrams easily and add them to your documents&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="Venn diagram"></category><category term="latex"></category><category term="tikz"></category><category term="graphics"></category><category term="diagrams"></category><category term="tutorial"></category><category term="step-by-step"></category><category term="labels"></category><category term="colors"></category><category term="transparency"></category></entry><entry><title>From Math to Romance: How LaTeX Can Help You Create a Love Letter Brochure</title><link href="https://mosaid.xyz/articles/from-math-to-romance-how-latex-can-help-you-create-a-love-letter-brochure-148.html" rel="alternate"></link><published>2023-04-08T18:47:00+00:00</published><updated>2023-04-08T18:47:00+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-04-08:/articles/from-math-to-romance-how-latex-can-help-you-create-a-love-letter-brochure-148.html</id><summary type="html">&lt;p&gt;Discover the versatility of LaTeX beyond science and math papers in creating stunning love letters, brochures, and flyers. Learn how to use LaTeX templates and packages, and experiment with drawing elements using TikZ code.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Greetings dear reader, In this article I an going to show just how versatile Latex is. Yes Latex is not just math and science papers, it can also be used to create stunning letters, brochures ad fliers. Just read along and see some of Latex magic for yourself&lt;/p&gt;

&lt;p&gt;Now, I'm no expert in LaTeX, but I've dabbled in it enough to know that it can be a bit daunting at first. But don't worry – there are plenty of resources out there to help you get started. You can find LaTeX templates online, or even take a course to learn the basics. And once you get the hang of it, the possibilities are endless.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;h2&gt;The main components of our love letter&lt;/h2&gt;

&lt;p&gt;OK let's get technical, Our Latex document will have a landscape layout to have enough width for our components, it will be divided into two columns using the &lt;code&gt;multicol&lt;/code&gt; package. Then we will have essentially 3 big items in our love letter brochure:&lt;/p&gt;

&lt;h2&gt;1. "ILOVEYOU" for loop&lt;/h2&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\newcommand{\FillWithLove}[1]{\luaexec{for i=1,#1 do tex.print('ILOVEYOU') end}}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;2. A tri-colored ribbon&lt;/h2&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;Next is a &lt;code&gt;tikzpicture&lt;/code&gt; that contains 3 parts, a tri-colored ribbon that goes across the brochure, it will be generated by the following code, feel free to experiment with it and see how it goes:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\draw [draw=none,fill=ThirdPurple,opacity=0.7]
(-15,-6) to[out=20,in=170] (-5,-5) to[out=350,in=330] (3,-1)
to[out=150,in=210] (2,2)
to[out=30,in=180] (15,11) -- (15,9)
to[out=180,in=30] (3,1)
to[out=210,in=150] (4,-1)
to[out=330,in=350] (-5,-6.2)
to[out=170,in=20] (-15,-7) -- cycle;
\draw [draw=none,fill=SecondPurple,opacity=0.7]
(-15,-4) to[out=20,in=170] (-5,-4)
to[out=350,in=330] (3,0)
to[out=150,in=210] (2,3)
to[out=30,in=180] (15,12) -- (15,10)
to[out=180,in=30] (3,2)
to[out=210,in=150] (4,0)
to[out=330,in=350] (-5,-5)
to[out=170,in=20] (-15,-6) -- cycle;
\draw [draw=none,fill=FirstPurple,opacity=0.7]
(-15,-4) to[out=20,in=170] (-5,-3) to[out=350,in=330] (3,1) to[out=150,in=210] (2,4)
to[out=30,in=180] (13,11) -- (14,11) to[out=180,in=30] (3,3) to[out=210,in=150] (4,1)
to[out=330,in=350] (-5,-4) to[out=170,in=20] (-15,-5.3) -- cycle;

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;3. What's Love without hearts&lt;/h2&gt;

&lt;p&gt;The next thing we draw in our tikzpicture is hearts, bigger ones, smaller ones, medium ones. well you get the picture. Using the following latex code. It is a latex command that controls how the shape of the heart will be dranw, the shift (position), rotate, x and y scale and opacity&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\newcommand\heart[5]{%
    \begin{scope}[shift={#1},rotate={#2},xscale={#3},yscale={#3},opacity={#4}]
        \draw[draw=none,fill=#5](0,-3.12) -- (2.06,-1.06) to[out=45,in=-45]
        (2.06,1.06)to[out=135,in=45](0,1.12)to[out=135,in=45](-2.06,1.06)to[out=225,in=135]
        (-2.06,-1.06)--cycle;
    \end{scope}
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;4. The small golden stripe&lt;/h2&gt;

&lt;p&gt;The last element of the tikzpicture is a small golden ribbon that goes in a curve across the letter brochure:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\draw[draw=none,fill=GoldenStrip,path fading=radialfade,opacity=0.7]
(-16,7) to[out=-10,in=170]
(1,0) to[out=-10,in=200]
(9,1) to[out=20,in=-20]
(6,3) to[out=160,in=-80]
(2,8) to[out=100,in=100]
(3,9) to[out=-80,in=100]
(4,6) to[out=-80,in=-90]
(17,-4) --
(17,-3.7) to[out=-90,in=-80]
(4,6.3) to[out=100,in=-80]
(3,9.3) to[out=100,in=100]
(2,8.3) to[out=-80,in=160]
(6,3.3) to[out=-20,in=20]
(9,1.3) to[out=200,in=-10]
(1,0.3) to[out=170,in=-10]
(-16,7.3) -- cycle;

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;That's it with the tikzpicture, we just have to make sure that the figure won't interfere with the text of our love letter, we will do this by setting the tikzpicture to be on the background like so:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\begin{tikzpicture}[remember picture,overlay,shift={(current page.center)}]
    % .... the ribbons and hearts go here
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The last part of our love letter is the actual content, the text we will write, the main part besides the huge title page on the right side of our brochure, is a heart shaped paragraph, this can be a poem, or your text of the letter. A heart shaped paragraph can be achieved  with &lt;code&gt;shapepar&lt;/code&gt; package.&lt;/p&gt;

&lt;h2&gt;The whole letter put together&lt;/h2&gt;

&lt;p&gt;As always, I never let my article finish without giving the full working latex code, so here it is, enjoy:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\documentclass[landscape]{article}
\usepackage[margin=0cm]{geometry}
\usepackage{multicol}
\usepackage{tikz}
\usepackage{tikzpagenodes}
\usetikzlibrary{fadings}
\usepackage{luacode}
\usepackage{fontspec,microtype,shapepar,xcolor}


\definecolor{BgColor}{RGB}{236,195,203}
\definecolor{TextColor1}{RGB}{225,87,180}
\definecolor{TextColor2}{RGB}{225,87,20}
\definecolor{FirstPurple}{RGB}{225,87,183}
\definecolor{SecondPurple}{RGB}{225,157,218}
\definecolor{ThirdPurple}{RGB}{217,130,180}
\definecolor{BigHeartColor}{RGB}{255,0,152}
\definecolor{SmallerHeartColor}{RGB}{255,0,255}
\definecolor{SmallestHeartColor}{RGB}{255,0,102}
\definecolor{GoldenStrip}{RGB}{251,255,120}

\newcommand{\FillWithLove}[1]{\luaexec{for i=1,#1 do tex.print('ILOVEYOU') end}}

\tikzfading [name=radialfade, inner color=transparent!0, outer color=transparent!100]


\newcommand\heart[5]{%
    \begin{scope}[shift={#1},rotate={#2},xscale={#3},yscale={#3},opacity={#4}]
        \draw[draw=none,fill=#5](0,-3.12) -- (2.06,-1.06) to[out=45,in=-45]
        (2.06,1.06)to[out=135,in=45](0,1.12)to[out=135,in=45](-2.06,1.06)to[out=225,in=135]
        (-2.06,-1.06)--cycle;
    \end{scope}
}

\begin{document}
\begin{tikzpicture}[remember picture,overlay,shift={(current page.center)}]
%stripes
    \draw [draw=none,fill=ThirdPurple,opacity=0.7]
    (-15,-6) to[out=20,in=170] (-5,-5) to[out=350,in=330] (3,-1)
    to[out=150,in=210] (2,2)
    to[out=30,in=180] (15,11) -- (15,9)
    to[out=180,in=30] (3,1)
    to[out=210,in=150] (4,-1)
    to[out=330,in=350] (-5,-6.2)
    to[out=170,in=20] (-15,-7) -- cycle;
    \draw [draw=none,fill=SecondPurple,opacity=0.7]
    (-15,-4) to[out=20,in=170] (-5,-4)
    to[out=350,in=330] (3,0)
    to[out=150,in=210] (2,3)
    to[out=30,in=180] (15,12) -- (15,10)
    to[out=180,in=30] (3,2)
    to[out=210,in=150] (4,0)
    to[out=330,in=350] (-5,-5)
    to[out=170,in=20] (-15,-6) -- cycle;
    \draw [draw=none,fill=FirstPurple,opacity=0.7]
    (-15,-4) to[out=20,in=170] (-5,-3) to[out=350,in=330] (3,1) to[out=150,in=210] (2,4)
    to[out=30,in=180] (13,11) -- (14,11) to[out=180,in=30] (3,3) to[out=210,in=150] (4,1)
    to[out=330,in=350] (-5,-4) to[out=170,in=20] (-15,-5.3) -- cycle;
%hearts
    \heart{(6.5,1.5)}{0}{2.4}{0.1}{BigHeartColor}
    \heart{(9.5,-6)}{45}{1}{0.1}{SmallerHeartColor}
    \heart{(4,9)}{-20}{0.8}{0.1}{SmallestHeartColor}
    \heart{(7,9.5)}{-23}{0.2}{1}{SmallestHeartColor}
    \heart{(11,2.5)}{-23}{0.2}{1}{SmallestHeartColor}
    \heart{(5,-6.5)}{-23}{0.2}{1}{SmallestHeartColor}
    \heart{(6.5,-6.5)}{-40}{0.2}{1}{SmallestHeartColor}
    \heart{(4.5,-8.5)}{-80}{0.2}{1}{SmallestHeartColor}
%light strip
    \draw[draw=none,fill=GoldenStrip,path fading=radialfade,opacity=0.7]
    (-16,7) to[out=-10,in=170]
    (1,0) to[out=-10,in=200]
    (9,1) to[out=20,in=-20]
    (6,3) to[out=160,in=-80]
    (2,8) to[out=100,in=100]
    (3,9) to[out=-80,in=100]
    (4,6) to[out=-80,in=-90]
    (17,-4) --
    (17,-3.7) to[out=-90,in=-80]
    (4,6.3) to[out=100,in=-80]
    (3,9.3) to[out=100,in=100]
    (2,8.3) to[out=-80,in=160]
    (6,3.3) to[out=-20,in=20]
    (9,1.3) to[out=200,in=-10]
    (1,0.3) to[out=170,in=-10]
    (-16,7.3) -- cycle;
\end{tikzpicture}
\begin{multicols}{2}
\pagecolor{BgColor}
\topskip0pt
\color{TextColor1}
\fontdimen2\font=0pt

\noindent\begin{minipage}{0.47\textwidth}{\small\FillWithLove{63}}\end{minipage}
\vspace*{0.7cm}
\Large
\heartpar{\itshape
Only name the day, and we’ll fly away
  In the face of old traditions,
To a sheltered spot, by the world forgot,
  Where we’ll park our inhibitions.
Come and gaze in eyes where the lovelight lies
  As it psychoanalyzes,
And when once you glean what your fantasies mean
  Life will hold no more surprises.
When you’ve told your love what you’re thinking of
  Things will be much more informal;
Through a sunlit land we’ll go hand-in-hand,
  Drifting gently back to normal.}


\vspace*{4cm}
\noindent\begin{minipage}{0.47\textwidth}{\small\FillWithLove{35}}\end{minipage}

\columnbreak
\vspace*{5cm}
\begin{center}
\color{TextColor2}
{\bf
    {\fontsize{30}{36}\selectfont DEAR XXXXXXXX}\\\vspace{12pt}
    {\fontsize{30}{36}\selectfont HAPPY \\\vspace{12pt}}
    {\fontsize{30}{36}\selectfont XXXXXXXXXXXXX\\}\vspace{12pt}
    {\fontsize{30}{36}\selectfont and YYYYYYYYYYY\\}
}
\end{center}

\begin{center}
{\bf
    \Large{AAAAAAAA\\\vspace{3pt} BBBBBBBBBBB\\\vspace{10pt}}
    CCCCCCCC DDDDDDDDD
}
\end{center}

\end{multicols}
\color{TextColor1}
footnote~~left\hfill\itshape footnote right~~
\end{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/148-love-letter-with-latex.jpg" alt="Love Letter with Latex" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Love Letter with Latex&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;And there you have it. never settle for a plain old love letter when you can create a beautiful brochure that expresses your love in a way that's truly unforgettable. With LaTeX, the sky's the limit. So go ahead – let your creativity flow and make your love letter a work of art.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="love letter"></category><category term="brochure"></category><category term="flyer"></category><category term="templates"></category><category term="packages"></category><category term="tikz"></category><category term="code"></category><category term="elements"></category><category term="drawing"></category></entry><entry><title>How to Create Professional Business Cards with LaTeX and Tikz</title><link href="https://mosaid.xyz/articles/how-to-create-professional-business-cards-with-latex-and-tikz-147.html" rel="alternate"></link><published>2023-04-07T15:38:54+00:00</published><updated>2023-04-07T15:38:54+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-04-07:/articles/how-to-create-professional-business-cards-with-latex-and-tikz-147.html</id><summary type="html">&lt;p&gt;Learn how to create professional-looking business cards using LaTeX and Tikz. No need for expensive software - this tutorial will guide you through the process step by step.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Greetings dear readers, In this article I am going to show you how to create awesome business cards using nothing but Latex and Tikz, No need for payed software Like Adobe Illustrator or the like.&lt;/p&gt;

&lt;p&gt;Our business card will be a small rectangle with a width of 5 and height of 8. It will contain two parts, a small band or strip (width = 1.2 ) that we will color in cyan and the bigger part is the rest of the card. we'll achieve this using the following Latex commands:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\pgfmathsetmacro{\cardroundingradius}{4mm}
\pgfmathsetmacro{\striproundingradius}{3mm}
\pgfmathsetmacro{\cardwidth}{5}
\pgfmathsetmacro{\cardheight}{8}
\newcommand{\stripcolor}{cyan}
\pgfmathsetmacro{\stripwidth}{1.2}
\pgfmathsetmacro{\strippadding}{0.1}
\pgfmathsetmacro{\textpadding}{0.2}
\pgfmathsetmacro{\ruleheight}{0.1}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;the &lt;code&gt;\cardroundingradius&lt;/code&gt; will make for a nice looking round corner in the border of our card. The other commands are self-explanatory.&lt;/p&gt;
&lt;p&gt;Next we will define the information we will put in our card such as email, phone number, name ...&lt;/p&gt;
&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\newcommand{\striptext}{MOSAID Radouan \rotatebox[origin=c]{-90}{\ding{49}}}
\newcommand{\name}{MOSAID Radouan}
\newcommand{\email}{ \faEnvelope~ \textit{\fontspec{Noto Serif}\fontsize{9pt}{12pt}\selectfont mymail@website.xyz}}
\newcommand{\myphone}{ \faPhone~ \textit{\fontspec{Liberation Sans}\fontsize{8pt}{10pt}\selectfont +(212) 123 4567890}}
\newcommand{\site}{\textit{\fontspec{Noto Serif}\fontsize{12pt}{14pt}\selectfont mosaid.xyz/me}}
\newcommand{\bottomcaption}{Programming}
\newcommand{\content}{\textit{\fontspec{Noto Serif}\fontsize{12pt}{14pt}\selectfont Tutorials in C++, C, Python, PHP...}}
\newcommand{\photo}{\includegraphics[width=\textwidth]{frame.png}}%QR code can be obtain online for free for your
\newcommand{\stripfontsize}{\Huge}                                %website
\newcommand{\captionfontsize}{\LARGE}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;That's all the preparations we need to make our business card, what's next is to create our tikzpicture environment and start drawing the components of our card like so:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\begin{tikzpicture}
    \draw[rounded corners=\cardroundingradius] (0,0) rectangle (\cardwidth,\cardheight);
    \fill[\stripcolor,rounded corners=\striproundingradius] (\strippadding,\strippadding)
    rectangle (\strippadding+\stripwidth,\cardheight-\strippadding)
    node[rotate=90,above left,black,font=\stripfontsize] {\striptext};
    \node[align=center, text width=(\cardwidth-\strippadding-\stripwidth-2*\textpadding)*1cm,
      below right,inner sep=0] at (\strippadding+\stripwidth+\textpadding,\cardheight-\textpadding)
    {
    {\name}\\
    \vspace{0.3cm}
    {\myphone}\\
    \vspace{0.2cm}
    {\email }\\
    \tikz{\fill (0,0) rectangle (\cardwidth-\strippadding-\stripwidth-2*\textpadding,\ruleheight);}\\
    \vspace{0.2cm}
    {\captionfontsize \bottomcaption}\\
    {\content}\\
    {\photo }\\
    {\site}\\
    };
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/147-business-card.jpg" alt="Business card using Latex and tikz" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Business Card using Latex and Tikz&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Just a quick note for anyone following along: The &lt;code&gt;\faEnvelope&lt;/code&gt; and &lt;code&gt;\faPhone&lt;/code&gt; commands used in the &lt;code&gt;\email&lt;/code&gt; and &lt;code&gt;\myphone&lt;/code&gt; definitions require the Font Awesome package to be loaded in the LaTeX document. If you don't have this package installed, you can replace these commands with regular text (e.g. "Email:" and "Phone:") or find an alternative package that provides similar icons.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;And there you are, you can try to experiment with the above latex template and create your own awesome business cards, until the next latex tutorial, happy latexing.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="tikz"></category><category term="business cards"></category><category term="DIY"></category><category term="design"></category><category term="professional"></category><category term="tutorial"></category><category term="affordable"></category><category term="custom"></category><category term="creative"></category></entry><entry><title>latex Tutorial: How to plot Axes and Center of Symmetry</title><link href="https://mosaid.xyz/articles/latex-tutorial-how-to-plot-axes-and-center-of-symmetry-146.html" rel="alternate"></link><published>2023-04-06T19:49:44+00:00</published><updated>2023-04-06T19:49:44+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-04-06:/articles/latex-tutorial-how-to-plot-axes-and-center-of-symmetry-146.html</id><summary type="html">&lt;p&gt;This tutorial explains how to plot the axes and center of symmetry for two different functions using LaTeX and Tikz. It includes code snippets and illustrations for better understanding.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Greetings and welcome to yet another maths related Latex Tutorial. When graphing a function, it's often useful to plot the axes and center of symmetry as reference points. In this tutorial, we'll go over how to plot the axes and center of symmetry for two different functions:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$f(x) = 0.67(x-4)^2+1$&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$g(x) = \sin(x) + 1$&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;Plotting the Axes of Symmetry for $f(x)$&lt;/h2&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;The function &lt;code&gt;$f(x)$&lt;/code&gt; is a quadratic polynomial of degree 2, with a leading coefficient of 0.67. The graph of the function $f(x) = 0.67(x-4)^2 +1$ is a parabola with a vertex at the point &lt;code&gt;(-b/2a,f(-b/2a))&lt;/code&gt; and an axes of symmetry of the equation: &lt;code&gt;x = -b/2a&lt;/code&gt;. this is the axes that we need to plot alongside the parabola. the following Latex code will de just that&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\begin{tikzpicture}[scale=0.50]
    \begin{axis}[axis lines=center,
    xlabel={$x$},
    ylabel={$y$},
    xtick=\empty,ytick=\empty,
    xmin=-0.5,xmax=8,
    ymin=-0.5,ymax=7,
    unbounded coords=jump,
    samples=200]
    \coordinate (A) at (2.8,0);
    \coordinate (B) at (5.2,2);
    \addplot [red,thick,domain=1:7.7,unbounded coords=jump]
    {0.67*(x-4)^2+1};
    \draw[blue] (4,0) -- (4,7) ;
    \draw[thin, gray] (A) rectangle (B) ;
    \node[below right] at (4.5,0) {$a+x$};
    \node[below ] at (4,0) {$a$};
    \node[below left ] at (0,0) {$O$};
    \node[above right ] at (4,0) {$\Omega$};
    \node[below left] at (3.5,0) {$a-x$};
     \end{axis}
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/146-axe-of-symmetry_banner.jpg" alt="Axes of symmetry using Latex Tikz" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Axes of symmetry using Latex Tikz&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Plotting the Center of Symmetry for $g(x)$&lt;/h2&gt;

&lt;p&gt;The second function is a sinusoidal function of the form $g(x) = \sin(x)+1$. the y-shift is just to make the illustration look good. The function has a center of symmetry at the point Ω(π,1)&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\begin{tikzpicture}[scale=0.65]
    \begin{axis}[axis lines=none,
    xlabel={$x$},
    ylabel={$y$},
    xtick=\empty,ytick=\empty,
    xmin=-2.5,xmax=7,
    ymin=-1.5,ymax=3,
    unbounded coords=jump,
    samples=200]
    \coordinate (A) at (0,2);
    \coordinate (B) at (0.5*pi,-1);
    \coordinate (C) at (0,0);
    \coordinate (D) at (1.5*pi,-1);
    \draw[-&amp;gt;, black] (-1,-1) -- (6.5,-1) node[right] {$x$} ;
    \draw[-&amp;gt;, black] (0,-1.5) -- (0,2.5) node[below right] {$y$} ;
    \draw[scale=1,domain=0.1*pi:2.1*pi,smooth,variable=\x,red] plot ({\x},{sin(\x r)+1});
    \draw[blue] (pi,-2) -- (pi,2) ;
    \draw[blue] (-1,1) -- (8,1) ;
    \draw[thin, gray] (A) rectangle (B) ;
    \draw[thin, gray] (C) rectangle (D) ;
    \node[below ] at (B) {$a-x$};
    \node[below right, blue ] at (pi,-1) {$a$};
    \node[below ] at (D) {$a+x$};
    \node[left ] at (A) {$f(a-x)$};
    \node[left ] at (C) {$f(a+x)$};
    \node[above left,blue ] at (0,1) {$b$};
    \node[above right ] at (pi,1) {$\Omega$};
    \node[below left ] at (0,-1) {$O$};
     \end{axis}
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/146-center-of-symmetry_banner.jpg" alt="Center of symmetry using Latex Tikz" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Center of symmetry using Latex Tikz&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;And there you have it. until the next tutorial, happy editing and Plotting&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="tikz"></category><category term="plot"></category><category term="axes of symmetry"></category><category term="center of symmetry"></category><category term="quadratic polynomial"></category><category term="sinusoidal function"></category><category term="parabola"></category><category term="tutorial"></category><category term="code snippets"></category><category term="illustrations"></category></entry><entry><title>How to Draw Oblique Asymptotes with TikZ in LaTeX</title><link href="https://mosaid.xyz/articles/how-to-draw-oblique-asymptotes-with-tikz-in-latex-145.html" rel="alternate"></link><published>2023-04-06T17:19:46+00:00</published><updated>2023-04-06T17:19:46+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-04-06:/articles/how-to-draw-oblique-asymptotes-with-tikz-in-latex-145.html</id><summary type="html">&lt;p&gt;Learn how to use TikZ to create professional-quality graphics and diagrams in LaTeX. This tutorial includes code examples for drawing  oblique asymptotes. Mastering TikZ will enhance your LaTeX skills and enable you to create stunning visuals for your documents.&lt;/p&gt;</summary><content type="html">&lt;p&gt;This article is a continuation of the  &lt;a href="/articles/how-to-draw-horizontal-asymptotes-using-latex-tikz-a-step-by-step-guide-144/"&gt;previous&lt;/a&gt; one, last time we created horizontal asymptotes, in this article I am going to show you how to draw an oblique asymptote.&lt;/p&gt;

&lt;h2&gt;What is an Oblique Asymptote?&lt;/h2&gt;

&lt;p&gt;An oblique asymptote is a straight line that a function approaches as x approaches infinity or negative infinity. Unlike horizontal or vertical asymptotes, oblique asymptotes have a non-zero slope and are therefore inclined. Oblique asymptotes occur when the degree of the numerator is one more than the degree of the denominator.&lt;/p&gt;

&lt;h2&gt;Drawing an Oblique Asymptote with TikZ&lt;/h2&gt;

&lt;p&gt;Just like in the  &lt;a href="/articles/how-to-draw-vertical-asymptotes-using-latex-tikz-a-step-by-step-guide-143/"&gt;previous&lt;/a&gt; article we need to include the necessary packages first, to plot and draw graphs you need Tikz and pgfplots packages.&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\standaloneconfig{border=2mm 2mm 2mm 2mm}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\begin{tikzpicture}[scale=0.50]
    \begin{axis}[axis lines=center,
    xlabel={$x$},
    ylabel={$y$},
    xtick=\empty,ytick=\empty,
    xmin=0,xmax=7,
    ymin=0,ymax=10,
    unbounded coords=jump,
    samples=200]
    \addplot [red,thick,domain=1.3:7,unbounded coords=jump]
    {x-1+1/(ln(x))};
    \addplot [blue,thick,domain=1:7,unbounded coords=jump]
    {x*1.048-1};
    \node[rotate=35,below] at (6,5) {$y=ax+b$};
     \end{axis}
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;In this example, we're plotting the function &lt;code&gt;f(x)=x-1+1/(ln(x))&lt;/code&gt; in red, and the oblique asymptote &lt;code&gt;y=x*1.048-1&lt;/code&gt; in blue. To find the equation of the oblique asymptote, we need to calculate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;lim (f(x) / x) = a
x-&amp;gt;+∞&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;for this particular function we find that &lt;code&gt;a=1&lt;/code&gt; and to find the y-intercept we calculate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;lim (f(x) - ax) = b
x-&amp;gt;+∞&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To plot the oblique asymptote, we use the &lt;code&gt;\addplot&lt;/code&gt; command with the equation &lt;code&gt;x*1.048-1&lt;/code&gt;, where 1.048 (changed a little to make it visually appealing) is the slope of the oblique asymptote . We've also added a rotated node to the plot to label the equation of the oblique asymptote.
&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Drawing oblique asymptotes with TikZ in LaTeX is a straightforward process that can help you gain a better understanding of the behavior of your functions. By following the steps outlined in this tutorial, you can create professional-looking mathematical graphs and plots with ease.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="tikz"></category><category term="plots"></category><category term="tutorial"></category><category term="step-by-step"></category><category term="examples"></category><category term="practical advice"></category><category term="technical writing"></category></entry><entry><title>How to Draw Horizontal Asymptotes Using LaTeX TikZ: A Step-by-Step Guide</title><link href="https://mosaid.xyz/articles/how-to-draw-horizontal-asymptotes-using-latex-tikz-a-step-by-step-guide-144.html" rel="alternate"></link><published>2023-04-06T16:24:40+00:00</published><updated>2023-04-06T16:24:40+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-04-06:/articles/how-to-draw-horizontal-asymptotes-using-latex-tikz-a-step-by-step-guide-144.html</id><summary type="html">&lt;p&gt;Learn how to draw graphs with horizontal asymptotes using LaTeX TikZ. Our step-by-step tutorial includes code examples and tips for creating professional-looking graphs in your documents.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Hello readers, in the &lt;a href="/articles/how-to-draw-vertical-asymptotes-using-latex-tikz-a-step-by-step-guide-143/"&gt;previous&lt;/a&gt; article we  created vertical asymptotes using Tikz. today we are going to explore the power of TikZ yet again to create horizontal asymptotes, and as usual I will give you the full working Latex code in my examples. so let's dig in.&lt;/p&gt;

&lt;p&gt;As usual, before we start we must prepare the necessary packages to use tikz:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\standaloneconfig{border=2mm 2mm 2mm 2mm}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;The first example is a graph that has a horizontal asymptote. This is a type of line that the graph approaches but never touches. To create this graph in TikZ, we use the "axis" environment, which is a powerful tool for creating graphs.&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\begin{tikzpicture}[scale=0.50]
    \begin{axis}[axis lines=center,
    xlabel={$x$},
    ylabel={$y$},
    xtick=\empty,ytick=\empty,
    xmin=-1,xmax=21,
    ymin=-0.2,ymax=5,
    unbounded coords=jump,
    samples=200]
    \addplot [red,thick,domain=2.5:20,unbounded coords=jump] {(3+x)/(x-1)};
    \addplot[blue] coordinates {(0,1.1) (20,1.1)} node[below left]{$y=b$};
    \node[left] at (-0.1,1.2) {\textit{b}};
     \end{axis}
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/144-horizontal-asymptote_banner-1.jpg" alt="Horizontal asymptote above the curve in +infinity with LaTeX TikZ" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Horizontal asymptote above the curve in + infinity with LaTeX TikZ&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;In the code example, we set the axis limits, x and y labels, and tick marks. Then we define the function we want to plot using the "&lt;code&gt;addplot&lt;/code&gt;" command. The red line represents the graph of the function, and the blue line represents the horizontal asymptote. Finally, we add a label to the blue line using the "&lt;code&gt;node&lt;/code&gt;" command.&lt;/p&gt;

&lt;p&gt;Now let's move on to the second example, which is a graph with another type of horizontal asymptote. The process of creating this graph is similar to the first one, but this time the asymptote is located at a different y-value. We also need to adjust the domain of the function to make sure we get the correct graph.&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\begin{tikzpicture}[scale=0.50]
    \begin{axis}[axis lines=center,
    xlabel={$x$},
    ylabel={$y$},
    xtick=\empty,ytick=\empty,
    xmin=-2,xmax=31,
    ymin=-0.1,ymax=2,
    unbounded coords=jump,
    samples=200]
    \addplot [red,thick,domain=5:30,unbounded coords=jump] {2+(3+x)/(-x-1)};
    \addplot[blue] coordinates {(0,1) (30,1)} node[above left]{$y=b$};
    \node[left] at (-0.1,1) {\textit{b}};
     \end{axis}
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/144-horizontal-asymptote_banner-2.jpg" alt="Horizontal asymptote below the curve in +infinity with LaTeX TikZ" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Horizontal asymptote below the curve in + infinity with LaTeX TikZ&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;Finally, we have a third example that is similar to the second one, but with the asymptote located on the left-hand side of the graph. To achieve this, we adjust the domain of the function once again, and place the label for the asymptote on the left side using the "node" command.&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\begin{tikzpicture}[scale=0.50]
    \begin{axis}[axis lines=center,
    xlabel={$x$},
    ylabel={$y$},
    xtick=\empty,ytick=\empty,
    xmin=-31,xmax=3,
    ymin=-0.1,ymax=2,
    unbounded coords=jump,
    samples=200]
    \addplot [red,thick,domain=-30:-5,unbounded coords=jump] {2+(3+x)/(-x-1)};
    \addplot[blue] coordinates {(-30,1) (0,1)} ;
    \node[below] at (-28,1) {$y=b$};
    \node[right] at (0.1,1) {\textit{b}};
     \end{axis}
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/144-horizontal-asymptote_banner-3.jpg" alt="Horizontal asymptote above the curve in -infinity with LaTeX TikZ" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Horizontal asymptote above the curve in -infinity with LaTeX TikZ&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;Now that we've gone through these examples, I encourage you to try them out yourself and experiment with different functions and parameters. TikZ is a powerful tool that can help you create amazing graphics and diagrams, and with practice, you can create complex and beautiful visualizations. Remember to have fun and be creative with your graphs!&lt;/p&gt;

&lt;p&gt;In conclusion, TikZ is a great package for LaTeX users who want to create beautiful graphics and diagrams. In this post, we explored some examples of graphs with horizontal asymptotes, and saw how the "axis" environment, "addplot" command, and "node" command can be used to create these graphs. I hope this post has been helpful, and I encourage you to continue exploring TikZ and all the amazing things you can create with it.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="tikz"></category><category term="plots"></category><category term="tutorial"></category><category term="step-by-step"></category><category term="examples"></category><category term="practical advice"></category><category term="technical writing"></category></entry><entry><title>How to Draw Vertical Asymptotes Using LaTeX TikZ: A Step-by-Step Guide</title><link href="https://mosaid.xyz/articles/how-to-draw-vertical-asymptotes-using-latex-tikz-a-step-by-step-guide-143.html" rel="alternate"></link><published>2023-04-06T15:18:05+00:00</published><updated>2023-04-06T15:18:05+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-04-06:/articles/how-to-draw-vertical-asymptotes-using-latex-tikz-a-step-by-step-guide-143.html</id><summary type="html">&lt;p&gt;Learn how to draw vertical asymptotes for your mathematical equations using LaTeX TikZ. Follow our step-by-step guide and master the art of creating beautiful and precise graphs.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Drawing vertical asymptotes using LaTeX TikZ is a handy skill to have in your arsenal when you want to illustrate the behavior of a function near a particular x-value. With just a few lines of code, you can create a clear and concise visual representation of a function's vertical asymptotes that will help your audience understand the function's behavior better.&lt;/p&gt;

&lt;p&gt;So, how do you draw vertical asymptotes in TikZ? Well, it's easier than you might think. First, let's take a look at what a vertical asymptote is.&lt;/p&gt;

&lt;p&gt;A vertical asymptote is a line that a function approaches but never touches as the input approaches a certain value. This means that the function's output approaches infinity or negative infinity as the input approaches the vertical asymptote.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;To draw a vertical asymptote in TikZ, you need to plot the function first and then define the domain in which the function is valid using the restrict y to domain option. You also need to tell TikZ how to handle points where the function is undefined using the unbounded coords option.&lt;/p&gt;

&lt;p&gt;Here's an example to illustrate the process. Let's say we want to draw a vertical asymptote at x=3 for the function f(x) = 1/(x-3). We can use the following code:&lt;/p&gt;
&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\begin{tikzpicture}
    \begin{axis}[xmin=-1,xmax=5,ymin=-10,ymax=10,restrict y to domain=-10:10,unbounded coords=jump]
    \addplot[domain=-1:2.9,samples=200]{1/(x-3)};
    \addplot[domain=3.1:5,samples=200]{1/(x-3)};
    \draw[dashed] (3,-10) -- (3,10);
    \end{axis}
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;In this code, we first set the x and y limits of the plot using xmin, xmax, ymin, and ymax. We then use restrict y to domain=-10:10 to tell TikZ to only plot the function where the y values are between -10 and 10. The unbounded coords=jump option tells TikZ to ignore points where the function is undefined (in this case, when x=3).&lt;/p&gt;

&lt;p&gt;Next, we plot the function in two separate parts using the domain and samples options. We do this to avoid drawing the vertical asymptote.&lt;/p&gt;

&lt;p&gt;Finally, we draw the dashed vertical line at x=3 using the &lt;code&gt;\draw[dashed] (3,-10) -- (3,10);&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;And that's it! With this code, we have successfully drawn a vertical asymptote at x=3 for the function &lt;code&gt;f(x) = 1/(x-3)&lt;/code&gt;. The above code will produce the follwoing figure:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/143-vertical-asymptote-11-banner.jpg" alt="Vertical asymptote using LaTeX TikZ" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Vertical asymptote using LaTeX TikZ&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;here is an additional Latex code with more settings and customizations :&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\documentclass{standalone}
\standaloneconfig{border=2mm 2mm 2mm 2mm}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}[scale=1.00]
    \begin{axis}[axis lines=center,
        xlabel={$x$},
        ylabel={$y$},
        xtick=\empty,ytick=\empty,
        xmin=-0.5,xmax=5,
        ymin=-1.5,ymax=30,
        restrict y to domain=0.01:29,
        unbounded coords=jump,
        samples=200]
    \addplot [red,thick,domain=1.5:3.5,restrict y to domain=0.01:29,unbounded coords=jump]
        {5+ 2*tan(deg(x/2))};
    \addplot [blue,unbounded coords=jump] coordinates {(pi-0.1,0.01) (pi-0.1,28)};
    \draw[-&amp;gt;] (0,0) -- (1,0) node[above left] {\textit{$\overrightarrow{i}$}};
    \draw[-&amp;gt;] (0,0) -- (0,7);
    \node[anchor=north west] at (-0.7,7) {\textit{$\overrightarrow{j}$}};
    \node[below left] at (pi,0.1) {\textit{a}};
    \node[rotate=90,anchor=north east] at (pi,29) {$x=a$};
     \end{axis}
\end{tikzpicture}


\begin{tikzpicture}[scale=1.00]
    \begin{axis}[axis lines=center,
        xlabel={$x$},
        ylabel={$y$},
        xtick=\empty,ytick=\empty,
        xmin=-1,xmax=7,
        ymin=-1.5,ymax=30,
        restrict y to domain=0.01:29,
        unbounded coords=jump,
        samples=200]
        \addplot [red,thick,domain=3:4.5,restrict y to domain=0.01:29,
            unbounded coords=jump] {5-2*tan(deg(x/2))};

        \addplot [blue,unbounded coords=jump] coordinates {(pi-0.1,0.01) (pi+0.1,29)};
        \draw[-&amp;gt;] (0,0) -- (1,0) node[above left] {\textit{$\overrightarrow{i}$}};
        \draw[-&amp;gt;] (0,0) -- (0,7);
        \node[anchor=north west] at (-0.7,7) {\textit{$\overrightarrow{j}$}};
        \node[below left] at (pi,0.1) {\textit{a}};
        \node[rotate=90,anchor=north east] at (pi-0.4,29) {$x=a$};
    \end{axis}
\end{tikzpicture}


\end{document}



&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;
The above two tikzpicture will produce the following :&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/143-vertical-asymptote-12-banner.jpg" alt="left and right vertical asymptote using LaTeX TikZ" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Left and right vertical asymptote using LaTeX TikZ&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Now, a word of caution: when drawing vertical asymptotes, it's essential to make sure that you define the domain of the function carefully. If you don't restrict the domain, TikZ will try to plot the function outside of its valid range, which can cause errors or infinite loops. It's also a good idea to use unbounded coords=jump to tell TikZ to ignore points where the function is undefined.&lt;/p&gt;

&lt;p&gt;In conclusion, drawing vertical asymptotes in LaTeX TikZ is a useful skill that can help you create clear and concise visual representations of a function's behavior. With just a few lines of code, you can create impressive visuals that will help your audience understand complex concepts easily. So, give it a try!&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="tikz"></category><category term="vertical asymptotes"></category><category term="math equations"></category><category term="graphs"></category><category term="precision"></category><category term="tutorial"></category><category term="step-by-step guide"></category><category term="tips and tricks"></category></entry><entry><title>Latex TikZ: A Step-by-Step Guide to Creating Professional Flow Charts</title><link href="https://mosaid.xyz/articles/latex-tikz-a-step-by-step-guide-to-creating-professional-flow-charts-139.html" rel="alternate"></link><published>2023-03-28T11:04:09+00:00</published><updated>2023-03-28T11:04:09+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-03-28:/articles/latex-tikz-a-step-by-step-guide-to-creating-professional-flow-charts-139.html</id><summary type="html">&lt;p&gt;In this tutorial article, you will learn how to create a flow chart using the TikZ package in LaTeX. The article will guide you through step-by-step instructions on how to construct a flow chart similar to the one provided, including defining nodes, edges, and decision points. You will also learn how to customize the appearance of the flow chart, such as node shapes and arrow styles, and how to add titles and labels. By the end of the tutorial, you will have a solid understanding of how to create professional-looking flow charts in LaTeX using TikZ&lt;/p&gt;</summary><content type="html">&lt;p&gt;Greetings fellow latex lovers. In this article I will talk about creating flowcharts using LaTeX and TikZ. It's a useful skill to have, especially if you work in a technical field that involves presenting complex information in a visually appealing way.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;When I first started creating flowcharts using TikZ, I found the process to be a bit daunting. However, with practice and a bit of patience, I was able to create flowcharts that not only looked professional but also effectively conveyed the information I wanted to present.&lt;/p&gt;

&lt;h2&gt;First define the shapes&lt;/h2&gt;

&lt;p&gt;To get started, you'll need to define the shapes and styles you want to use in your flowchart. In this code snippet, we define three styles: &lt;strong style="color: #000000;"&gt;startstop&lt;/strong&gt;, &lt;strong style="color: #000000;"&gt;process&lt;/strong&gt;, and &lt;strong style="color: #000000;"&gt;decision&lt;/strong&gt;. These styles will be used to define the shape, size, and color of the nodes in the flowchart like so:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;Once you've defined your styles, you can begin building your flowchart by defining the nodes and edges. Each node represents a step in the flowchart, and each edge represents the connection between those steps. In the code below, we define a series of nodes and edges to create a logical sequence of steps.&lt;/p&gt;

&lt;p&gt;The following line will create a node named &lt;strong style="color: #000000;"&gt;step2a&lt;/strong&gt; that will be drawn below left of another node named &lt;strong style="color: #000000;"&gt;decision1&lt;/strong&gt;. And it will have the text "&lt;strong style="color: #000000;"&gt;Step 2a&lt;/strong&gt;". the y and x shifts will add more control over its placement.&lt;/p&gt;
&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\node[process, below left of=decision1, yshift=-1cm, xshift=5cm] (step2a) {Step 2a};

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\documentclass{standalone}
\standaloneconfig{border=2mm 2mm 2mm 2mm}
\usepackage{tikz}

% Define the diamond shape
\usetikzlibrary{shapes.geometric}
\tikzset{diamond/.style={shape=diamond, draw, minimum size=1.5cm, text width=1.5cm, text centered, inner sep=0pt}}

% Define styles for the flowchart nodes
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=red!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]

\begin{document}

\begin{tikzpicture}[node distance=2cm, auto]
    % Define nodes
    \node (title) at (11.5,4) {\textbf{\Huge{My Flow Chart Title here}}};
    \node[startstop] (start) {Start};
    \node[process, right of=start, xshift=2cm] (step1) {Step 1};
    \node[decision, right of=step1, xshift=2cm] (decision1) {Decision 1};
    \node[process, below left of=decision1, yshift=-1cm, xshift=5cm] (step2a) {Step 2a};
    \node[process, above left of=decision1, yshift=1cm, xshift=5cm] (step2b) {Step 2b};
    \node[decision, left of=decision1, xshift=14cm] (decision2) {Decision 2};
    \node[process, below right of=decision2, yshift=-2cm, xshift=-4cm] (step3a) {Step 3a};
    \node[process, below left of=decision2, yshift=-2cm, xshift=4cm] (step3b) {Step 3b};
    \node[process, below right of=step3a, yshift=-1cm, xshift=1cm] (step4) {Step 4};
    \node[startstop, below of=step4] (end) {End};
    %% Define edges
    \draw[-&amp;gt;] (start) -- (step1);
    \draw[-&amp;gt;] (step1) -- (decision1);
    \draw[-&amp;gt;] (decision1) -- node {yes} (step2a);
    \draw[-&amp;gt;] (decision1) -- node {no} (step2b);
    \draw[-&amp;gt;] (step2a) -- (decision2);
    \draw[-&amp;gt;] (step2b) -- (decision2);
    \draw[-&amp;gt;] (decision2) -- node {yes} (step3a);
    \draw[-&amp;gt;] (decision2) -- node {no} (step3b);
    \draw[-&amp;gt;] (step3a) -- (step4);
    \draw[-&amp;gt;] (step3b) -- (step4);
    \draw[-&amp;gt;] (step4) -- (end);
    %% Add dotted lines for clarity
    \draw[dotted] (step2a) -- (step2b);
    \draw[dotted] (step3a) -- (step3b);
\end{tikzpicture}

\end{document}


&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The above LaTeX code will create this flowchart:&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/horizontal-flow-chart-latex-tikz.jpg" alt="Horizontal flow chart using LaTeX and TikZ package" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Horizontal flow chart using LaTeX and TikZ package&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;We can modify it to have a vertical layout:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\documentclass{standalone}
\standaloneconfig{border=2mm 2mm 2mm 2mm}
\usepackage{tikz}

% Define the diamond shape
\usetikzlibrary{shapes.geometric}
\tikzset{diamond/.style={shape=diamond, draw, minimum size=1.5cm, text width=1.5cm, text centered, inner sep=0pt}}

% Define styles for the flowchart nodes
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=red!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]

\begin{document}

\begin{tikzpicture}[node distance=2cm, auto]
    % Define nodes
    \node[startstop] (start) {Start};
    \node[process, below of=start] (step1) {Step 1};
    \node[decision, below of=step1, yshift=-1cm] (decision1) {Decision 1};
    \node[process, below left of=decision1, xshift=-2cm] (step2a) {Step 2a};
    \node[process, below right of=decision1, xshift=2cm] (step2b) {Step 2b};
    \node[decision, below of=decision1, yshift=-3cm] (decision2) {Decision 2};
    \node[process, below left of=decision2, xshift=-2cm] (step3a) {Step 3a};
    \node[process, below right of=decision2, xshift=2cm] (step3b) {Step 3b};
    \node[process, below of=step3a, yshift=-1cm] (step4) {Step 4};
    \node[startstop, below of=step4] (end) {End};
    % Define edges
    \draw[-&amp;gt;] (start) -- (step1);
    \draw[-&amp;gt;] (step1) -- (decision1);
    \draw[-&amp;gt;] (decision1) -- node {yes} (step2a);
    \draw[-&amp;gt;] (decision1) -- node {no} (step2b);
    \draw[-&amp;gt;] (step2a) |- (decision2);
    \draw[-&amp;gt;] (step2b) |- (decision2);
    \draw[-&amp;gt;] (decision2) -- node {yes} (step3a);
    \draw[-&amp;gt;] (decision2) -- node {no} (step3b);
    \draw[-&amp;gt;] (step3a) -- (step4);
    \draw[-&amp;gt;] (step3b) -- (step4);
    \draw[-&amp;gt;] (step4) -- (end);
    % Add dotted lines for clarity
    \draw[dotted] (step2a) -- (step2b);
    \draw[dotted] (step3a) -- (step3b);
\end{tikzpicture}

\end{document}


&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;figure&gt;
  &lt;img src="/theme/images/articles/images/vertical-flow-chart-latex-tikz.jpg" alt="Vertical flow chart using LaTeX and TikZ package" style="max-width:100%;height:auto;" &gt;
  &lt;figcaption&gt;Vertical flow chart using LaTeX and TikZ package&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;One thing to keep in mind when creating your flowchart is to maintain a consistent style throughout. This includes keeping the size, shape, and color of your nodes and edges consistent, as well as keeping the text aligned and properly sized.&lt;/p&gt;

&lt;p&gt;Overall, creating flowcharts using TikZ can seem intimidating at first, but with practice and a bit of creativity, you can create professional-looking flowcharts that effectively convey complex information. So, don't be afraid to dive in and experiment with different styles and layouts - who knows, you may even discover a new approach to flowcharting that sets you apart from the rest!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="tikz"></category><category term="latex"></category><category term="flow chart"></category><category term="tutorial"></category><category term="professional"></category><category term="step-by-step"></category><category term="guide"></category></entry><entry><title>Create Beautiful Recipe Cards with a LaTeX Recipe Template</title><link href="https://mosaid.xyz/articles/create-beautiful-recipe-cards-with-a-latex-recipe-template-138.html" rel="alternate"></link><published>2023-03-26T18:26:40+00:00</published><updated>2023-03-26T18:26:40+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-03-26:/articles/create-beautiful-recipe-cards-with-a-latex-recipe-template-138.html</id><summary type="html">&lt;p&gt;Looking for an elegant and customizable way to format your recipes? Try our LaTeX recipe template! Perfect for home cooks, food bloggers, and chefs alike&lt;/p&gt;</summary><content type="html">&lt;p&gt;Hey there foodies! As a fellow lover of good food, I know how important it is to have a well-organized and visually appealing recipe template. That's why I want to share with you a LaTeX template that I have created for formatting and writing recipes.&lt;/p&gt;

&lt;p&gt;First off, let me tell you, LaTeX is a powerful tool that can help you create stunning documents. And creating a recipe template is no exception. With just a few lines of code, you can have a beautiful recipe template that will make your cooking instructions easy to follow and your ingredient lists a breeze to read.&lt;/p&gt;

&lt;p&gt;When creating a recipe template in LaTeX, the first step is to set up the document class. You can use any document class that you prefer, but for this tutorial, we will use the article document class. and here is our LaTeX recipe&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;h2&gt;1- add packages&lt;/h2&gt;

&lt;p&gt;Next, we need to add packages to our LaTeX document. Packages are extra files that provide additional functionality to LaTeX. For our recipe template, we will be using the graphicx, xcolor, and geometry packages.&lt;/p&gt;

&lt;h2&gt;2- title and header&lt;/h2&gt;
&lt;p&gt;Once we have set up the document class and added our packages, we can begin formatting our recipe template. We start by creating the title and header, followed by the ingredients section. We format the ingredients list using an unordered list.&lt;/p&gt;

&lt;h2&gt;3- recipe instructions and notes sections&lt;/h2&gt;
&lt;p&gt;Next, we create the instructions section. Here, we use an ordered list to make the steps easy to follow. Finally, we create a section for recipe notes where you can add any additional information or tips for the recipe.&lt;/p&gt;

&lt;h2&gt;4- dish photo&lt;/h2&gt;
&lt;p&gt;If you want to include a photo of the finished dish, we can do that using the graphicx package. Simply add the code to include the image below the recipe notes section.&lt;/p&gt;

&lt;p&gt;Once you have completed your recipe template, save your LaTeX document and compile it using your LaTeX compiler. And voila! Your recipe template is ready to use. here is the full latex code:&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\documentclass{article}

\usepackage{graphicx}
\usepackage{xcolor}
\usepackage[margin=1in]{geometry}

% Define colors for sections
\definecolor{sectioncolor}{RGB}{153,0,51}
\definecolor{subsectioncolor}{RGB}{255,128,0}

% Define custom section command for styling
\newcommand{\recipeSection}[1]{\textcolor{sectioncolor}{\large\textbf{#1}}}

\begin{document}

\begin{center}
  \textcolor{sectioncolor}{\textbf{\LARGE Recipe Title}}
\end{center}

\hrule

\begin{center}
  \textcolor{subsectioncolor}{\textbf{\large Recipe Header}}
\end{center}

\recipeSection{Ingredients}

\begin{itemize}
  \item Ingredient 1
  \item Ingredient 2
  \item Ingredient 3
    % add more ingredients here as needed
\end{itemize}

\recipeSection{Instructions}

\begin{enumerate}
  \item Step 1
  \item Step 2
  \item Step 3
    % add more steps here as needed
\end{enumerate}

\recipeSection{Recipe Notes}

Add any additional information or tips here.

\begin{center}
  \includegraphics[width=0.5\textwidth]{image.jpg}
\end{center}

\end{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Our recipe document will look like:&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/recipe-banner.jpg" alt="Recipe document by latex" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;LaTeX Recipe Template&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;In conclusion, creating a recipe template in LaTeX is a simple and effective way to make your recipes look professional and easy to follow. With just a little bit of code, you can create a stunning template that will impress your friends and family. So, get cooking and happy LaTeXing!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="recipe template"></category><category term="recipe card"></category><category term="formatting recipes"></category><category term="recipe design"></category><category term="food blogging"></category><category term="cooking"></category><category term="recipe writing"></category></entry><entry><title>Academic CV LaTeX Template: A Step-by-Step Guide</title><link href="https://mosaid.xyz/articles/academic-cv-latex-template-a-step-by-step-guide-137.html" rel="alternate"></link><published>2023-03-25T20:52:12+00:00</published><updated>2023-03-25T20:52:12+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-03-25:/articles/academic-cv-latex-template-a-step-by-step-guide-137.html</id><summary type="html">&lt;p&gt;This article provides a step-by-step guide to creating an academic CV using LaTeX. It includes a sample template and covers the customization of sections such as education, research experience, publications, and more. Whether you're a graduate student or a seasoned academic, this guide will help you create a professional and impressive CV that highlights your achievements and qualifications.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Creating an academic CV can be a daunting task, especially if you're not sure where to start. Fortunately, LaTeX provides an easy and professional way to create an academic CV that showcases your academic achievements, publications, research interests, and more. In this guide, we'll walk you through the steps of creating an academic CV using LaTeX and provide you with a sample template that you can customize to suit your needs.&lt;/p&gt;

&lt;h2&gt;Step 1: Choose a LaTeX Template&lt;/h2&gt;

&lt;p&gt;\{There are many LaTeX templates available for academic CVs, and choosing the right one can save you a lot of time and effort. In this example, we'll be using the &lt;strong style="color: #000000;"&gt;"moderncv"&lt;/strong&gt; LaTeX template, which is designed specifically for academic CVs.&lt;/p&gt;

&lt;p&gt;To use the "moderncv" template, you'll need to install the moderncv package, which can be done by running the following command in your LaTeX editor:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\usepackage{moderncv}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Once you've installed the moderncv package, you can use the following code to start your academic CV:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}

\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}

\name{john}{doe}
\title{curriculum vitae}
\address{123 main street}{anytown, usa}{12345}
\phone[mobile]{+1~(555)~555~1212}
\email{john.doe@email.com}

\begin{document}

\makecvtitle

\section{education}
\cventry{2010--2014}{bachelor of science}{university of xyz}{anytown, usa}{}{}
\cventry{2014--2016}{master of science}{university of xyz}{anytown, usa}{}{}

\section{research experience}
\cventry{2016--present}{graduate research assistant}{university of abc}{anytown, usa}{}{}
\cventry{2014--2016}{undergraduate research assistant}{university of xyz}{anytown, usa}{}{}

\section{publications}
\cvitem{}{doe, j. (2018). "title of article." journal of xyz, 10(2), 123-456.}
\cvitem{}{doe, j. (2017). "title of book." publisher.}

\end{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This code sets the document class to "moderncv," defines the style and color of the CV, sets the name, address, phone number, and email address of the applicant, and creates three sections for education, research experience, and publications.&lt;/p&gt;

&lt;h2&gt;Step 2: Customize Your CV&lt;/h2&gt;

&lt;p&gt;Once you've created the basic structure of your academic CV, you can customize it to suit your needs. For example, you can add additional sections for teaching experience, awards and honors, or professional memberships. You can also customize the formatting of your CV by adjusting the font size, color, and style.&lt;/p&gt;

&lt;p&gt;Here's an example of how you can customize the "Education" section of your academic CV:&lt;/p&gt;
&lt;h3&gt;Adding a Teaching Experience Section:&lt;/h3&gt;
&lt;p&gt;If you have experience as a teaching assistant or have taught courses as a lecturer, you can add a section to your CV to showcase this experience. You can include the course name, the number of students, and a brief description of your teaching responsibilities.&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\section{Teaching Experience}
\cventry{Spring 2022}{Teaching Assistant}{Department of Mathematics, University of XYZ}{Anytown, USA}{}{Assisted in grading and holding office hours for Calculus I.}
\cventry{Fall 2021}{Lecturer}{Department of Computer Science, University of XYZ}{Anytown, USA}{}{Taught Introduction to Programming to 30 students.}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3&gt;Adding an Awards and Honors Section:&lt;/h3&gt;
&lt;p&gt;If you have received any awards, scholarships, or honors during your academic career, you can add a section to your CV to showcase these achievements. You can include the name of the award, the organization that granted it, and the year it was awarded.&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\section{Awards and Honors}
\cvitem{2021}{Outstanding Graduate Research Award, Department of Biology, University of XYZ}
\cvitem{2019}{Graduate Research Fellowship, National Science Foundation}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3&gt;Adding a Professional Memberships Section:&lt;/h3&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\section{Professional Memberships}
\cventry{2018--present}{Member}{American Society of Microbiology}{Anytown, USA}{}{}
\cventry{2020--present}{President}{Graduate Student Association, Department of Biology, University of XYZ}{Anytown, USA}{}{}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3&gt;Customizing the Formatting:&lt;/h3&gt;
&lt;p&gt;You can customize the formatting of your academic CV by adjusting the font size, color, and style. For example, you can change the color of your name and section headings, or change the font size of your publication entries.&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\name{\color{blue}John}{\color{blue}Doe}
\section{\textcolor{red}{Education}}
\cvitem{}{\textbf{Bachelor of Science} in Biology, University of XYZ, 2010--2014}
\cvitem{}{\textbf{Master of Science} in Biology, University of XYZ, 2014--2016}
\section{\textcolor{red}{Publications}}
\cvitem{}{\textbf{\textit{Doe, J.}} (2018). "Title of article." \textit{Journal of XYZ}, 10(2), 123-456.}}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Step 3: Add Details to Your Sections&lt;/h2&gt;

&lt;p&gt;Now that you've customized the basic structure of your academic CV, it's time to start adding details to each section. Here's an example of how you can add details to the "Education" section:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\section{Education}
\cventry{2010--2014}{Bachelor of Science}{University of XYZ}{Anytown, USA}{}{GPA: 3.8/4.0}
\cventry{2014--2016}{Master of Science}{University of XYZ}{Anytown, USA}{}{Thesis: "Title of Thesis"}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;In this example, we've added the GPA for the Bachelor's degree and the title of the Master's thesis. You can add similar details to the other sections of your academic CV.&lt;/p&gt;

&lt;h2&gt;Step 4: Include Your Professional Experience&lt;/h2&gt;

&lt;p&gt;In addition to your education, your academic CV should also include your professional experience. This can include research assistantships, teaching assistantships, or other relevant work experience. Here's an example of how you can add a "Professional Experience" section to your academic CV:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\section{Professional Experience}
\cventry{2018--present}{Research Scientist}{ABC Research Institute}{Anytown, USA}{}{Conducting research on XYZ}
\cventry{2016--2018}{Teaching Assistant}{University of ABC}{Anytown, USA}{}{Assisted in teaching undergraduate courses in XYZ}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Step 5: Highlight Your Publications&lt;/h2&gt;

&lt;p&gt;One of the most important sections of an academic CV is the publications section. This is where you can highlight your research and publications. Here's an example of how you can add details to your "Publications" section:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\section{Publications}
\cvitem{}{Doe, J. (2018). "Title of article." Journal of XYZ, 10(2), 123-456.}
\cvitem{}{Doe, J. (2017). "Title of book." Publisher.}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

Step 6: Review and Edit Your CV

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Once you've added all the necessary details to your academic CV, it's important to review and edit it carefully. Check for any spelling or grammatical errors, ensure that the formatting is consistent throughout the document, and make sure that all the information is accurate and up-to-date.&lt;/p&gt;

&lt;p&gt;the whole thing put together:&lt;/p&gt;

&lt;pre class="language-tex" &gt;
   &lt;code class="language-tex" &gt;

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}

\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}

\name{\color{blue}John}{\color{blue}Doe}
\title{curriculum vitae}
\address{123 main street}{anytown, usa}{12345}
\phone[mobile]{+1~(555)~555~1212}
\email{john.doe@email.com}

\begin{document}

\makecvtitle

\section{\textcolor{red}{Education}}
\cvitem{}{\textbf{Bachelor of Science} in Biology, University of XYZ, 2010--2014}{GPA: 3.8/4.0}
\cvitem{}{\textbf{Master of Science} in Biology, University of XYZ, 2014--2016}{Thesis: "Title of Thesis"}

\section{Teaching Experience}
\cventry{Spring 2022}{Teaching Assistant}{Department of Mathematics, University of XYZ}{Anytown, USA}{}{Assisted in grading and holding office hours for Calculus I.}
\cventry{Fall 2021}{Lecturer}{Department of Computer Science, University of XYZ}{Anytown, USA}{}{Taught Introduction to Programming to 30 students.}

\section{research experience}
\cventry{2016--present}{graduate research assistant}{university of abc}{anytown, usa}{}{}
\cventry{2014--2016}{undergraduate research assistant}{university of xyz}{anytown, usa}{}{}

\section{\textcolor{red}{Publications}}
\cvitem{}{\textbf{\textit{Doe, J.}} (2018). "Title of article." \textit{Journal of XYZ}, 10(2), 123-456.}
\cvitem{}{\textbf{\textit{Doe, J.}} (2017). "Title of book." \textit{publisher}}

\section{Professional Experience}
\cventry{2018--present}{Research Scientist}{ABC Research Institute}{Anytown, USA}{}{Conducting research on XYZ}
\cventry{2016--2018}{Teaching Assistant}{University of ABC}{Anytown, USA}{}{Assisted in teaching undergraduate courses in XYZ}

\section{Professional Memberships}
\cventry{2018--present}{Member}{American Society of Microbiology}{Anytown, USA}{}{}
\cventry{2020--present}{President}{Graduate Student Association, Department of Biology, University of XYZ}{Anytown, USA}{}{}

\section{Awards and Honors}
\cvitem{2021}{Outstanding Graduate Research Award, Department of Biology, University of XYZ}
\cvitem{2019}{Graduate Research Fellowship, National Science Foundation}

\end{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;the above tex code will produce the following CV:&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/cv-banner.jpg" alt="professional CV created with latex" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Creating an academic CV using LaTeX is a great way to showcase your academic achievements, research interests, and publications in a professional and polished manner. With the &lt;strong style="color: #000000;"&gt;"moderncv"&lt;/strong&gt; template and the steps outlined in this guide, you can create an academic CV that highlights your strengths and accomplishments. Remember to customize your CV to suit your individual needs, add relevant details to each section, and review and edit it carefully before submitting it to potential employers or academic institutions.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="academic CV"></category><category term="template"></category><category term="Customization"></category><category term="education"></category><category term="research experience"></category><category term="publications"></category><category term="formatting"></category><category term="professional"></category><category term="achievements"></category><category term="qualifications"></category><category term="curriculum vitae"></category></entry><entry><title>Latex Tricks: How to Shade the Area Under a Curve in Seconds</title><link href="https://mosaid.xyz/articles/latex-tricks-how-to-shade-the-area-under-a-curve-in-seconds-134.html" rel="alternate"></link><published>2023-03-19T20:42:53+00:00</published><updated>2023-03-19T20:42:53+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-03-19:/articles/latex-tricks-how-to-shade-the-area-under-a-curve-in-seconds-134.html</id><summary type="html">&lt;p&gt;This article provides a tutorial on how to shade an area under a curve using LaTeX, specifically the tikz and pgfplots packages. It includes a complete LaTeX code with the necessary packages and settings. The article also explains the purpose of each package and parameter used in the code. This tutorial is helpful for anyone who wants to create high-quality graphs and plots with LaTeX.&lt;/p&gt;</summary><content type="html">&lt;p&gt;In this article I am going to show you how to shade an area under a curve (Think Integrals) using Latex, it is really a simple process just using the tikz and pgfplots packages. I will give you the entire working latex code. so let's get started&lt;/p&gt;

&lt;h2&gt;First let's get the usual preamble out of the way:&lt;/h2&gt;
&lt;pre class="language-latex" &gt;
   &lt;code class="language-latex" &gt;

\documentclass{standalone}
\standaloneconfig{border=2mm 2mm 2mm 2mm}

%maths
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}

%tikzpicture
\usepackage{tikz}
\usepackage{scalerel}
\usepackage{pict2e}
\usepackage{tkz-euclide}
\usetikzlibrary{calc}
\usetikzlibrary{patterns,arrows.meta}
\usetikzlibrary{shadows}
\usetikzlibrary{external}

%pgfplots
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{statistics}
\usepgfplotslibrary{fillbetween}

%colours
\usepackage{xcolor}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;We will be using the standalone document class to generate just the picture of our plot not an entire document page, the above preamble contains all the necessary packages needed for creating our document.&lt;/p&gt;

&lt;p&gt;The following parameters are some prepared settings for all the work with pgfplots, like using the radian for trigonometry, showing a grid and so forth. I just copy and paste them in all the documents that are using pgfplots and tikz&lt;/p&gt;

&lt;pre class="language-latex" &gt;
   &lt;code class="language-latex" &gt;

\pgfplotsset{
   standard/.style={
      axis line style = thick,
      trig format=rad,
      enlargelimits,
      axis x line=middle,
      axis y line=middle,
      enlarge x limits=0.15,
      enlarge y limits=0.15,
      every axis x label/.style={at={(current axis.right of origin)},anchor=north west},
      every axis y label/.style={at={(current axis.above origin) },anchor=south east},
      grid=both,
      ticklabel style={font=\tiny, fill=white}
   }
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Now, let's get started with the actual tikz picture of our plot.&lt;/h2&gt;

&lt;pre class="language-latex" &gt;
   &lt;code class="language-latex" &gt;

\begin{tikzpicture}
   \begin{axis}[standard,
         xtick={0.1,0.2,0.5,1},
         ytick={0.1,0.2,0.5,1,2},
         xticklabels={$0.1$,$0.2$,$0.5$,$1$},
         yticklabels={$0.1$,$0.2$,$0.5$,$1$,$2$},
         xlabel={ $x$},
         ylabel={ $y$},
         samples=1000,
         xmin=0, xmax=1.3,
         ymin=0, ymax=1.3]

      \node[anchor=center, label=south west:$O$] at (axis cs:0,0){};
      \addplot[name path=F, line width=0.3mm, blue, domain={0:2}]{sqrt(x)} node[pos=0.8, above left] {$C_f$};
      \path[name path=xAxis] (axis cs: 0,0) -- (axis cs: 1,0);
      \addplot[fill=black, fill opacity=0.2] fill between [of=xAxis and F, soft clip={domain=0.2:1}];
      \node[anchor=center, label=south east:$A(x)$] at (axis cs:0.5,0.5){};
   \end{axis}
\end{tikzpicture}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;We perepare yet another set of parameters, like the xticks and ytick, and the x and y axis labels, you can change them as you see fit. you can experiment with the min and max values of the axis. and see their effects.&lt;/p&gt;

&lt;p&gt;&lt;strong style="color: #000000;"&gt;\node[anchor=center, label=south west:$O$] at (axis cs:0,0){};&lt;/strong&gt;. This line creates a node at the point (0,0) on the coordinate axis, which represents the origin of the graph. The label=south west:$O$ option adds a label "O" to the node, positioned to the bottom-left of the node.&lt;/p&gt;

&lt;p&gt;&lt;strong style="color: #000000;"&gt;\addplot[name path=F, line width=0.3mm, blue, domain={0:2}]{sqrt(x)} node[pos=0.8, above left] {$C_f$};&lt;/strong&gt;. This line plots a function of the form y=sqrt(x) for values of x ranging from 0 to 2. The name path=F option assigns a name "F" to the plot, which will be used later to fill the area under the curve. The line width=0.3mm, blue options set the appearance of the line to have a thickness of 0.3mm and a blue color. The &lt;strong style="color: #000000;"&gt;node[pos=0.8, above left] {$C_f$}&lt;/strong&gt; option adds a label "$C_f$" to the curve, positioned 80% of the way along the curve from the left, and above the curve.&lt;/p&gt;

&lt;p&gt;&lt;strong style="color: #000000;"&gt;\path[name path=xAxis] (axis cs: 0,0) -- (axis cs: 1,0);&lt;/strong&gt;. This line creates a path named "xAxis" that starts from the point (0,0) on the coordinate axis and ends at the point (1,0). This path represents the x-axis of the graph. this actually doesn't do anything. it is just used int shading of the the area under the curve&lt;/p&gt;

&lt;p&gt;&lt;strong style="color: #000000;"&gt;\addplot[fill=black, fill opacity=0.2] fill between [of=xAxis and F, soft clip={domain=0.2:1}];&lt;/strong&gt;. This line fills the area between the x-axis and the plot "F", for x-values between 0.2 and 1. The fill=black option sets the color of the fill to black, and the fill opacity=0.2 option sets the opacity of the fill to 20%. The of=xAxis and F option specifies the paths to fill between. The &lt;strong style="color: #000000;"&gt;soft clip={domain=0.2:1}&lt;/strong&gt; option clips the fill to the x-domain between 0.2 and 1. This line effectively shades the area under the curve between the x-values 0.2 and 1.&lt;/p&gt;

&lt;p&gt;&lt;strong style="color: #000000;"&gt;\node[anchor=center, label=south east:$A(x)$] at (axis cs:0.5,0.5){};&lt;/strong&gt;. This line creates a node at the point (0.5,0.5) on the coordinate axis. The label=south east:$A(x)$ option adds a label "A(x)" to the node, positioned to the bottom-right of the node. This label represents a point on the curve, with x-coordinate 0.5 and y-coordinate sqrt(0.5).&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;h2&gt;And here is the entire code put together:&lt;/h2&gt;
&lt;pre class="language-latex" &gt;
   &lt;code class="language-latex" &gt;


\documentclass{standalone}
\standaloneconfig{border=2mm 2mm 2mm 2mm}

%maths
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}

%tikzpicture
\usepackage{tikz}
\usepackage{scalerel}
\usepackage{pict2e}
\usepackage{tkz-euclide}
\usetikzlibrary{calc}
\usetikzlibrary{patterns,arrows.meta}
\usetikzlibrary{shadows}
\usetikzlibrary{external}

%pgfplots
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{statistics}
\usepgfplotslibrary{fillbetween}

%colours
\usepackage{xcolor}

\begin{document}

\pgfplotsset{
   standard/.style={
      axis line style = thick,
      trig format=rad,
      enlargelimits,
      axis x line=middle,
      axis y line=middle,
      enlarge x limits=0.15,
      enlarge y limits=0.15,
      every axis x label/.style={at={(current axis.right of origin)},anchor=north west},
      every axis y label/.style={at={(current axis.above origin) },anchor=south east},
      grid=both,
      ticklabel style={font=\tiny, fill=white}
   }
}

\begin{tikzpicture}
   \begin{axis}[standard,
         xtick={0.1,0.2,0.5,1},
         ytick={0.1,0.2,0.5,1,2},
         xticklabels={$0.1$,$0.2$,$0.5$,$1$},
         yticklabels={$0.1$,$0.2$,$0.5$,$1$,$2$},
         xlabel={ $x$},
         ylabel={ $y$},
         samples=1000,
         xmin=0, xmax=1.3,
      ymin=0, ymax=1.3]

      \node[anchor=center, label=south west:$O$] at (axis cs:0,0){};
      \addplot[name path=F, line width=0.3mm, blue, domain={0:2}]{sqrt(x)} node[pos=0.8, above left] {$C_f$};
      \path[name path=xAxis] (axis cs: 0,0) -- (axis cs: 1,0);
      \addplot[fill=black, fill opacity=0.2] fill between [of=xAxis and F, soft clip={domain=0.2:1}];
      \node[anchor=center, label=south east:$A(x)$] at (axis cs:0.5,0.5){};
   \end{axis}
\end{tikzpicture}

\end{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;This code will produce the following picture:&lt;/h2&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/135-img-1.jpg" alt="shading an area under a curve using latex tikz and pgfplots" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;shading an area under a curve using latex tikz and pgfplots&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;And to shade the area between two curves we use another plot instead of using the xAxis path we used earlier. it would be like this:&lt;/p&gt;
&lt;pre class="language-latex" &gt;
   &lt;code class="language-latex" &gt;

\documentclass{standalone}
\standaloneconfig{border=2mm 2mm 2mm 2mm}

%maths
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}

%tikzpicture
\usepackage{tikz}
\usepackage{scalerel}
\usepackage{pict2e}
\usepackage{tkz-euclide}
\usetikzlibrary{calc}
\usetikzlibrary{patterns,arrows.meta}
\usetikzlibrary{shadows}
\usetikzlibrary{external}

%pgfplots
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{statistics}
\usepgfplotslibrary{fillbetween}

%colours
\usepackage{xcolor}

\begin{document}
\pgfplotsset{
   standard/.style={
      axis line style = thick,
      trig format=rad,
      enlargelimits,
      axis x line=middle,
      axis y line=middle,
      enlarge x limits=0.15,
      enlarge y limits=0.15,
      every axis x label/.style={at={(current axis.right of origin)},anchor=north west},
      every axis y label/.style={at={(current axis.above origin) },anchor=south east},
      grid=both,
      ticklabel style={font=\tiny, fill=white}
   }
}

\begin{tikzpicture}
   \begin{axis}[standard,
         xtick={0.1,0.2,0.5,1},
         ytick={0.1,0.2,0.5,1,2},
         xticklabels={$0.1$,$0.2$,$0.5$,$1$},
         yticklabels={$0.1$,$0.2$,$0.5$,$1$,$2$},
         xlabel={ $x$},
         ylabel={ $y$},
         samples=1000,
         xmin=0, xmax=1.3,
      ymin=0, ymax=1.3]

      \node[anchor=center, label=south west:$O$] at (axis cs:0,0){};
      \addplot[name path=F, line width=0.3mm, red, domain={0:2}]{x^2} node[pos=0.4, above left] {$C_f$};
      \addplot[name path=G, line width=0.3mm, blue, domain={0:2}]{sqrt(x)} node[pos=0.8, above left] {$C_g$};
      \addplot[fill=black, fill opacity=0.2] fill between [of=F and G, soft clip={domain=0:1}];
   \end{axis}
\end{tikzpicture}

\end{document}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;And the result will be like this&lt;/h2&gt;

&lt;figure&gt;
   &lt;img src="/theme/images/articles/images/135-img-2.jpg" alt="shading an area between two curves using latex tikz and pgfplots" style="max-width:100%;height:auto;" &gt;
   &lt;figcaption&gt;shading an area between two curves using latex tikz and pgfplots&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;And that's it. I hope you liked this latex tutorial. and let me know in the comment section bellow if I missed something or if you have any suggestion or request for another latex tutorial. happy writing&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="latex"></category><category term="tikz"></category><category term="pgfplots"></category><category term="shading"></category><category term="curve"></category><category term="integral"></category><category term="Mathematics"></category><category term="visualization"></category></entry><entry><title>Top LaTeX Editors for Professional Document Formatting</title><link href="https://mosaid.xyz/articles/top-latex-editors-for-professional-document-formatting-133.html" rel="alternate"></link><published>2023-03-19T12:55:13+00:00</published><updated>2023-03-19T12:55:13+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-03-19:/articles/top-latex-editors-for-professional-document-formatting-133.html</id><summary type="html">&lt;p&gt;Discover the best LaTeX editors for creating professional-looking documents with ease. Whether you're a beginner or an advanced user, explore our top picks to find the right tool for your needs&lt;/p&gt;</summary><content type="html">&lt;p&gt;Hey there, fellow writer! Are you tired of spending hours formatting your documents and still not getting the polished look you desire? Well, let me introduce you to LaTeX, the ultimate tool for creating professional-looking documents. As someone who has spent countless hours trying to perfect my documents, I can attest to the fact that LaTeX is a game-changer.&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;But let's be be honest, LaTeX coding can be challenging, frustrating even, especially if you're just getting started. That's why finding the right LaTeX editor is important.&lt;/p&gt;

&lt;p&gt;Personally, I use &lt;strong style="color: #000000;"&gt;vim editor&lt;/strong&gt; for almost all my writing. I am constantly adding keyboard mappings and code snippets to my vim settings. I have an entire layout of my most used type of document ready with just a simple keyboard keystroke. And many other small snippets. But that needs its own article to show my latex settings.&lt;/p&gt;

&lt;p&gt;However, if you're new to LaTeX, I recommend trying out &lt;strong style="color: #000000;"&gt;TeXstudio&lt;/strong&gt;. It's user-friendly and comes with advanced features such as code completion, syntax highlighting, and error checking. Plus, it has a built-in PDF viewer and spell checker, which saves you a lot of time and effort.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;If you're a Linux user, I recommend &lt;strong style="color: #000000;"&gt;Kile&lt;/strong&gt;, a LaTeX editor designed specifically for Linux. It also has many features, including syntax highlighting, code completion, and a built-in PDF viewer. Additionally, it supports various project templates and provides tools for managing citations and references.&lt;/p&gt;

&lt;p&gt;For advanced users, &lt;strong style="color: #000000;"&gt;Emacs + AUCTeX&lt;/strong&gt; is a powerful combination. Emacs is a highly customizable text editor, and AUCTeX is a package that provides LaTeX-specific features such as syntax highlighting, code completion, and previewing. It can be customized according to your preferences and workflow, making it a powerful tool for experienced LaTeX users.&lt;/p&gt;

&lt;p&gt;In conclusion, choosing the right LaTeX editor can make a significant difference in your productivity and help you create professional documents with ease. So, take the time to explore the options and find the one that suits you best. Happy writing!&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Latex"></category><category term="LaTeX editors"></category><category term="TeXstudio"></category><category term="Kile"></category><category term="Emacs"></category><category term="AUCTeX"></category><category term="document formatting"></category><category term="productivity"></category><category term="professional documents"></category><category term="vim"></category></entry></feed>