How to rotate footnote with listings? - rotation

How can I rotate footnote, which contains a listings?
Currently my code looks like:
\documentclass[12pt]{article}
\usepackage{listings} %kod programów
\usepackage{graphicx}
\begin{document}
\rotatebox{180}{\footnote{Trzeba zastosować
\begin{minipage}{0.23\textwidth}
\begin{lstlisting}
\draw[stealth-]\end{lstlisting}
\end{minipage}}}
\end{document}
Sketch:
Many thanks in advance!

You can rotate the content of the footnote like this:
\documentclass[12pt]{article}
\usepackage{listings} %kod programów
\usepackage{graphicx}
\newsavebox{\LstBox}
\begin{document}
\begin{lrbox}{\LstBox}
\begin{lstlisting}
\draw[stealth-]
\end{lstlisting}
\end{lrbox}
some text\footnote{\rotatebox{180}{Trzeba zastosować {\usebox{\LstBox}}}}
\end{document}

Related

How , to avoid vertical straight to overlap the others labels in LaTeX chronosys

I´m trying to follow the documentation of chronosys LaTeX package, to solve my issue to avoid vertical straight to overlap the others labels, but I cannot go ahead!
My code in LaTeX is:
\documentclass[a4paper,12pt]{article}
\usepackage{chronology}
\usepackage{chronosys}
\begin{document}
\startchronology[startyear=1980]
\chronoevent{1982}{\rotatebox{90}{\textbf{ARCH} $\Rightarrow$ \newline Robert Engle~\cite{engle}}}
\chronoevent[markdepth=50pt, ifcolorbox = true, colorbox = white]{1986}{\rotatebox{90}{\textbf{GARCH} $\Rightarrow$ \textit{Tim Bollerslev}~\cite{bollerslev}}}
\chronoevent[markdepth=250pt]{1986}{\rotatebox{90}{\textbf{IGARCH} $\Rightarrow$ \textit{Tim Bollerslev e R. Engle}~\cite{englebollerslev}}}
\stopchronology
\end{document}
That is the result:
I tryed to insert colorbox=white, but I don´t know if I am is in the correct way...
Change the order of the events, so you won't draw the bottom even on top of the other:
\documentclass[a4paper,12pt]{article}
%\usepackage{chronology}
\usepackage{chronosys}
\begin{document}
\startchronology[startyear=1980]
\chronoevent{1982}{\rotatebox{90}{\textbf{ARCH} $\Rightarrow$ \newline Robert Engle~\cite{engle}}}
\chronoevent[markdepth=250pt]{1986}{\rotatebox{90}{\textbf{IGARCH} $\Rightarrow$ \textit{Tim Bollerslev e R. Engle}~\cite{englebollerslev}}}
\chronoevent[markdepth=50pt]{1986}{\rotatebox{90}{\textbf{GARCH} $\Rightarrow$ \textit{Tim Bollerslev}~\cite{bollerslev}}}
\stopchronology
\end{document}

Generate equations with label in sharelatex

