qpic_input_to_diagram#
View source on GitHub
|
Invoke qpic script to generate output diagram of type qpic/tex/pdf/png.
qualtran.drawing.qpic_diagram.qpic_input_to_diagram(
qpic_file: Union[pathlib.Path, str],
output_file: Union[None, pathlib.Path, str] = None,
output_type: str = 'pdf'
) -> str
Outputs one of the following files, based on output_type:
qpic_file.with_suffix(‘.qpic’) - Copies the input qpic_file to output_file.
qpic_file.with_suffix(‘.tex’) - Obtained via
qpic -f base_file_path.qpicqpic_file.with_suffix(‘.pdf’) - Uses
pdflatextool to convert tex to pdf. See https://tug.org/applications/pdftex/ for more details on how to installpdflatex.qpic_file.with_suffix(‘.png’) - Uses
converttool to convert pdf to png. See https://imagemagick.org/ for more details on how to installconvert.
Args
qpic_filePath to file containing input that should be passed to the
qpicscript.output_fileOptional path to the output where generated diagram should be saved. Defaults to qpic_file.with_suffix(f”.{output_type}”)
output_typeFormat of the diagram generated using qpic. Supported output types are one of [‘qpic’, ‘tex’, ‘pdf’, ‘png’]
View source on GitHub