Dear Amber,
Thank you and thanks so much for writing the Non-Fiction Format for LaTeX template! It really completes the Scrivener offering.
While I have your attention, how do I insert text so that it gets used literally, and not interpreted by LaTeX? I tried Format > Preserve Format but I still have difficulty.
For instance, there’s this error:
! Missing $ inserted.
<inserted text>
$
l.1086 fld = 'DAY_
TO_DAY_TOT_RETURN_NET_DVDS';
The corresponding LaTeX code is
[code]\subsubsection{KDB+ Queries}
\label{scrivauto:153}
% COUNT ROWS
numRows = fetch(cKDB,['count ’ dbName]);
% GET UNIQUE VALUES
q = fetch(cKDB,['select distinct VALUE from ’ dbName]);
% for fields or tickers with embedded spaces, convert to symbol in the query with
% $("...") as above tkr = 'SPX INDEX'; fld = 'DAY_TO_DAY_TOT_RETURN_NET_DVDS'; q = fetch(cKDB,['select from ' dbName ' where DATE>2000.01.01, DATE<2010.01.01,' ... 'FIELD=
’ fld ‘,’ ‘TICKER=`$("’ tkr ‘")’]);[/code]
And, you can see the formatting is protected in the original text:
I think it may be related to special characters, or not. I’m confused. For instance, even when there is an ampersand in a file name, I get the error
! Misplaced alignment tab character &.
<argument> Standard &
Poor's Data Set
l.990 \subsection{Standard & Poor's Data Set}
It comes from this:

Do I need to escape the ampersands? I wouldn’t have expected to have to do that. When I remove the ampersand, it compiles.
Then, there’s this error:
! Missing $ inserted.
<inserted text>
$
l.1078 ...the FIELD in the Main Table is SECURITY_
TYP and its corresponding ...
Looking at the LaTeX code, it reads
In this case, if the FIELD in the Main Table is SECURITY_TYP and its corresponding VALUE is 3, that is equivalent to a SECURITY_TYP of ``Mutual Fund'' in the Bloomberg database.
But the actual text is
I’m not sure what’s wrong with that.I tried removing the quotations but the error persists.
Please tell me what I’m doing wrong so can make the most of this great template.
Thanks,
Michael