Folks, 
I am trying to add some script bits to the text of my lyx document and I 
(believe) am having some trouble with lyx doing some auto-magic converting of 
single quotes "'" & back ticks "`".  I desire that I _should_ be able to copy 
and paste from both the lyx doc (while I am editing it) and the PDF output into 
my terminals. {program versions at the bottom of the email}

I put *most* of these scriptlets in LyX-Code environments, and was expecting 
LyX-Code to be enough to prevent auto-magic, but no.

The issues I am having is I want the following chars, but get some 
'typographical' replacements:
ASCII 0x27 '  single quote (I think some folks call it apostrophe)
ASCII 0x22 "  double quote
ASCII 0x60 `  back tick
{and the different naming syntax across the web makes searching the web 
difficult}

Example scriptlets:
rpm -q --info lyx | grep Packager | \
 awk -F\: '{print $2}'
for i in `ls *.lyx`; \
do echo "$i is a wonderful file"; done
rpm -q --qf '%{NAME} %{INSTALLTIME}' lyx
Note: also insert a ctrl-enter after the \ on the end of the line, so they copy 
together out of the PDF.
Also see attached MWE.


I think I found that using ctrl+" gets me something that works for double 
quotes (and they work when I copy paste from the terminal to lyx).
But I have not figured out how to enter single quotes and back ticks that don't 
get mangled on the translation to PDF yet.

I have looked at https://wiki.lyx.org/Tips/KeyboardShortcuts but not 
necessarily understood how it can help me yet.

(In the kinder gentler times of Fedora 4 all this seemed to work without 
thinking, but that has been a while ago, and now OTHER folks are once again 
trying to use my documents next to their terminals, and don't take kindly to my 
'mind the 's notes.)

 Thanks for generally keeping my document creation and editing sane for the 
last couple of decades.

Some more clues to control the situation would be appreciated.

Note: I use the versions provided by my OS to the maximum extent, because 
otherwise I have security folks breathing hot down my neck.  So don't ask why I 
have such old tech, it works for *most* things I need.
Versions:
RHEL 8
LyX Version 2.3.6  (from EPEL)
QT 5.15.3
texlive 20180414
evince 3.28.4

#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Itemize
I expect to be able to copy from this LyX or the resulting PDF file, and
 paste in to a Unix terminal and have the command work as expected.
 However single quotes inside of LyX-Code environment are being converted
 to typographical things.
\end_layout

\begin_layout Itemize
The following yields 
\begin_inset Quotes eld
\end_inset

 Fedora Project
\begin_inset Quotes erd
\end_inset

 when copied from LyX or typed directly in the terminal, 
\end_layout

\begin_deeper
\begin_layout Itemize
rpm -q --info lyx |grep Packager | 
\backslash

\begin_inset Newline newline
\end_inset

awk -F
\backslash
: '{print $2}'
\end_layout

\begin_layout LyX-Code
rpm -q --info lyx |grep Packager | 
\backslash

\begin_inset Newline newline
\end_inset

awk -F
\backslash
: '{print $2}'
\end_layout

\begin_layout Itemize
but yields the following error when copied from the PDF (U+FFFD is Unicode
 special 
\begin_inset Quotes qld
\end_inset

?
\begin_inset Quotes qrd
\end_inset

, which LyX does not handle on my installation)
\end_layout

\begin_layout LyX-Code
awk: cmd.
 line:1: ’{print 
\begin_inset Newline newline
\end_inset

awk: cmd.
 line:1: ^ invalid char 'U+FFFD' in expression 
\end_layout

\end_deeper
\begin_layout Itemize
the following yields 
\begin_inset Quotes eld
\end_inset

MWEquotes.lyx is a wonderful file
\begin_inset Quotes erd
\end_inset

 when copied from LyX or typed directly in the terminal, 
\end_layout

\begin_deeper
\begin_layout Itemize
for i in `ls *.lyx`;do echo "$i is a wonderful file" ; done
\end_layout

\begin_layout LyX-Code
for i in `ls *.lyx`;do echo "$i is a wonderful file" ; done
\end_layout

\begin_layout Itemize
but yields the following when copied from the PDF
\end_layout

\begin_layout LyX-Code
‘ls is a wonderful file 
\begin_inset Newline newline
\end_inset

*.lyx‘ is a wonderful file 
\end_layout

\end_deeper
\begin_layout Itemize
the following yields 
\begin_inset Quotes eld
\end_inset

lyx 1731442717
\begin_inset Quotes erd
\end_inset

 when copied from LyX or typed directly in the terminal, 
\end_layout

\begin_deeper
\begin_layout Itemize
rpm -q --qf '%{NAME} %{INSTALLTIME} 
\backslash
n' lyx
\end_layout

\begin_layout LyX-Code
rpm -q --qf '%{NAME} %{INSTALLTIME} 
\backslash
n' lyx
\end_layout

\begin_layout Itemize
but yields the following when copied from the PDF
\end_layout

\begin_layout LyX-Code
package %{INSTALLTIME} is not installed 
\begin_inset Newline newline
\end_inset

package n’ is not installed 
\end_layout

\end_deeper
\begin_layout Itemize
Notice how the two lines below are different in the PDF vs LyX files:
\end_layout

\begin_deeper
\begin_layout Itemize
\begin_inset Quotes eld
\end_inset


\begin_inset Quotes qrd
\end_inset


\begin_inset Quotes erd
\end_inset

 
\begin_inset Quotes eld
\end_inset

`
\begin_inset Quotes erd
\end_inset

 
\begin_inset Quotes eld
\end_inset

‘
\begin_inset Quotes erd
\end_inset

 
\begin_inset Quotes eld
\end_inset

'
\begin_inset Quotes erd
\end_inset

 
\begin_inset Quotes eld
\end_inset

’
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout LyX-Code
\begin_inset Quotes eld
\end_inset


\begin_inset Quotes qrd
\end_inset


\begin_inset Quotes erd
\end_inset

 
\begin_inset Quotes eld
\end_inset

`
\begin_inset Quotes erd
\end_inset

 
\begin_inset Quotes eld
\end_inset

‘
\begin_inset Quotes erd
\end_inset

 
\begin_inset Quotes eld
\end_inset

'
\begin_inset Quotes erd
\end_inset

 
\begin_inset Quotes eld
\end_inset

’
\begin_inset Quotes erd
\end_inset


\end_layout

\end_deeper
\end_body
\end_document

Attachment: MWEquotes.pdf
Description: Adobe PDF document

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-- 
lyx-users mailing list
lyx-users@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-users
  • apostrophe,... Denniston, Todd A CIV USN NSWC CD CRANE IN (USA) via lyx-users

Reply via email to