`[[--opt]]` typesets to `-opt` (drops one dash) with T1 font encoding
See -edit and --edit:
The code for the image:
The course responsible must then generate the sign-up sheet.
This is done by running the following command.
\begin{minted}{bash}
nytid signupsheets generate prg[im]24 --edit
\end{minted}
The [[--edit]] option opens the generated sign-up sheet (or sheets in our case,
Not sure this is expected, I kind of expect [[...]] to be close to verbatim (exception being chunk names) considering I quote code with it.
I can add that it's the same in code chunks, not just quoted code.
<<script.sh>>=
cmd --arg
@
Here --arg would also be typeset as -arg.
>> (when not part of a chunk) is typeset as », but > is typeset as >. Not sure if that's intended. I would be fine with » if > would be more similar. (I'm writing shell scripts at the moment.)
I can't duplicate the fault.
Please send a complete example plus the weave command you used. t.nw.txt t.pdf
Sorry for that, experimented a bit. Here is a MWE, test.nw:
\documentclass{article}
\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
\usepackage{noweb}
\begin{document}
This is a test to see how [[--opt]] is typeset.
<<script.sh>>=
echo "Hello, world!" >> /tmp/hello.txt
echo --opt
@
\end{document}
Weaved using noweave -delay test.nw > test.tex && pdflatex test.tex.
Got it down to the fontenc package. Whenever the fontenc line is uncommented, the problem occurs.
I use \usepackage[T1]{fontenc} to get the Swedish letters å, ä, ö correct in PDFs (when selecting and copying them from the PDF they're actually the letters, without T1 you can't copy the text).
Added But how is >> now, and > >? before \end{document}:
But in maths \(a > b\) works?:
Did some more experiments.
Seems like I don't need \usepackage[T1]{fontenc} anymore for Swedish. ~~So I can just remove that line and solve my problem.~~ (See below.)
If I use xelatex instead, everything just works:
\documentclass{article}
\usepackage{noweb}
\begin{document}
This is a test to see how [[--opt]] is typeset.
<<script.sh>>=
echo "Hello, world!" >> /tmp/hello.txt
echo --opt
@
But how is >> now, and > >?
But in maths \(a > b\) works?
What about å, ä and ö?
\end{document}
Weave using noweave -delay test.nw > test.tex && xelatex test.tex produces
Turns out I need the T1 font encoding for other things. (I used other fonts in my original document.)
~~XeLaTeX didn't help here. Gives the same horrible font as in the top example, just without the upside-down symbols. But still the guillemets for >>.~~ Works with XeLaTeX after setting fonts correctly.
The only issue I encounter with XeLaTeX is that I can't use [[...]] in section headings. Might be due to the fonts. I'll continue experimenting.
If you are using Unicode, XeLaTeX is definitely the way to go.