Doc command arguments
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
% Images
|
% Images
|
||||||
% example: \fig[1]{universe}{The Universe}[Additional caption text, not shown in the list of figures]
|
% example: \fig[1]{universe}{The Universe}[Additional caption text, not shown in the list of figures]
|
||||||
% reference later with: \figref{universe}
|
% reference later with: \figref{universe}
|
||||||
\RenewDocumentCommand{\fig}{O{1} O{htbp} m m o}{%
|
\RenewDocumentCommand{\fig}{O{1} O{htbp} m m o}{% #1 = width, #2 = position, #3 = label, #4 = caption, #5 = additional caption
|
||||||
\begin{figure}[#2]
|
\begin{figure}[#2]
|
||||||
\centering%
|
\centering%
|
||||||
\includegraphics[width=#1\linewidth]{#3}%
|
\includegraphics[width=#1\linewidth]{#3}%
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
% \subfig[1][htbp]{subfig2}[caption]%
|
% \subfig[1][htbp]{subfig2}[caption]%
|
||||||
% \end{subfigs}
|
% \end{subfigs}
|
||||||
% reference later with: \figref{label}
|
% reference later with: \figref{label}
|
||||||
\RenewDocumentEnvironment{subfigs}{O{htbp} m m o}{%
|
\RenewDocumentEnvironment{subfigs}{O{htbp} m m o}{% #1 = position, #2 = label, #3 = title, #4 = subfig titles
|
||||||
\begin{figure}[#1]%
|
\begin{figure}[#1]%
|
||||||
\centering%
|
\centering%
|
||||||
}{%
|
}{%
|
||||||
@@ -63,11 +63,11 @@
|
|||||||
\end{figure}%
|
\end{figure}%
|
||||||
}
|
}
|
||||||
|
|
||||||
\NewDocumentCommand{\subfigsheight}{m}{%
|
\NewDocumentCommand{\subfigsheight}{m}{% Set the height of the subfigures
|
||||||
\setkeys{Gin}{height=#1}%
|
\setkeys{Gin}{height=#1}%
|
||||||
}
|
}
|
||||||
|
|
||||||
\RenewDocumentCommand{\subfig}{o O{b} m O{}}{%
|
\RenewDocumentCommand{\subfig}{o O{b} m O{}}{% #1 = width, #2 = valign, #3 = filename, #4 = caption
|
||||||
\hfill%
|
\hfill%
|
||||||
\subfloat[#4\label{fig:#3}]{%
|
\subfloat[#4\label{fig:#3}]{%
|
||||||
\IfValueTF{#1}{%
|
\IfValueTF{#1}{%
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
%% Figures
|
%% Figures
|
||||||
% example: \fig[1]{universe}{The Universe}[Short title for list of figures]
|
% example: \fig[1]{universe}{The Universe}[Short title for list of figures]
|
||||||
% reference later with: \figref{universe}
|
% reference later with: \figref{universe}
|
||||||
\NewDocumentCommand{\fig}{O{0.8} O{htbp} m m O{#4}}{%
|
\NewDocumentCommand{\fig}{O{0.8} O{htbp} m m O{#4}}{% #1 = width, #2 = position, #3 = filename, #4 = caption, #5 = short caption
|
||||||
\begin{figure}[#2]
|
\begin{figure}[#2]
|
||||||
\centering%
|
\centering%
|
||||||
\includegraphics[width=#1\linewidth]{#3}%
|
\includegraphics[width=#1\linewidth]{#3}%
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
\end{figure}%
|
\end{figure}%
|
||||||
}
|
}
|
||||||
|
|
||||||
\NewDocumentCommand{\figwide}{O{1} O{htbp} m m O{#4}}{%
|
\NewDocumentCommand{\figwide}{O{1} O{htbp} m m O{#4}}{% #1 = width, #2 = position, #3 = filename, #4 = caption, #5 = short caption
|
||||||
\begin{figure*}[#2]
|
\begin{figure*}[#2]
|
||||||
\centering%
|
\centering%
|
||||||
\includegraphics[width=#1\linewidth]{#3}%
|
\includegraphics[width=#1\linewidth]{#3}%
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
% \subfig[1][htbp]{subfig2}[caption]%
|
% \subfig[1][htbp]{subfig2}[caption]%
|
||||||
% \end{subfigs}
|
% \end{subfigs}
|
||||||
% reference later with: \figref{label}
|
% reference later with: \figref{label}
|
||||||
\NewDocumentEnvironment{subfigs}{O{htbp} m m O{#3}}{%
|
\NewDocumentEnvironment{subfigs}{O{htbp} m m O{#3}}{% #1 = position, #2 = label, #3 = title, #4 = short title
|
||||||
\begin{figure}[#1]%
|
\begin{figure}[#1]%
|
||||||
\centering%
|
\centering%
|
||||||
}{%
|
}{%
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
\end{figure}%
|
\end{figure}%
|
||||||
}
|
}
|
||||||
|
|
||||||
\NewDocumentEnvironment{subfigswide}{O{htbp} m m O{#3}}{%
|
\NewDocumentEnvironment{subfigswide}{O{htbp} m m O{#3}}{% #1 = position, #2 = label, #3 = title, #4 = short title
|
||||||
\begin{figure*}[#1]%
|
\begin{figure*}[#1]%
|
||||||
\centering%
|
\centering%
|
||||||
}{%
|
}{%
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
\end{figure*}%
|
\end{figure*}%
|
||||||
}
|
}
|
||||||
|
|
||||||
\NewDocumentCommand{\subfig}{O{0.2} O{b} m o}{%
|
\NewDocumentCommand{\subfig}{O{0.2} O{b} m o}{% #1 = width, #2 = valign, #3 = filename, #4 = caption
|
||||||
\IfValueTF{#4}{%
|
\IfValueTF{#4}{%
|
||||||
\subfloat[#4\label{fig:#3}]{\includegraphics[width=#1\linewidth,valign=#2]{#3}}%
|
\subfloat[#4\label{fig:#3}]{\includegraphics[width=#1\linewidth,valign=#2]{#3}}%
|
||||||
}{%
|
}{%
|
||||||
@@ -187,7 +187,7 @@
|
|||||||
% \end{tabular}
|
% \end{tabular}
|
||||||
% \end{tab}
|
% \end{tab}
|
||||||
% reference later with: \tabref{label}
|
% reference later with: \tabref{label}
|
||||||
\NewDocumentEnvironment{tab}{m m}{%
|
\NewDocumentEnvironment{tab}{m m}{% #1 = label, #2 = title
|
||||||
\begin{table}%
|
\begin{table}%
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\caption{#2}%
|
\caption{#2}%
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
\end{table}%
|
\end{table}%
|
||||||
}
|
}
|
||||||
|
|
||||||
\NewDocumentEnvironment{tabwide}{m m}{%
|
\NewDocumentEnvironment{tabwide}{m m}{% #1 = label, #2 = title
|
||||||
\begin{table*}%
|
\begin{table*}%
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\caption{#2}%
|
\caption{#2}%
|
||||||
|
|||||||
Reference in New Issue
Block a user