Skip to content

Commit

Permalink
Latex datasheet fixes.
Browse files Browse the repository at this point in the history
Includes:
0. Update version to shell out to git.
1. Long table + tabularx for messages table. Adding new messages
shouldn't break Latex's ability to process floats now.

Closes swift-nav#85.
Closes swift-nav#86.

/cc @fnoble @denniszollo @mfine
  • Loading branch information
mookerji committed May 3, 2015
1 parent b95ec80 commit 46de40a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Binary file modified docs/sbp.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion generator/sbpg/targets/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,6 @@ def render_source(output_dir, package_specs):
import subprocess
import os
os.chdir(output_dir)
subprocess.call(["pdflatex", "sbp_out.tex"])
subprocess.call(["pdflatex", "--enable-write18",
"-shell-escape", "sbp_out.tex"])
subprocess.call(["mv", "sbp_out.pdf", "../docs/sbp.pdf"])
17 changes: 8 additions & 9 deletions generator/sbpg/targets/resources/sbp_base.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
\usepackage{pbox}
\usepackage{soul}
\usepackage{hyperref}
\usepackage{ltxtable}
\usepackage{caption}

\hypersetup{bookmarks,bookmarksopen,bookmarksdepth=4}

Expand All @@ -31,13 +33,6 @@
\numberwithin{field}{subsection}

\renewcommand{\thesubsubsection}{\hspace{-0.45cm}}
%% \renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
%% \makeatletter
%% \def\@seccntformat#1{\csname #1ignore\expandafter\endcsname\csname the#1\endcsname\quad}
%% \let\sectionignore\@gobbletwo
%% \let\latex@numberline\numberline
%% \def\numberline#1{\if\relax#1\relax\else\latex@numberline{#1}\fi}
%% \makeatother

\newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}
Expand All @@ -59,10 +54,14 @@
\newcolumntype{c}{>{\hsize=.3\hsize}X}
\newcolumntype{d}{>{\hsize=.7\hsize}X}

% Shell out to git to get the most recent tag and pass it to the LateX
% job name. Hopefully this doesn't screw with things.
\immediate\write18{git describe --abbrev=0 --tags > \jobname.info }

\title{Swift Navigation Binary Protocol}
\version{0.33}
\version{\input{\jobname.info}}
\author{Swift Navigation}
\mysubtitle{Protocol Specification v\theversion}
\mysubtitle{Protocol Specification \theversion}
\date{\today}

\begin{document}
Expand Down
12 changes: 6 additions & 6 deletions generator/sbpg/targets/resources/sbp_messages_table.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ \section{Message Types}
purposes only}. Many draft messages are implementation-defined, and
some collections, such as the acquisition package, are used for
internal development.
\end{large}
\begin{table}[h]
\centering
\end{large}\\

\begin{center}
\begin{tabularx}{\textwidth}{badcX}
\toprule
Package & Msg ID & Name & Size (bytes) & Description \\
Expand All @@ -39,9 +39,9 @@ \section{Message Types}
(((m.short_desc|removedir|escape_tex))) \\
((*- endfor *))
\bottomrule
\end{tabularx}
\caption{SBP message types}
\label{tab:messages}
\end{table}
\end{tabularx}
\captionof{table}{SBP message types}
\end{center}
((* endblock *))

0 comments on commit 46de40a

Please sign in to comment.