-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain1.tex
158 lines (109 loc) · 3.25 KB
/
main1.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
\documentclass[twocolumn]{article}
\usepackage{cite}
\usepackage[dvips]{graphicx}
\usepackage{psfrag}
\usepackage[font=footnotesize,caption=false]{subfig}
\usepackage{url}
\graphicspath{{.}{./images/}}
% uncomment REFRESHFIGURES command definition to refresh figures (matlab and svg)
% note that you need inkscape installed
% and run pdflatex with the -shell-escape option
%
% > pdflatex -shell-escape
%
\newcommand{\REFRESHFIGURES}{}
\ifdefined\REFRESHFIGURES
\usepackage{auto-pst-pdf}%this one is for eps
\newcommand{\executeiffilenewer}[3]{%
\ifnum\pdfstrcmp{\pdffilemoddate{#1}}%
{\pdffilemoddate{#2}}>0%
{\immediate\write18{#3}}\fi%
}
\newcommand{\includesvg}[1]{%
\executeiffilenewer{images/#1.svg}{images/#1.pdf_tex}%
{inkscape -z -D --file=images/#1.svg %
--export-area-page %
--export-pdf=images/#1.pdf --export-latex}%
\input{images/#1.pdf_tex}%
}
\else
\usepackage[off]{auto-pst-pdf}
\newcommand{\includesvg}[1]{%
\input{images/#1.pdf_tex}%
}
\fi
%%%%%% example
%\begin{figure}
%\centering
% \def\svgwidth{\columnwidth}
% \includesvg{image}
% \caption{The test image, exported to PDF \emph{with} \LaTeX\ option.}
% \label{fig:pdflatex}
%\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage[inline]{showlabels}
\usepackage{paralist}
\newenvironment{inparlist}{\begin{inparaenum}[\itshape i)]}{\end{inparaenum}}
\usepackage{xstring}
\usepackage{todonotes}
\newcommand{\rmk}[2]{%
\IfEqCase{#1}{%
{OldText}{\todo[inline,color=green!40]{\textbf{#1}: #2}}%
{Gianni}{\todo[inline,color=red!20]{\textbf{#1}: #2}}%
{Laure}{\todo[inline,color=red!30]{\textbf{#1}: #2}}%
}[{\todo[inline,color=green!10]{\textbf{#1}: #2}}]%
}%
\usepackage{flushend}
\usepackage{xspace}
% correct bad hyphenation here
\hyphenation{op-tical net-works semi-conduc-tor off-line }
\usepackage{xspace}
\newcommand{\eg}{\textit{e.g.}\xspace}
\usepackage{cleveref}
\usepackage{nicefrac}
\crefformat{equation}{(#2#1#3)}
\crefformat{section}{Sec.~#2#1#3}
\crefformat{figure}{Fig.~#2#1#3}
\crefformat{paragraph}{par.~#2#1#3}
\crefformat{lstlisting}{Listing~#2#1#3}
\crefmultiformat{lstlisting}{Listings~#2#1#3}%
{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
\include{listing_def}
\title{Examples of latex usages}
\author{
G.~Borghesan
}
\begin{document}
\maketitle
We will \begin{inparaenum}
\item try to use automatic building with images from svg with inkscape, as for \cref{fig:eye_anatomy} and
\item eps, with psfragfig, \cref{fig:figs}.
\end{inparaenum}
Then add a listing as in is \cref{listing:lua1}.
\rmk{Gianni}{This is a remark of mine.}
\rmk{TODO}{This is a todo.}
\lstinputlisting[style=luastyle,float,caption={A lua file},label=listing:lua1]{lua_example.lua}
\begin{figure}[]
\centering
\def\svgwidth{\columnwidth}
\includesvg{eye_anatomy}
\caption{The test image, exported to PDF \emph{with} \LaTeX\ option.}
\label{fig:eye_anatomy}
\end{figure}
\begin{figure}
\centering
\input{psfragFigMacros}
\subfloat[A nice figure \label{fig:sub:1}]
{
\psfragfig[width=0.9\columnwidth]{images/Modes}
}\\
\subfloat[Another nice figure \label{fig:sub:2}]
{
\psfragfig[width=0.9\columnwidth]{segmentation}
}
\caption{Nice figures}
\label{fig:figs}
\end{figure}
%\subsubsection*{Counts of words}
%\wordcount
\end{document}