I have made the following equation in sharelatex:
\[ \frac{\delta u}{\delta x} + \frac{\delta v}{\delta y} = 0 \]
How can I automatically label this equation with a number?
I have the following before the beginning of my document. My code is a bit messy, but I hope it can show what the problem is that prevents equation from working.
How can I automatically label this equation with a number?
I have the following before the beginning of my document. My code is a bit messy, but I hope it can show what the problem is that prevents equation from working.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{nomencl}
\makenomenclature
\usepackage[english]{babel}
\usepackage[round]{natbib}
\usepackage{natbib}
\setcitestyle{square}
\usepackage[utf8]
\usepackage[table, svgnames, dvipsnames]{xcolor} %color row
\usepackage{makecell}
\renewcommand\theadfont{\normalsize}
\usepackage{caption}
\usepackage{siunitx}
\usepackage[justification=centering,font=small,labelfont=bf,tableposition=top]{caption}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[bottom]{footmisc}
\usepackage[margin=1.1in]{geometry}
\geometry{a4paper,total={170mm,257mm},left=22mm,right=22mm,top=30mm,bottom=20mm}
\usepackage{booktabs}
\usepackage[numbers]{natbib}
\usepackage{float}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{array}
\usepackage{blindtext}
\usepackage{color}
\usepackage{comment}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{footnote}
\usepackage{gensymb}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{hyperref}
\usepackage{lastpage}
\usepackage{listings}
\usepackage{longtable}
\usepackage{nomencl}
\usepackage{pifont}
\usepackage{subcaption}
\usepackage{subfiles}
\usepackage{tablefootnote}
\usepackage{times}
\usepackage{tikz}
\usepackage{watermark}
\usepackage{pdfpages}
\usepackage[pdftex]{graphicx}
\usepackage{graphicx,subcaption}
%for the tables
\usepackage[margin=1in,letterpaper]{geometry} % text block parameters
\usepackage{tabularx,siunitx,booktabs}
\usepackage[skip=0.5\baselineskip]{caption}
\usepackage{newtxtext,newtxmath}
\newcommand\mX[1]{\multicolumn{1}{X}{#1}} % handy shortcut macros
\newcommand\mcc[1]{\multicolumn{2}{c}{#1}}
\newcommand\mcl[1]{\multicolumn{2}{l}{#1}}\usepackage[margin=1in,letterpaper]{geometry} % text
\usepackage{multirow}
\graphicspath{{./Figures/}}
\setlength\parindent{0pt}
\usetikzlibrary{arrows,calc,positioning,shadows,shapes}
\newcommand{\cmark}{\textcolor{green!80!black}{\ding{51}}}
\newcommand{\xmark}{\textcolor{red}{\ding{55}}}
\usepackage{enumitem}%make indented dots
\usepackage{textcomp}
\usepackage{amsmath}
% Array commands, depends on \usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
% Something with captions, depends on \usepackage{caption}
\DeclareCaptionLabelFormat{andtable}{#1~#2 \& \tablename~\thetable}
% Front page settings depends on \usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Name}
\newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{#{}c#{}}#2\end{tabular}}
\rhead{Project}
\renewcommand{\baselinestretch}{1.3} % Line spacing
% Color settings depends on \usepackage{color}
\definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue
\definecolor{mylilas}{RGB}{170,55,241}
\begin{document}
I have tried several codes but nothing is working. Not even the equation option.
Thanks for help in advance!
There are several serve errors in your preamble. You must fix them, if you ignore them tex only syntax checks the rest of the document and you end up with something that might or might not be a valid pdf
you must not load the same package multiple times with different options. The log file will clearly tell you about the error because of an option clash. In your example this concerns geometry, graphicx and natbib
the line \usepackage[utf8] is an syntax error. You must give a package name, not just an option
many other packages are loaded multiple times and some of the options are outdated, you should take a bit of time and clean up this preamble
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{nomencl}
\makenomenclature
\usepackage[english]{babel}
\usepackage[round]{natbib}
%\usepackage{natbib}
\setcitestyle{square}
%\usepackage[utf8]
\usepackage[table, svgnames, dvipsnames]{xcolor} %color row
\usepackage{makecell}
\renewcommand\theadfont{\normalsize}
\usepackage{caption}
\usepackage{siunitx}
\usepackage[justification=centering,font=small,labelfont=bf,tableposition=top]{caption}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[bottom]{footmisc}
\usepackage[margin=1.1in]{geometry}
\geometry{a4paper,total={170mm,257mm},left=22mm,right=22mm,top=30mm,bottom=20mm}
\usepackage{booktabs}
%\usepackage[numbers]{natbib}
\usepackage{float}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{array}
\usepackage{blindtext}
\usepackage{color}
\usepackage{comment}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{footnote}
\usepackage{gensymb}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{hyperref}
\usepackage{lastpage}
\usepackage{listings}
\usepackage{longtable}
\usepackage{nomencl}
\usepackage{pifont}
\usepackage{subcaption}
\usepackage{subfiles}
\usepackage{tablefootnote}
\usepackage{times}
\usepackage{tikz}
\usepackage{watermark}
\usepackage{pdfpages}
%\usepackage[pdftex]{graphicx}
%\usepackage{graphicx,subcaption}
%for the tables
%\usepackage[margin=1in,letterpaper]{geometry} % text block parameters
\usepackage{tabularx,siunitx,booktabs}
\usepackage[skip=0.5\baselineskip]{caption}
\usepackage{newtxtext,newtxmath}
\newcommand\mX[1]{\multicolumn{1}{X}{#1}} % handy shortcut macros
\newcommand\mcc[1]{\multicolumn{2}{c}{#1}}
\newcommand\mcl[1]{\multicolumn{2}{l}{#1}}
%\usepackage[margin=1in,letterpaper]{geometry} % text
\usepackage{multirow}
\graphicspath{{./Figures/}}
\setlength\parindent{0pt}
\usetikzlibrary{arrows,calc,positioning,shadows,shapes}
\newcommand{\cmark}{\textcolor{green!80!black}{\ding{51}}}
\newcommand{\xmark}{\textcolor{red}{\ding{55}}}
\usepackage{enumitem}%make indented dots
\usepackage{textcomp}
\usepackage{amsmath}
% Array commands, depends on \usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
% Something with captions, depends on \usepackage{caption}
\DeclareCaptionLabelFormat{andtable}{#1~#2 \& \tablename~\thetable}
% Front page settings depends on \usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Name}
\newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{#{}c#{}}#2\end{tabular}}
\rhead{Project}
\renewcommand{\baselinestretch}{1.3} % Line spacing
% Color settings depends on \usepackage{color}
\definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue
\definecolor{mylilas}{RGB}{170,55,241}
\begin{document}
\begin{equation}
\frac{\delta u}{\delta x} + \frac{\delta v}{\delta y} = 0
\end{equation}
\end{document}

Image numbering depending on the partition number in which the image is displayed

How can I make captions under images in Fig. 1.1:, Fig. 1.2:, Fig. 2.1:, Fig. 2.2: depending on the section number and not just sequentially from 1 for all images in the article
For example code:
\begin{figure}[htbp]
\minipage{0.32\textwidth}
\centering\includegraphics[width=\linewidth]{images/1.png}
\caption{caption 1}\label{Fig_1}
\endminipage\hfill
\minipage{0.32\textwidth}%
\centering\includegraphics[width=\linewidth]{images/2.png}
\caption{caption 2}\label{Fig_2}
\endminipage\hfill
\minipage{0.32\textwidth}%
\centering\includegraphics[width=\linewidth]{images/3.png}
\caption{caption 3}\label{Fig_3}
\endminipage
\end{figure}
Without any additional packages, latex itself provides the macro \counterwithin which allows to number the figures on a per section basis:
\documentclass{article}
\usepackage{graphicx}
\counterwithin{figure}{section}
\begin{document}
\section{title}
\begin{figure}[htbp]
\begin{minipage}{0.32\textwidth}
% \centering
\includegraphics[width=\linewidth]{example-image-duck}
\caption{caption 1}
\label{Fig_1}
\end{minipage}
\hfill
\begin{minipage}{0.32\textwidth}%
% \centering
\includegraphics[width=\linewidth]{example-image-duck}
\caption{caption 2}
\label{Fig_2}
\end{minipage}
\hfill
\begin{minipage}{0.32\textwidth}%
% \centering
\includegraphics[width=\linewidth]{example-image-duck}
\caption{caption 3}
\label{Fig_3}
\end{minipage}
\end{figure}
\end{document}
(\centering is not necessary if the images already have the same width as the minipage)
There is an answer to this question in tex.stackechange https://tex.stackexchange.com/questions/28333/continuous-v-per-chapter-section-numbering-of-figures-tables-and-other-docume
It redefines counters with the chngcntr package.
But in my opinion, the simpler is to use the floatpackage. It allows to redefine floating environments, with a specific graphic appearance, position, etc, and numbering scheme.
\documentclass{article}
\usepackage{graphicx}
\usepackage{float}
% We define a new float environment called image.
% htbp means 'images' will be positioned preferably here, then at top, bottom or
% on a new page
% info on labels will go to file xx.lim (list of images)
% and it will numbered within sections
\newfloat{image}{htbp}{lim}[section]
% and we want 'Fig.' to appear on the caption
\floatname{image}{Fig.}
\begin{document}
\section{A first section}
blah blah. Look at image \ref{im1}. blah blah
\begin{image}
\centering
\includegraphics[width=3cm]{example-image}
\caption{An image}\label{im1}
\end{image}
\section{A second section}
blah blah. And now consider images \ref{im2} and \ref{im3}. blah blah
\begin{image}
\centering
\hfill\includegraphics[width=3cm]{example-image}\hfill\includegraphics[width=3cm]{example-image}\hfill\includegraphics[width=3cm]{example-image}\hfill
\caption{Now a bunch with several images}\label{im2}
\end{image}
blah blah
\begin{image}
\centering
\begin{tabular}{cc}
\includegraphics[width=3cm]{example-image} &\includegraphics[width=3cm]{example-image}\\
Image A&Image B
\end{tabular}
\caption{And two last images}\label{im3}
\end{image}
\end{document}
If you have several images in a fig, just place them as any text. In TeX, images are considered as (large) characters and the standard positioning methods apply. In the first example, I used \hfill to spread them evenly on a line, and in the second a tabular to include small comments on the images. But many other methods, like minipages, can be used. But if your image set is too long to fit on a line, unwanted line breaks may appear.
Unrelated, but any people use the float package because it also defines a new placement directive 'H' that means more or less 'place the float Here and nowhere else'. And modifying the graphics appearance of floats is also very useful.
Here is another solution without the float package
\documentclass{article}
\usepackage{graphicx}
\usepackage{chngcntr}
% change counter numbering
\counterwithin{figure}{section}
\begin{document}
\section{A first section}
blah blah. Look at images \ref{im1}, \ref{im2} and \ref{im3}. blah blah
\begin{figure}[h]
\begin{minipage}{0.3\linewidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{image 1}\label{im1}
\end{minipage}
\hfill
\begin{minipage}{0.3\linewidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{image 2}\label{im2}
\end{minipage}
\hfill
\begin{minipage}{0.3\linewidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{image 3}\label{im3}
\end{minipage}
\centering
\end{figure}
\end{document}

Side comment between equation (LEFT)

I found the following page, which is almost what I want https://tex.stackexchange.com/questions/344379/side-comment-between-equation/344386#344386
Can someone explain me what change I have to do such that I can put this arrow on the left of my equation? Since this is what I have right now wrong arrow
Thanks in advance
You need to:
move the tikzmarks to the other side of the equations ;
invert the curve: .. controls +(-1,0) and +(-1,0) .. ;
readjust the starting positions: \newcommand\sidecomment[5][-0.5,0.1]% ;
move and align the text attached to the curve to the opposing side: node[left,align=right]{#5}.
Here's the result:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark,arrows,calc}
\usepackage{amsmath}
\newcommand\sidecomment[5][-0.5,0.1]%
{\begin{tikzpicture}[remember picture,overlay]
\draw[-stealth',thick]
($({pic cs:#4}|-{pic cs:#2})+(#1)$)
.. controls +(-1,0) and +(-1,0) ..
node[left,align=right]{#5}
($({pic cs:#4}|-{pic cs:#3})+(#1)$);
\end{tikzpicture}%
}
\begin{document}
\begin{align*}
\tikzmark{a}\beta_1^*
&= \frac{\sum_{i=1}^n(x_i^*-\hat x^*)y_i^*}{\sum_{i=1}^n(x_i^*-\hat x^*)^2}\\
\tikzmark{b}&= \frac{\sum_{i=1}^n(w_2x_i-w_2\hat x)w_1y_i}{\sum_{i=1}^n(w_2x_i-w_2\hat x)^2}
\end{align*}
\sidecomment{a}{b}{b}{since $y_i^*=w_1y_i$\\and $x_i*=w_2x_i$}
\end{document}

Alterning images in beamer is shifting to right

When I am trying to do alternating images in beamer with usage of the \only and overlayarea like this:
\begin{frame}
\frametitle{Tasks}
\begin{overlayarea}{\textwidth}{\textheight}
\begin{figure}
\centering
\only<1>
{
\includegraphics[width=0.3\textwidth]{img/noise_detail_2.png}
}
\only<2>
{
\includegraphics[width=0.3\textwidth]{img/noise_detail_2.png}
}
\only<3>
{
\includegraphics[width=0.3\textwidth]{img/noise_detail_2.png}
}
\only<4>
{
\includegraphics[width=0.3\textwidth]{img/noise_detail_2.png}
}
\end{figure}
\end{overlayarea}
\end{frame}
the image is moving to the right more and more on the each slide. Let's say, that in the 1. slide is in the position x, in the second slide in the position x+5 and in the third slide x+10.
Why? How can I fix it?
You have what is referred to as a spurious space between usages of \only. While spreading out your code for readability purposes might work well, sometimes these spaces cause unwanted output in your resulting PDF. Use % to keep the readability but avoid the spacing issues:
\documentclass{beamer}
\begin{document}
\begin{frame}
\frametitle{Tasks}
\begin{overlayarea}{\textwidth}{\textheight}
\begin{figure}
\centering
\only<1>
{%
\includegraphics[width=.8\textwidth]{example-image-a}%
}%
\only<2>
{%
\includegraphics[width=.8\textwidth]{example-image-b}%
}%
\only<3>
{%
\includegraphics[width=.8\textwidth]{example-image-c}%
}%
\end{figure}
\end{overlayarea}
\end{frame}
\end{document}

Resources