Re: [docbook-apps] Upquotes for code

2022-08-06 Thread Mike Maxwell
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

-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



Re: [docbook-apps] Upquotes for code

2022-08-07 Thread Mike Maxwell

On 8/7/2022 3:11 AM, Esteban Zimanyi wrote:

However, I wonder whether a better solution would be to translate
docbook  to LaTeX \lstinline in the same way that
 is translated to \lstlisting; That will definitely
solve the problem in an easy and efficient way.

Do you think that the docbook community could envision this possibility?


I can't speak for the DocBook community, although my sense is that most 
people on this mailing list use XSL-FO rather than dblatex.  The 
developer of dblatex is BenoƮt Guillon.  Back when we were using 
dblatex, he was responsive to emails, but the last release I see is 
2016, so I suspect he's no longer actively maintaining it.


That said, the XSLT code that translates DocBook XML into LaTeX is 
included in the dblatex package, so you can edit it to produce whatever 
LaTeX code you want.  We did that in our project, although I confess I 
found XSLT extremely hard to debug.  So yes, you can translate  
into \lstinline, and that particular transform sounds like it would be 
fairly simple.


   Mike Maxwell
   University of Maryland

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

-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org