Re: Upquotes for code

Mike Maxwell <[email protected]> Sat, 6 Aug 2022 13:40:02 -0400
Newsgroups gmane.text.docbook.apps
Message-ID <[email protected]>
We used dblatex extensively some years ago, with our own LaTeX 
stylesheets.  My memory is somewhat vague, but I think that you won't 
see the \usepackage{upquote} in the LaTeX output file, because it's 
inside the (in your case) texstyle.sty file--you'll only see a line that 
says
    \usepackage{texstyle}
You should however see it loading 'upquote' in LaTeX's .log file.

But more importantly, the documentation for the upquote package 
(https://ctan.math.washington.edu/tex-archive/macros/latex/contrib/upquote/upquote.pdf) 
says "The package does not affect \tt, \texttt, etc."  So I wouldn't 
expect it to force straight quotes inside \texttt{} strings, only inside 
'verbatim' or 'verb' blocks.  The way to force straight quotes inside 
\texttt{} is here:
 
https://tex.stackexchange.com/questions/257612/adding-straight-quote-marks-to-texttt
although it admittedly requires you to use \textquotesingle{}, which is 
a lot of typing.  (You could of course re-define a simple macro like 
\tq{} to be \textquotesingle{}.)

There are some more complicated solutions (in that you may have to 
copy-past more code into your .sty file) here, which allow you to just 
use the single quote mark:
 
https://tex.stackexchange.com/questions/436308/changing-all-single-quotes-to-be-straight-when-within-texttt
My personal preference is the XeLaTeX solution, since that allows you to 
use non-ASCII Unicode text in your input files.  dblatex calls it if you use
     -b xetex
on the command line.  But you may have no need for that, and pdflatex is 
admittedly faster.

     Mike Maxwell
     University of Maryland

On 8/6/2022 8:21 AM, Esteban Zimanyi wrote:
> I am using dblatex to generate pdf content from docbook source files.
> 
> I was able to make programlisting (listings in Latex) to produce
> straight quotes by passing a file named 'textstyle.sty' whose contents
> is as follows
> ------------------------
> %%
> %% This style is derived from the manual
> %% http://dblatex.sourceforge.net/doc/manual/sec-custom-latex.html
> %%
> \NeedsTeXFormat{LaTeX2e}
> \ProvidesPackage{texstyle}[2017/04/25 PostGIS DocBook Style]
> 
> %% Just use the original package and pass the options
> \RequirePackageWithOptions{docbook}
> 
> %% Make regular quotes within programlisting tags (#3726)
> \usepackage{upquote}
> \usepackage{listings}
> \lstset{upquote=true}
> ------------------------
> 
> However this does not work with inline code (texttt in Latex). When
> compiling with the debug flag
> 
> $dblatex -s texstyle.sty -d mobilitydb-berlinmod.xml
> 
> and analyze the generated file I can see that there is NO
> 
> \usepackage{upquote}
> 
> and the content where the problem is looks as follows
> 
> .... with one of the values \texttt{'minimal'} (the default),
> \texttt{'medium'}, ....
> 
> Any idea how to solve this ?
> 
> Thanks for your answer !

-- 
This email has been checked for viruses by AVG antivirus software.
www.avg.com